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

Unified Diff: src/ia32/macro-assembler-ia32.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: Add patch from Orion for interpreter cementation test. Disable obsolete/invalid tests. 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/ia32/macro-assembler-ia32.h ('k') | src/ic/arm/handler-compiler-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/macro-assembler-ia32.cc
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
index cbf9efb11f4a21a5f63c35b26c0a64ad5dd84235..fa3be8ead154a6fa242780739c557f7328555525 100644
--- a/src/ia32/macro-assembler-ia32.cc
+++ b/src/ia32/macro-assembler-ia32.cc
@@ -1069,10 +1069,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
Check(not_equal, kWeShouldNotHaveAnEmptyLexicalContext);
}
// Load the native context of the current context.
- int offset =
- Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize;
- mov(scratch1, FieldOperand(scratch1, offset));
- mov(scratch1, FieldOperand(scratch1, JSGlobalObject::kNativeContextOffset));
+ mov(scratch1, ContextOperand(scratch1, Context::NATIVE_CONTEXT_INDEX));
// Check the context is a native context.
if (emit_debug_code()) {
@@ -2131,8 +2128,7 @@ void MacroAssembler::InvokeBuiltin(int native_context_index, InvokeFlag flag,
void MacroAssembler::GetBuiltinFunction(Register target,
int native_context_index) {
// Load the JavaScript builtin function from the builtins object.
- mov(target, GlobalObjectOperand());
- mov(target, FieldOperand(target, JSGlobalObject::kNativeContextOffset));
+ mov(target, NativeContextOperand());
mov(target, ContextOperand(target, native_context_index));
}
@@ -2164,8 +2160,8 @@ void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
void MacroAssembler::LoadGlobalProxy(Register dst) {
- mov(dst, GlobalObjectOperand());
- mov(dst, FieldOperand(dst, JSGlobalObject::kGlobalProxyOffset));
+ mov(dst, NativeContextOperand());
+ mov(dst, ContextOperand(dst, Context::GLOBAL_PROXY_INDEX));
}
@@ -2176,8 +2172,7 @@ void MacroAssembler::LoadTransitionedArrayMapConditional(
Register scratch,
Label* no_map_match) {
// Load the global or builtins object from the current context.
- mov(scratch, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
- mov(scratch, FieldOperand(scratch, JSGlobalObject::kNativeContextOffset));
+ mov(scratch, NativeContextOperand());
// Check that the function's map is the same as the expected cached map.
mov(scratch, Operand(scratch,
@@ -2196,13 +2191,10 @@ void MacroAssembler::LoadTransitionedArrayMapConditional(
void MacroAssembler::LoadGlobalFunction(int index, Register function) {
- // Load the global or builtins object from the current context.
- mov(function,
- Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
- // Load the native context from the global or builtins object.
- mov(function, FieldOperand(function, JSGlobalObject::kNativeContextOffset));
+ // Load the native context from the current context.
+ mov(function, NativeContextOperand());
// Load the function from the native context.
- mov(function, Operand(function, Context::SlotOffset(index)));
+ mov(function, ContextOperand(function, index));
}
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ic/arm/handler-compiler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698