Title: [163549] trunk/Source/_javascript_Core
Revision
163549
Author
[email protected]
Date
2014-02-06 10:45:32 -0800 (Thu, 06 Feb 2014)

Log Message

Make 32bit pass the correct this value to custom getters
https://bugs.webkit.org/show_bug.cgi?id=128313

Reviewed by Mark Lam.

Now that the custom getter calling convetion uses a single register
for the slot base we can easily pass the correct |thisValue| instead
of simply relying on the thisValue not be relevant to existing
custom getters. This also means that 32bit can call custom getters
directly.

* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArgumentsWithExecState):
* jit/Repatch.cpp:
(JSC::generateProtoChainAccessStub):
(JSC::tryBuildGetByIDList):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (163548 => 163549)


--- trunk/Source/_javascript_Core/ChangeLog	2014-02-06 18:20:48 UTC (rev 163548)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-02-06 18:45:32 UTC (rev 163549)
@@ -1,3 +1,22 @@
+2014-02-06  Oliver Hunt  <[email protected]>
+
+        Make 32bit pass the correct this value to custom getters
+        https://bugs.webkit.org/show_bug.cgi?id=128313
+
+        Reviewed by Mark Lam.
+
+        Now that the custom getter calling convetion uses a single register
+        for the slot base we can easily pass the correct |thisValue| instead
+        of simply relying on the thisValue not be relevant to existing
+        custom getters. This also means that 32bit can call custom getters
+        directly.
+
+        * jit/CCallHelpers.h:
+        (JSC::CCallHelpers::setupArgumentsWithExecState):
+        * jit/Repatch.cpp:
+        (JSC::generateProtoChainAccessStub):
+        (JSC::tryBuildGetByIDList):
+
 2014-02-05  Mark Hahnenberg  <[email protected]>
 
         Heap::writeBarrier shouldn't be static

Modified: trunk/Source/_javascript_Core/jit/CCallHelpers.h (163548 => 163549)


--- trunk/Source/_javascript_Core/jit/CCallHelpers.h	2014-02-06 18:20:48 UTC (rev 163548)
+++ trunk/Source/_javascript_Core/jit/CCallHelpers.h	2014-02-06 18:45:32 UTC (rev 163549)
@@ -354,6 +354,26 @@
         addCallArgument(arg3);
         addCallArgument(arg4);
     }
+    
+    ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImmPtr arg1, TrustedImm32 arg2, GPRReg arg3, TrustedImmPtr arg4)
+    {
+        resetCallArguments();
+        addCallArgument(GPRInfo::callFrameRegister);
+        addCallArgument(arg1);
+        addCallArgument(arg2);
+        addCallArgument(arg3);
+        addCallArgument(arg4);
+    }
+    
+    ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, GPRReg arg2, TrustedImm32 arg3, TrustedImmPtr arg4)
+    {
+        resetCallArguments();
+        addCallArgument(GPRInfo::callFrameRegister);
+        addCallArgument(arg1);
+        addCallArgument(arg2);
+        addCallArgument(arg3);
+        addCallArgument(arg4);
+    }
 
     ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, TrustedImmPtr arg2, TrustedImm32 arg3, GPRReg arg4, GPRReg arg5)
     {
@@ -1375,6 +1395,12 @@
         poke(arg4, POKE_ARGUMENT_OFFSET);
         setupArgumentsWithExecState(arg1, arg2, arg3);
     }
+    
+    ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, GPRReg arg2, TrustedImm32 arg3, TrustedImmPtr arg4)
+    {
+        poke(arg4, POKE_ARGUMENT_OFFSET);
+        setupArgumentsWithExecState(arg1, arg2, arg3);
+    }
 
     ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, GPRReg arg2, TrustedImm32 arg3, GPRReg arg4, GPRReg arg5)
     {

Modified: trunk/Source/_javascript_Core/jit/JITOperations.cpp (163548 => 163549)


--- trunk/Source/_javascript_Core/jit/JITOperations.cpp	2014-02-06 18:20:48 UTC (rev 163548)
+++ trunk/Source/_javascript_Core/jit/JITOperations.cpp	2014-02-06 18:45:32 UTC (rev 163549)
@@ -212,16 +212,6 @@
     return JSValue::encode(jsBoolean(CommonSlowPaths::opIn(exec, JSValue::decode(key), base)));
 }
 
