Title: [238435] trunk/Source/_javascript_Core
Revision
238435
Author
yusukesuz...@slowstart.org
Date
2018-11-21 18:57:14 -0800 (Wed, 21 Nov 2018)

Log Message

[JSC] Use ProtoCallFrame::numberOfRegisters instead of raw number `4`
https://bugs.webkit.org/show_bug.cgi?id=191877

Reviewed by Sam Weinig.

Instead of hard-coding `4` into LowLevelInterpreter, use ProtoCallFrame::numberOfRegisters.

* interpreter/ProtoCallFrame.h:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (238434 => 238435)


--- trunk/Source/_javascript_Core/ChangeLog	2018-11-22 02:12:04 UTC (rev 238434)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-11-22 02:57:14 UTC (rev 238435)
@@ -1,3 +1,16 @@
+2018-11-21  Yusuke Suzuki  <yusukesuz...@slowstart.org>
+
+        [JSC] Use ProtoCallFrame::numberOfRegisters instead of raw number `4`
+        https://bugs.webkit.org/show_bug.cgi?id=191877
+
+        Reviewed by Sam Weinig.
+
+        Instead of hard-coding `4` into LowLevelInterpreter, use ProtoCallFrame::numberOfRegisters.
+
+        * interpreter/ProtoCallFrame.h:
+        * llint/LowLevelInterpreter32_64.asm:
+        * llint/LowLevelInterpreter64.asm:
+
 2018-11-21  Mark Lam  <mark....@apple.com>
 
         Creating a wasm memory that is bigger than the ArrayBuffer limit but smaller than the spec limit should throw OOME not RangeError.

Modified: trunk/Source/_javascript_Core/interpreter/ProtoCallFrame.h (238434 => 238435)


--- trunk/Source/_javascript_Core/interpreter/ProtoCallFrame.h	2018-11-22 02:12:04 UTC (rev 238434)
+++ trunk/Source/_javascript_Core/interpreter/ProtoCallFrame.h	2018-11-22 02:57:14 UTC (rev 238435)
@@ -35,6 +35,9 @@
 struct JS_EXPORT_PRIVATE ProtoCallFrame {
     WTF_FORBID_HEAP_ALLOCATION;
 public:
+    // CodeBlock, Callee, ArgumentCount, and |this|.
+    static constexpr unsigned numberOfRegisters { 4 };
+
     Register codeBlockValue;
     Register calleeValue;
     Register argCountAndCodeOriginValue;

Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm (238434 => 238435)


--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2018-11-22 02:12:04 UTC (rev 238434)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2018-11-22 02:57:14 UTC (rev 238435)
@@ -214,7 +214,7 @@
 
 .stackHeightOK:
     move t3, sp
-    move 4, t3
+    move (constexpr ProtoCallFrame::numberOfRegisters), t3
 
 .copyHeaderLoop:
     subi 1, t3

Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm (238434 => 238435)


--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2018-11-22 02:12:04 UTC (rev 238434)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2018-11-22 02:57:14 UTC (rev 238435)
@@ -201,7 +201,7 @@
 
 .stackHeightOK:
     move t3, sp
-    move 4, t3
+    move (constexpr ProtoCallFrame::numberOfRegisters), t3
 
 .copyHeaderLoop:
     # Copy the CodeBlock/Callee/ArgumentCount/|this| from protoCallFrame into the callee frame.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to