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

Unified Diff: runtime/vm/assembler_mips.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_mips.cc
diff --git a/runtime/vm/assembler_mips.cc b/runtime/vm/assembler_mips.cc
index cb65f3536f2e672ce0871fa7169cba8608f89445..bb0792ed1b96259d54b7ed3b9424cbed3ef29ea1 100644
--- a/runtime/vm/assembler_mips.cc
+++ b/runtime/vm/assembler_mips.cc
@@ -885,20 +885,29 @@ void Assembler::UpdateAllocationStatsWithSize(intptr_t cid,
void Assembler::MaybeTraceAllocation(intptr_t cid,
Register temp_reg,
- Label* trace) {
+ Label* trace,
+ bool inline_isolate) {
ASSERT(cid > 0);
ASSERT(!in_delay_slot_);
ASSERT(temp_reg != kNoRegister);
ASSERT(temp_reg != TMP);
- intptr_t state_offset;
- ClassTable* class_table = Isolate::Current()->class_table();
- ClassHeapStats** table_ptr =
- class_table->StateAddressFor(cid, &state_offset);
- if (cid < kNumPredefinedCids) {
- LoadImmediate(temp_reg, reinterpret_cast<uword>(*table_ptr) + state_offset);
+ intptr_t state_offset = ClassTable::StateOffsetFor(cid);
+ if (inline_isolate) {
+ ClassTable* class_table = Isolate::Current()->class_table();
+ ClassHeapStats** table_ptr = class_table->TableAddressFor(cid);
+ if (cid < kNumPredefinedCids) {
+ LoadImmediate(temp_reg,
+ reinterpret_cast<uword>(*table_ptr) + state_offset);
+ } else {
+ LoadImmediate(temp_reg, reinterpret_cast<uword>(table_ptr));
+ lw(temp_reg, Address(temp_reg, 0));
+ AddImmediate(temp_reg, state_offset);
+ }
} else {
- LoadImmediate(temp_reg, reinterpret_cast<uword>(table_ptr));
- lw(temp_reg, Address(temp_reg, 0));
+ LoadIsolate(temp_reg);
+ intptr_t table_offset =
+ Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid);
+ lw(temp_reg, Address(temp_reg, table_offset));
AddImmediate(temp_reg, state_offset);
}
lw(temp_reg, Address(temp_reg, 0));

Powered by Google App Engine
This is Rietveld 408576698