Author: [EMAIL PROTECTED]
Date: Fri Oct 24 05:37:53 2008
New Revision: 590
Added:
changes/[EMAIL PROTECTED]/prepare-120/
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/
- copied from r588, /branches/bleeding_edge/
Modified:
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/codegen-arm.cc
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/codegen-ia32.cc
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/ic-arm.cc
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/ic-ia32.cc
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/stub-cache-arm.cc
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/stub-cache-ia32.cc
Log:
Get ready for fixing issue 120: Pin point the places
where the receiver needs to be patched with the proxy
and get ready of unnecessary function patching on ARM.
Modified:
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/codegen-arm.cc
==============================================================================
--- /branches/bleeding_edge/src/codegen-arm.cc (original)
+++
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/codegen-arm.cc
Fri Oct 24 05:37:53 2008
@@ -2240,8 +2240,8 @@
__ mov(r0, Operand(var->name()));
__ push(r0);
- // TODO(120): use JSGlobalObject for function lookup and inline cache,
- // and use global proxy as 'this' for invocation.
+ // TODO(120): Use global object for function lookup and inline
+ // cache, and use global proxy as 'this' for invocation.
LoadGlobalReceiver(r0);
// Load the arguments.
@@ -2329,11 +2329,10 @@
// Load the function.
Load(function);
- // Pass the global object as the receiver.
- // TODO(120): use JSGlobalObject for function lookup and inline cache,
- // and use global proxy as 'this' for invocation.
+ // Pass the global proxy as the receiver.
LoadGlobalReceiver(r0);
+
// Call the function.
CallWithArguments(args, node->position());
__ push(r0);
@@ -2351,9 +2350,10 @@
// evaluated.
// Compute function to call and use the global object as the
- // receiver.
+ // receiver. There is no need to use the global proxy here because
+ // it will always be replaced with a newly allocated object.
Load(node->expression());
- LoadGlobalReceiver(r0);
+ LoadGlobal();
// Push the arguments ("left-to-right") on the stack.
ZoneList<Expression*>* args = node->arguments();
Modified:
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/codegen-ia32.cc
==============================================================================
--- /branches/bleeding_edge/src/codegen-ia32.cc (original)
+++
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/codegen-ia32.cc
Fri Oct 24 05:37:53 2008
@@ -2660,8 +2660,8 @@
// Push the name of the function and the receiver onto the stack.
frame_->Push(Immediate(var->name()));
- // TODO(120): use JSGlobalObject for function lookup and inline cache,
- // and use global proxy as 'this' for invocation.
+ // TODO(120): Use global object for function lookup and inline
+ // cache, and use global proxy as 'this' for invocation.
LoadGlobalReceiver(eax);
// Load the arguments.
@@ -2747,10 +2747,7 @@
// Load the function.
Load(function);
- // Pass the global object as the receiver.
-
- // TODO(120): use JSGlobalObject for function lookup and inline cache,
- // and use global proxy as 'this' for invocation.
+ // Pass the global proxy as the receiver.
LoadGlobalReceiver(eax);
// Call the function.
@@ -2769,9 +2766,10 @@
// evaluated.
// Compute function to call and use the global object as the
- // receiver.
+ // receiver. There is no need to use the global proxy here because
+ // it will always be replaced with a newly allocated object.
Load(node->expression());
- LoadGlobalReceiver(eax);
+ LoadGlobal();
// Push the arguments ("left-to-right") on the stack.
ZoneList<Expression*>* args = node->arguments();
Modified:
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/ic-arm.cc
==============================================================================
--- /branches/bleeding_edge/src/ic-arm.cc (original)
+++ changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/ic-arm.cc
Fri Oct 24 05:37:53 2008
@@ -365,7 +365,7 @@
// If this assert fails, we have to check upper bound too.
ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
- // Check for access to global object (unlikely).
+ // Check for access to global proxy.
__ cmp(r0, Operand(JS_GLOBAL_PROXY_TYPE));
__ b(eq, &global);
@@ -383,8 +383,8 @@
__ cmp(r0, Operand(JS_FUNCTION_TYPE));
__ b(ne, &miss);
- // Patch the function on the stack; 1 ~ receiver.
- __ str(r1, MemOperand(sp, (argc + 1) * kPointerSize));
+ // TODO(120): Check for access to global object. Needs patching of
+ // receiver but no security check.
// Invoke the function.
ParameterCount actual(argc);
@@ -425,13 +425,12 @@
CEntryStub stub;
__ CallStub(&stub);
- // Move result to r1.
+ // Move result to r1 and leave the internal frame.
__ mov(r1, Operand(r0));
-
__ LeaveInternalFrame();
- // Patch the function on the stack; 1 ~ receiver.
- __ str(r1, MemOperand(sp, (argc + 1) * kPointerSize));
+ // TODO(120): Check for access to to global object. Needs patching
+ // of receiver but no security check.
// Invoke the function.
ParameterCount actual(argc);
@@ -484,7 +483,6 @@
// Check for access to global object (unlikely).
__ cmp(r1, Operand(JS_GLOBAL_PROXY_TYPE));
__ b(eq, &global);
-
__ bind(&probe);
GenerateDictionaryLoad(masm, &done, &miss, r1, r0);
Modified:
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/ic-ia32.cc
==============================================================================
--- /branches/bleeding_edge/src/ic-ia32.cc (original)
+++ changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/ic-ia32.cc
Fri Oct 24 05:37:53 2008
@@ -479,7 +479,7 @@
// If this assert fails, we have to check upper bound too.
ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
- // Check for access to global object.
+ // Check for access to global proxy.
__ cmp(eax, JS_GLOBAL_PROXY_TYPE);
__ j(equal, &global, not_taken);
@@ -498,11 +498,14 @@
__ cmp(edx, JS_FUNCTION_TYPE);
__ j(not_equal, &miss, not_taken);
+ // TODO(120): Check for access to global object. Needs patching of
+ // receiver but no security check.
+
// Invoke the function.
ParameterCount actual(argc);
__ InvokeFunction(edi, actual, JUMP_FUNCTION);
- // Global object access: Check access rights.
+ // Global object proxy access: Check access rights.
__ bind(&global);
__ CheckAccessGlobalProxy(edx, eax, &miss);
__ jmp(&probe);
@@ -541,6 +544,9 @@
// Move result to edi and exit the internal frame.
__ mov(Operand(edi), eax);
__ LeaveInternalFrame();
+
+ // TODO(120): Check for access to to global object. Needs patching
+ // of receiver but no security check.
// Invoke the function.
ParameterCount actual(argc);
Modified:
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/stub-cache-arm.cc
==============================================================================
--- /branches/bleeding_edge/src/stub-cache-arm.cc (original)
+++
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/stub-cache-arm.cc
Fri Oct 24 05:37:53 2008
@@ -240,8 +240,9 @@
__ cmp(r2, Operand(JS_FUNCTION_TYPE));
__ b(ne, &miss);
- // Patch the function on the stack; 1 ~ receiver.
- __ str(r1, MemOperand(sp, (argc + 1) * kPointerSize));
+ if (object->IsGlobalObject()) {
+ // TODO(120): Patch receiver with the global proxy.
+ }
// Invoke the function.
__ InvokeFunction(r1, arguments(), JUMP_FUNCTION);
@@ -352,8 +353,9 @@
__ mov(r1, Operand(Handle<JSFunction>(function)));
__ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
- // Patch the function on the stack; 1 ~ receiver.
- __ str(r1, MemOperand(sp, (argc + 1) * kPointerSize));
+ if (object->IsGlobalObject()) {
+ // TODO(120): Patch receiver with the global proxy.
+ }
// Jump to the cached code (tail call).
Handle<Code> code(function->code());
Modified:
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/stub-cache-ia32.cc
==============================================================================
--- /branches/bleeding_edge/src/stub-cache-ia32.cc (original)
+++
changes/[EMAIL PROTECTED]/prepare-120/bleeding_edge/src/stub-cache-ia32.cc
Fri Oct 24 05:37:53 2008
@@ -478,6 +478,7 @@
__ CallRuntime(Runtime::kLazyCompile, 1);
__ pop(edi);
+ // Tear down temporary frame.
__ LeaveInternalFrame();
// Do a tail-call of the compiled function.
@@ -519,6 +520,10 @@
__ cmp(ebx, JS_FUNCTION_TYPE);
__ j(not_equal, &miss, not_taken);
+ if (object->IsGlobalObject()) {
+ // TODO(120): Patch receiver with the global proxy.
+ }
+
// Invoke the function.
__ InvokeFunction(edi, arguments(), JUMP_FUNCTION);
@@ -627,6 +632,10 @@
__ mov(Operand(edi), Immediate(Handle<JSFunction>(function)));
__ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
+ if (object->IsGlobalObject()) {
+ // TODO(120): Patch receiver with the global proxy.
+ }
+
// Jump to the cached code (tail call).
Handle<Code> code(function->code());
ParameterCount expected(function->shared()->formal_parameter_count());
@@ -696,6 +705,10 @@
__ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset));
__ cmp(ebx, JS_FUNCTION_TYPE);
__ j(not_equal, &miss, not_taken);
+
+ if (object->IsGlobalObject()) {
+ // TODO(120): Patch receiver with the global proxy.
+ }
// Invoke the function.
__ InvokeFunction(edi, arguments(), JUMP_FUNCTION);
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---