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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 1247783002: Make array allocation stub shared between isolates. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
Index: runtime/vm/assembler_x64.cc
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index 48118d519c1c296892d78133a55d58321b292a07..e0ffcb37b2cdad41862f3197a81845c9e9cf5db7 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -3185,7 +3185,7 @@ void Assembler::Stop(const char* message, bool fixed_length_encoding) {
} else {
LoadImmediate(RDI, Immediate(message_address), PP);
}
- call(&Isolate::Current()->stub_code()->PrintStopMessageLabel());
+ call(&StubCode::PrintStopMessageLabel());
popq(RDI); // Restore RDI register.
popq(TMP); // Restore TMP register.
} else {
@@ -3440,19 +3440,25 @@ void Assembler::LeaveStubFrame() {
void Assembler::MaybeTraceAllocation(intptr_t cid,
Label* trace,
- bool near_jump) {
+ bool near_jump,
+ bool inline_isolate) {
ASSERT(cid > 0);
- intptr_t state_offset;
- ClassTable* class_table = Isolate::Current()->class_table();
- ClassHeapStats** table_ptr =
- class_table->StateAddressFor(cid, &state_offset);
+ intptr_t state_offset = ClassTable::StateOffsetFor(cid);
Register temp_reg = TMP;
- if (cid < kNumPredefinedCids) {
- movq(temp_reg, Immediate(reinterpret_cast<uword>(*table_ptr)));
+ if (inline_isolate) {
+ ClassTable* class_table = Isolate::Current()->class_table();
+ ClassHeapStats** table_ptr = class_table->TableAddressFor(cid);
+ if (cid < kNumPredefinedCids) {
+ movq(temp_reg, Immediate(reinterpret_cast<uword>(*table_ptr)));
+ } else {
+ movq(temp_reg, Immediate(reinterpret_cast<uword>(table_ptr)));
+ movq(temp_reg, Address(temp_reg, 0));
+ }
} else {
- Register temp_reg = TMP;
- movq(temp_reg, Immediate(reinterpret_cast<uword>(table_ptr)));
- movq(temp_reg, Address(temp_reg, 0));
+ LoadIsolate(temp_reg);
+ intptr_t table_offset =
+ Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid);
+ movq(temp_reg, Address(temp_reg, table_offset));
}
testb(Address(temp_reg, state_offset),
Immediate(ClassHeapStats::TraceAllocationMask()));

Powered by Google App Engine
This is Rietveld 408576698