Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1769)

Unified Diff: runtime/vm/raw_object.h

Issue 1192103004: VM: New calling convention for generated code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fixed comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/profiler.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « runtime/vm/profiler.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698