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

Unified Diff: src/ia32/stub-cache-ia32.cc

Issue 111613003: Load the global proxy from the context of the target function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: hydrogen Created 7 years 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/ia32/stub-cache-ia32.cc
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc
index 6ab3964b80f75b469e0004d32c0ee75d82e00278..43ab4369393d63846a9747864bd660061dc393c5 100644
--- a/src/ia32/stub-cache-ia32.cc
+++ b/src/ia32/stub-cache-ia32.cc
@@ -2468,11 +2468,12 @@ void StubCompiler::GenerateBooleanCheck(Register object, Label* miss) {
}
-void CallStubCompiler::PatchGlobalProxy(Handle<Object> object) {
+void CallStubCompiler::PatchGlobalProxy(Handle<Object> object,
+ Handle<JSFunction> function) {
if (object->IsGlobalObject()) {
const int argc = arguments().immediate();
const int receiver_offset = (argc + 1) * kPointerSize;
- __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset));
+ __ LoadHeapObject(edx, handle(function->context()->global_proxy()));
__ mov(Operand(esp, receiver_offset), edx);
}
}
@@ -2566,7 +2567,7 @@ void CallStubCompiler::GenerateJumpFunction(Handle<Object> object,
GenerateFunctionCheck(function, ebx, miss);
if (!function.is(edi)) __ mov(edi, function);
- PatchGlobalProxy(object);
+ PatchGlobalProxy(object, function);
// Invoke the function.
__ InvokeFunction(edi, arguments(), JUMP_FUNCTION,
@@ -2681,6 +2682,17 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
#define __ ACCESS_MASM(masm)
+void CallStubCompiler::PatchGlobalProxy(MacroAssembler* masm,
+ int argc,
+ Register function) {
+ __ mov(edx, FieldOperand(function, JSFunction::kContextOffset));
+ __ mov(edx, ContextOperand(edx, Context::GLOBAL_OBJECT_INDEX));
+ __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset));
+ const int receiver_offset = (argc + 1) * kPointerSize;
+ __ mov(Operand(esp, receiver_offset), edx);
+}
+
+
void StoreStubCompiler::GenerateStoreViaSetter(
MacroAssembler* masm,
Handle<JSFunction> setter) {

Powered by Google App Engine
This is Rietveld 408576698