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

Unified Diff: runtime/vm/assembler_arm64.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_arm64.cc
diff --git a/runtime/vm/assembler_arm64.cc b/runtime/vm/assembler_arm64.cc
index 290890eba5b75a3499ae0bd2a56f5bc2bbe5a1fa..b727663dbccfd82f56dac31b2dbc6111f882a192 100644
--- a/runtime/vm/assembler_arm64.cc
+++ b/runtime/vm/assembler_arm64.cc
@@ -1302,19 +1302,26 @@ void Assembler::UpdateAllocationStatsWithSize(intptr_t cid,
void Assembler::MaybeTraceAllocation(intptr_t cid,
Register temp_reg,
Register pp,
- Label* trace) {
+ Label* trace,
+ 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);
-
- if (cid < kNumPredefinedCids) {
- LoadImmediate(
- temp_reg, reinterpret_cast<uword>(*table_ptr) + state_offset, pp);
+ 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, pp);
+ } else {
+ LoadImmediate(temp_reg, reinterpret_cast<uword>(table_ptr), pp);
+ ldr(temp_reg, Address(temp_reg, 0));
+ AddImmediate(temp_reg, temp_reg, state_offset, pp);
+ }
} else {
- LoadImmediate(temp_reg, reinterpret_cast<uword>(table_ptr), pp);
- ldr(temp_reg, Address(temp_reg, 0));
+ LoadIsolate(temp_reg);
+ intptr_t table_offset =
+ Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid);
+ ldr(temp_reg, Address(temp_reg, table_offset));
AddImmediate(temp_reg, temp_reg, state_offset, pp);
}
ldr(temp_reg, Address(temp_reg, 0));

Powered by Google App Engine
This is Rietveld 408576698