Index: runtime/vm/raw_object.h |
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h |
index cef2223f7a70706d4c2ee0ce8684a6ef12f7864f..73bbfbcfb8efd2c7480d8487a7bd78a5249813d5 100644 |
--- a/runtime/vm/raw_object.h |
+++ b/runtime/vm/raw_object.h |
@@ -413,6 +413,9 @@ class RawObject { |
bool IsInstructions() { |
return ((GetClassId() == kInstructionsCid)); |
} |
+ bool IsCode() { |
+ return ((GetClassId() == kCodeCid)); |
+ } |
intptr_t Size() const { |
uword tags = ptr()->tags_; |
@@ -578,6 +581,7 @@ class RawObject { |
friend class Mint; |
friend class Object; |
friend class OneByteString; // StoreSmi |
+ friend class RawCode; |
friend class RawExternalTypedData; |
friend class RawInstructions; |
friend class RawInstance; |
@@ -596,6 +600,7 @@ class RawObject { |
friend class TypedDataView; |
friend class WeakProperty; // StorePointer |
friend class Instance; // StorePointer |
+ friend class StackFrame; // GetCodeObject assertion. |
DISALLOW_ALLOCATION(); |
DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); |
@@ -774,7 +779,7 @@ class RawFunction : public RawObject { |
RawObject** to_no_code() { |
return reinterpret_cast<RawObject**>(&ptr()->ic_data_array_); |
} |
- RawInstructions* instructions_; // Instructions of currently active code. |
+ RawCode* code_; // Currently active code. |
RawCode* unoptimized_code_; // Unoptimized code, keep it after optimization. |
RawObject** to() { |
return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_); |
@@ -1004,10 +1009,14 @@ class RawCode : public RawObject { |
RAW_HEAP_OBJECT_IMPLEMENTATION(Code); |
+ uword entry_point_; |
+ |
RawObject** from() { |
- return reinterpret_cast<RawObject**>(&ptr()->instructions_); |
+ return reinterpret_cast<RawObject**>(&ptr()->active_instructions_); |
} |
+ RawInstructions* active_instructions_; |
RawInstructions* instructions_; |
+ RawObjectPool* object_pool_; |
// If owner_ is Function::null() the owner is a regular stub. |
// If owner_ is a Class the owner is the allocation stub for that class. |
// Else, owner_ is a regular Dart Function. |
@@ -1026,7 +1035,6 @@ class RawCode : public RawObject { |
RawObject** to() { |
return reinterpret_cast<RawObject**>(&ptr()->return_address_metadata_); |
} |
- uword entry_point_; |
// Compilation timestamp. |
int64_t compile_timestamp_; |
@@ -1038,18 +1046,19 @@ class RawCode : public RawObject { |
int32_t state_bits_; |
// PC offsets for code patching. |
- int32_t entry_patch_pc_offset_; |
- int32_t patch_code_pc_offset_; |
int32_t lazy_deopt_pc_offset_; |
// Variable length data follows here. |
int32_t* data() { OPEN_ARRAY_START(int32_t, int32_t); } |
const int32_t* data() const { OPEN_ARRAY_START(int32_t, int32_t); } |
+ static bool ContainsPC(RawObject* raw_obj, uword pc); |
+ |
friend class Function; |
friend class MarkingVisitor; |
friend class SkippedCodeFunctions; |
friend class StackFrame; |
+ friend class Profiler; |
}; |
@@ -1078,14 +1087,6 @@ class RawObjectPool : public RawObject { |
class RawInstructions : public RawObject { |
RAW_HEAP_OBJECT_IMPLEMENTATION(Instructions); |
- RawObject** from() { |
- return reinterpret_cast<RawObject**>(&ptr()->code_); |
- } |
- RawCode* code_; |
- RawObjectPool* object_pool_; |
- RawObject** to() { |
- return reinterpret_cast<RawObject**>(&ptr()->object_pool_); |
- } |
int32_t size_; |
// Variable length data follows here. |
@@ -1094,7 +1095,7 @@ class RawInstructions : public RawObject { |
// Private helper function used while visiting stack frames. The |
// code which iterates over dart frames is also called during GC and |
// is not allowed to create handles. |
- static bool ContainsPC(RawObject* raw_obj, uword pc); |
+ static bool ContainsPC(RawInstructions* raw_instr, uword pc); |
friend class RawCode; |
friend class RawFunction; |