summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2013-04-18 16:36:43 -0700
committer Ian Rogers <irogers@google.com> 2013-04-18 16:36:43 -0700
commita1827042bb46161b452cd720d235fb1cdfefaa76 (patch)
treec4c2db93e91f3020ae4d44717679f164323b2b43
parent23055dc5d7a90c4a12e259fd0ed7cd4d04d89182 (diff)
Tidy up compiled method.
Document the meaning of fields, in particular their meaning for quick or portable. Make symbol const. Document kAccConstructor in modifiers applies to both <init> and <clinit>. Change-Id: Ib42dd6e7db3759c11ea222f9bc72cb00356fad62
-rw-r--r--src/compiled_method.cc2
-rw-r--r--src/compiled_method.h19
-rw-r--r--src/modifiers.h2
3 files changed, 15 insertions, 8 deletions
diff --git a/src/compiled_method.cc b/src/compiled_method.cc
index 0981412d18..757a324155 100644
--- a/src/compiled_method.cc
+++ b/src/compiled_method.cc
@@ -118,7 +118,7 @@ CompiledMethod::CompiledMethod(InstructionSet instruction_set,
const std::vector<uint8_t>& native_gc_map)
: CompiledCode(instruction_set, code), frame_size_in_bytes_(frame_size_in_bytes),
core_spill_mask_(core_spill_mask), fp_spill_mask_(fp_spill_mask),
- native_gc_map_(native_gc_map)
+ gc_map_(native_gc_map)
{
DCHECK_EQ(vmap_table.size(),
static_cast<uint32_t>(__builtin_popcount(core_spill_mask)
diff --git a/src/compiled_method.h b/src/compiled_method.h
index 25fc33a588..fb0172cc19 100644
--- a/src/compiled_method.h
+++ b/src/compiled_method.h
@@ -26,7 +26,7 @@
namespace llvm {
class Function;
-}
+} // namespace llvm
namespace art {
@@ -86,7 +86,7 @@ class CompiledCode {
std::vector<uint8_t> code_;
// Used for the Portable ELF symbol name.
- std::string symbol_;
+ const std::string symbol_;
// There are offsets from the oatdata symbol to where the offset to
// the compiled method will be found. These are computed by the
@@ -121,7 +121,7 @@ class CompiledMethod : public CompiledCode {
const std::string& symbol)
: CompiledCode(instruction_set, code, symbol),
frame_size_in_bytes_(kStackAlignment), core_spill_mask_(0),
- fp_spill_mask_(0), native_gc_map_(gc_map) {
+ fp_spill_mask_(0), gc_map_(gc_map) {
}
// Constructs a CompiledMethod for the Portable JniCompiler.
@@ -155,17 +155,24 @@ class CompiledMethod : public CompiledCode {
return vmap_table_;
}
- const std::vector<uint8_t>& GetNativeGcMap() const {
- return native_gc_map_;
+ const std::vector<uint8_t>& GetGcMap() const {
+ return gc_map_;
}
private:
+ // For quick code, the size of the activation used by the code.
const size_t frame_size_in_bytes_;
+ // For quick code, a bit mask describing spilled GPR callee-save registers.
const uint32_t core_spill_mask_;
+ // For quick code, a bit mask describing spilled FPR callee-save registers.
const uint32_t fp_spill_mask_;
+ // For quick code, a map from native PC offset to dex PC.
std::vector<uint32_t> mapping_table_;
+ // For quick code, a map from GPR/FPR register to dex register.
std::vector<uint16_t> vmap_table_;
- std::vector<uint8_t> native_gc_map_;
+ // For quick code, a map keyed by native PC indices to bitmaps describing what dalvik registers
+ // are live. For portable code, the key is a dalvik PC.
+ std::vector<uint8_t> gc_map_;
};
} // namespace art
diff --git a/src/modifiers.h b/src/modifiers.h
index 78ba1404ef..a15b096da2 100644
--- a/src/modifiers.h
+++ b/src/modifiers.h
@@ -42,7 +42,7 @@ static const uint32_t kAccMiranda = 0x8000; // method
static const uint32_t kAccJavaFlagsMask = 0xffff; // bits set from Java sources (low 16)
-static const uint32_t kAccConstructor = 0x00010000; // method (dex only)
+static const uint32_t kAccConstructor = 0x00010000; // method (dex only) <init> and <clinit>
static const uint32_t kAccDeclaredSynchronized = 0x00020000; // method (dex only)
static const uint32_t kAccClassIsProxy = 0x00040000; // class (dex only)
// TODO: JACK CLASS ACCESS (HACK TO BE REMOVED)