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

Unified Diff: runtime/vm/raw_object.cc

Issue 1808553002: Precompilation: don't include an object header for instructions in the text section. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/raw_object.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.cc
diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc
index 437ab7e7225eda6d2d7cddf17f3ec18e532cc35a..98553cd9adb70b4d858ff4aa5cd41ba695b4991a 100644
--- a/runtime/vm/raw_object.cc
+++ b/runtime/vm/raw_object.cc
@@ -535,8 +535,11 @@ intptr_t RawCode::VisitCodePointers(RawCode* raw_obj,
RawCode* obj = raw_obj->ptr();
intptr_t length = Code::PtrOffBits::decode(obj->state_bits_);
+#if defined(TARGET_ARCH_IA32)
+ // On IA32 only we embed pointers to objects directly in the generated
+ // instructions. The variable portion of a Code object describes where to
+ // find those pointers for tracing.
if (Code::AliveBit::decode(obj->state_bits_)) {
- // Also visit all the embedded pointers in the corresponding instructions.
uword entry_point = reinterpret_cast<uword>(obj->instructions_->ptr()) +
Instructions::HeaderSize();
for (intptr_t i = 0; i < length; i++) {
@@ -546,6 +549,12 @@ intptr_t RawCode::VisitCodePointers(RawCode* raw_obj,
}
}
return Code::InstanceSize(length);
+#else
+ // On all other architectures, objects are referenced indirectly through
+ // either an ObjectPool or Thread.
+ ASSERT(length == 0);
+ return Code::InstanceSize(0);
+#endif
}
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698