-EncodedJSValue JIT_OPERATION operationCallCustomGetter(ExecState* exec, JSCell* base, PropertySlot::GetValueFunc function, StringImpl* uid)
-{
-    VM* vm = &exec->vm();
-    NativeCallFrameTracer tracer(vm, exec);
-    
-    Identifier ident(vm, uid);
-    
-    return function(exec, jsCast<JSObject*>(base), JSValue::encode(base), ident);
-}
-
 EncodedJSValue JIT_OPERATION operationCallGetter(ExecState* exec, JSCell* base, JSCell* getterSetter)
 {
     VM* vm = &exec->vm();

Modified: trunk/Source/_javascript_Core/jit/JITOperations.h (163548 => 163549)


--- trunk/Source/_javascript_Core/jit/JITOperations.h	2014-02-06 18:20:48 UTC (rev 163548)
+++ trunk/Source/_javascript_Core/jit/JITOperations.h	2014-02-06 18:45:32 UTC (rev 163549)
@@ -197,7 +197,6 @@
 EncodedJSValue JIT_OPERATION operationInOptimize(ExecState*, StructureStubInfo*, JSCell*, StringImpl*);
 EncodedJSValue JIT_OPERATION operationIn(ExecState*, StructureStubInfo*, JSCell*, StringImpl*);
 EncodedJSValue JIT_OPERATION operationGenericIn(ExecState*, JSCell*, EncodedJSValue);
-EncodedJSValue JIT_OPERATION operationCallCustomGetter(ExecState*, JSCell*, PropertySlot::GetValueFunc, StringImpl*) WTF_INTERNAL;
 EncodedJSValue JIT_OPERATION operationCallGetter(ExecState*, JSCell*, JSCell*) WTF_INTERNAL;
 void JIT_OPERATION operationPutByIdStrict(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;
 void JIT_OPERATION operationPutByIdNonStrict(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;

Modified: trunk/Source/_javascript_Core/jit/Repatch.cpp (163548 => 163549)


--- trunk/Source/_javascript_Core/jit/Repatch.cpp	2014-02-06 18:20:48 UTC (rev 163548)
+++ trunk/Source/_javascript_Core/jit/Repatch.cpp	2014-02-06 18:45:32 UTC (rev 163549)
@@ -303,17 +303,13 @@
             stubJit.setupArgumentsWithExecState(scratchGPR, resultGPR);
             operationFunction = operationCallGetter;
         } else {
-#if USE(JSVALUE64)
             // EncodedJSValue (*GetValueFunc)(ExecState*, JSObject* slotBase, EncodedJSValue thisValue, PropertyName);
+#if USE(JSVALUE64)
             stubJit.setupArgumentsWithExecState(MacroAssembler::TrustedImmPtr(protoObject), scratchGPR, MacroAssembler::TrustedImmPtr(propertyName.impl()));
-            operationFunction = FunctionPtr(slot.customGetter());
 #else
-            stubJit.move(MacroAssembler::TrustedImmPtr(protoObject), scratchGPR);
-            stubJit.setupArgumentsWithExecState(scratchGPR,
-                MacroAssembler::TrustedImmPtr(FunctionPtr(slot.customGetter()).executableAddress()),
-                MacroAssembler::TrustedImmPtr(propertyName.impl()));
-            operationFunction = operationCallCustomGetter;
+            stubJit.setupArgumentsWithExecState(MacroAssembler::TrustedImmPtr(protoObject), scratchGPR, MacroAssembler::TrustedImm32(JSValue::CellTag), MacroAssembler::TrustedImmPtr(propertyName.impl()));
 #endif
+            operationFunction = FunctionPtr(slot.customGetter());
         }
 
         // Need to make sure that whenever this call is made in the future, we remember the
@@ -619,14 +615,10 @@
 #if USE(JSVALUE64)
                 // EncodedJSValue (*GetValueFunc)(ExecState*, JSObject* slotBase, EncodedJSValue thisValue, PropertyName);
                 stubJit.setupArgumentsWithExecState(baseGPR, baseGPR, MacroAssembler::TrustedImmPtr(ident.impl()));
-                operationFunction = FunctionPtr(slot.customGetter());
 #else
-                stubJit.setupArgumentsWithExecState(
-                    baseGPR,
-                    MacroAssembler::TrustedImmPtr(FunctionPtr(slot.customGetter()).executableAddress()),
-                    MacroAssembler::TrustedImmPtr(ident.impl()));
-                operationFunction = operationCallCustomGetter;
+                stubJit.setupArgumentsWithExecState(baseGPR, baseGPR, MacroAssembler::TrustedImm32(JSValue::CellTag), MacroAssembler::TrustedImmPtr(ident.impl()));
 #endif
+                operationFunction = FunctionPtr(slot.customGetter());
             }
             
             // Need to make sure that whenever this call is made in the future, we remember the
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to