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

Unified Diff: src/full-codegen/arm64/full-codegen-arm64.cc

Issue 1480003002: [runtime] Replace global object link with native context link in all contexts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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: src/full-codegen/arm64/full-codegen-arm64.cc
diff --git a/src/full-codegen/arm64/full-codegen-arm64.cc b/src/full-codegen/arm64/full-codegen-arm64.cc
index d345ecf0868a886cf008d7245ea64dc639d26cd2..1d74f8404e9f9da892f09fbe886fd92cd1add026 100644
--- a/src/full-codegen/arm64/full-codegen-arm64.cc
+++ b/src/full-codegen/arm64/full-codegen-arm64.cc
@@ -1368,7 +1368,7 @@ void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy,
Variable* var = proxy->var();
DCHECK(var->IsUnallocatedOrGlobalSlot() ||
(var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL));
- __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand());
+ __ LoadGlobalObject(LoadDescriptor::ReceiverRegister());
__ Mov(LoadDescriptor::NameRegister(), Operand(var->name()));
__ Mov(LoadDescriptor::SlotRegister(),
SmiFromSlot(proxy->VariableFeedbackSlot()));
@@ -2228,7 +2228,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op,
if (var->IsUnallocated()) {
// Global var, const, or let.
__ Mov(StoreDescriptor::NameRegister(), Operand(var->name()));
- __ Ldr(StoreDescriptor::ReceiverRegister(), GlobalObjectMemOperand());
+ __ LoadGlobalObject(StoreDescriptor::ReceiverRegister());
EmitLoadStoreICSlot(slot);
CallStoreIC();
@@ -3820,11 +3820,7 @@ void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
Register boolean_done = x3;
Register empty_fixed_array = x4;
Register untagged_result = x5;
- __ Ldr(map_reg, GlobalObjectMemOperand());
- __ Ldr(map_reg,
- FieldMemOperand(map_reg, JSGlobalObject::kNativeContextOffset));
- __ Ldr(map_reg,
- ContextMemOperand(map_reg, Context::ITERATOR_RESULT_MAP_INDEX));
+ __ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, map_reg);
__ Pop(boolean_done);
__ Pop(result_value);
__ LoadRoot(empty_fixed_array, Heap::kEmptyFixedArrayRootIndex);
@@ -3854,9 +3850,7 @@ void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
__ LoadRoot(x0, Heap::kUndefinedValueRootIndex);
__ Push(x0);
- __ Ldr(x0, GlobalObjectMemOperand());
- __ Ldr(x0, FieldMemOperand(x0, JSGlobalObject::kNativeContextOffset));
- __ Ldr(x0, ContextMemOperand(x0, expr->context_index()));
+ __ LoadNativeContextSlot(expr->context_index(), x0);
}
@@ -3945,7 +3939,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
bool is_this = var->HasThisName(isolate());
DCHECK(is_sloppy(language_mode()) || is_this);
if (var->IsUnallocatedOrGlobalSlot()) {
- __ Ldr(x12, GlobalObjectMemOperand());
+ __ LoadGlobalObject(x12);
__ Mov(x11, Operand(var->name()));
__ Push(x12, x11);
__ CallRuntime(Runtime::kDeleteProperty_Sloppy, 2);
@@ -4772,11 +4766,7 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
Register boolean_done = x3;
Register empty_fixed_array = x4;
Register untagged_result = x5;
- __ Ldr(map_reg, GlobalObjectMemOperand());
- __ Ldr(map_reg,
- FieldMemOperand(map_reg, JSGlobalObject::kNativeContextOffset));
- __ Ldr(map_reg,
- ContextMemOperand(map_reg, Context::ITERATOR_RESULT_MAP_INDEX));
+ __ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, map_reg);
__ Pop(result_value);
__ LoadRoot(boolean_done,
done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
@@ -4833,9 +4823,7 @@ void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
// as their closure, not the anonymous closure containing the global
// code.
DCHECK(kSmiTag == 0);
- __ Ldr(x10, GlobalObjectMemOperand());
- __ Ldr(x10, FieldMemOperand(x10, JSGlobalObject::kNativeContextOffset));
- __ Ldr(x10, ContextMemOperand(x10, Context::CLOSURE_INDEX));
+ __ LoadNativeContextSlot(Context::CLOSURE_INDEX, x10);
} else if (closure_scope->is_eval_scope()) {
// Contexts created by a call to eval have the same closure as the
// context calling eval, not the anonymous closure containing the eval

Powered by Google App Engine
This is Rietveld 408576698