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

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

Issue 1481353002: X87: [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
« no previous file with comments | « src/crankshaft/x87/lithium-codegen-x87.cc ('k') | src/ic/x87/handler-compiler-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/x87/full-codegen-x87.cc
diff --git a/src/full-codegen/x87/full-codegen-x87.cc b/src/full-codegen/x87/full-codegen-x87.cc
index 6b8a8c827d140aa01633adff27d66f8d07b93a9a..b6a0e0854458c83acae75035828a0569ff1fdcbd 100644
--- a/src/full-codegen/x87/full-codegen-x87.cc
+++ b/src/full-codegen/x87/full-codegen-x87.cc
@@ -1297,7 +1297,10 @@ void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy,
Variable* var = proxy->var();
DCHECK(var->IsUnallocatedOrGlobalSlot() ||
(var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL));
- __ mov(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
+ __ mov(LoadDescriptor::ReceiverRegister(), NativeContextOperand());
+ __ mov(LoadDescriptor::ReceiverRegister(),
+ ContextOperand(LoadDescriptor::ReceiverRegister(),
+ Context::EXTENSION_INDEX));
__ mov(LoadDescriptor::NameRegister(), var->name());
__ mov(LoadDescriptor::SlotRegister(),
Immediate(SmiFromSlot(proxy->VariableFeedbackSlot())));
@@ -2088,8 +2091,7 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
__ CallRuntime(Runtime::kAllocateInNewSpace, 1);
__ bind(&done_allocate);
- __ mov(ebx, GlobalObjectOperand());
- __ mov(ebx, FieldOperand(ebx, JSGlobalObject::kNativeContextOffset));
+ __ mov(ebx, NativeContextOperand());
__ mov(ebx, ContextOperand(ebx, Context::ITERATOR_RESULT_MAP_INDEX));
__ mov(FieldOperand(eax, HeapObject::kMapOffset), ebx);
__ mov(FieldOperand(eax, JSObject::kPropertiesOffset),
@@ -2411,7 +2413,10 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op,
if (var->IsUnallocated()) {
// Global var, const, or let.
__ mov(StoreDescriptor::NameRegister(), var->name());
- __ mov(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand());
+ __ mov(StoreDescriptor::ReceiverRegister(), NativeContextOperand());
+ __ mov(StoreDescriptor::ReceiverRegister(),
+ ContextOperand(StoreDescriptor::ReceiverRegister(),
+ Context::EXTENSION_INDEX));
EmitLoadStoreICSlot(slot);
CallStoreIC();
@@ -4030,8 +4035,7 @@ void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
Label runtime, done;
__ Allocate(JSIteratorResult::kSize, eax, ecx, edx, &runtime, TAG_OBJECT);
- __ mov(ebx, GlobalObjectOperand());
- __ mov(ebx, FieldOperand(ebx, JSGlobalObject::kNativeContextOffset));
+ __ mov(ebx, NativeContextOperand());
__ mov(ebx, ContextOperand(ebx, Context::ITERATOR_RESULT_MAP_INDEX));
__ mov(FieldOperand(eax, HeapObject::kMapOffset), ebx);
__ mov(FieldOperand(eax, JSObject::kPropertiesOffset),
@@ -4055,9 +4059,7 @@ void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
// Push undefined as receiver.
__ push(Immediate(isolate()->factory()->undefined_value()));
- __ mov(eax, GlobalObjectOperand());
- __ mov(eax, FieldOperand(eax, JSGlobalObject::kNativeContextOffset));
- __ mov(eax, ContextOperand(eax, expr->context_index()));
+ __ LoadGlobalFunction(expr->context_index(), eax);
}
@@ -4146,7 +4148,8 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
bool is_this = var->HasThisName(isolate());
DCHECK(is_sloppy(language_mode()) || is_this);
if (var->IsUnallocatedOrGlobalSlot()) {
- __ push(GlobalObjectOperand());
+ __ mov(eax, NativeContextOperand());
+ __ push(ContextOperand(eax, Context::EXTENSION_INDEX));
__ push(Immediate(var->name()));
__ CallRuntime(Runtime::kDeleteProperty_Sloppy, 2);
context()->Plug(eax);
@@ -4711,8 +4714,7 @@ void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
// Contexts nested in the native context have a canonical empty function
// as their closure, not the anonymous closure containing the global
// code.
- __ mov(eax, GlobalObjectOperand());
- __ mov(eax, FieldOperand(eax, JSGlobalObject::kNativeContextOffset));
+ __ mov(eax, NativeContextOperand());
__ push(ContextOperand(eax, Context::CLOSURE_INDEX));
} else if (closure_scope->is_eval_scope()) {
// Contexts nested inside eval code have the same closure as the context
« no previous file with comments | « src/crankshaft/x87/lithium-codegen-x87.cc ('k') | src/ic/x87/handler-compiler-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698