Title: [153823] trunk/Source/_javascript_Core
Revision
153823
Author
[email protected]
Date
2013-08-08 09:38:31 -0700 (Thu, 08 Aug 2013)

Log Message

Moved ErrorConstructor and NativeErrorConstructor helper functions into
the Interpreter class.
https://bugs.webkit.org/show_bug.cgi?id=119576.

Reviewed by Oliver Hunt.

This change is needed to prepare for making Interpreter::getStackTrace()
private. It does not change the behavior of the code, only the lexical
scoping.

* interpreter/Interpreter.h:
- Added helper functions for ErrorConstructor and NativeErrorConstructor.
* runtime/ErrorConstructor.cpp:
(JSC::Interpreter::constructWithErrorConstructor):
(JSC::ErrorConstructor::getConstructData):
(JSC::Interpreter::callErrorConstructor):
(JSC::ErrorConstructor::getCallData):
- Don't want ErrorConstructor to call Interpreter::getStackTrace()
  directly. So, we moved the helper functions into the Interpreter
  class.
* runtime/NativeErrorConstructor.cpp:
(JSC::Interpreter::constructWithNativeErrorConstructor):
(JSC::NativeErrorConstructor::getConstructData):
(JSC::Interpreter::callNativeErrorConstructor):
(JSC::NativeErrorConstructor::getCallData):
- Don't want NativeErrorConstructor to call Interpreter::getStackTrace()
  directly. So, we moved the helper functions into the Interpreter
  class.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (153822 => 153823)


--- trunk/Source/_javascript_Core/ChangeLog	2013-08-08 14:49:44 UTC (rev 153822)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-08-08 16:38:31 UTC (rev 153823)
@@ -1,3 +1,34 @@
+2013-08-08  Mark Lam  <[email protected]>
+
+        Moved ErrorConstructor and NativeErrorConstructor helper functions into
+        the Interpreter class.
+        https://bugs.webkit.org/show_bug.cgi?id=119576.
+
+        Reviewed by Oliver Hunt.
+
+        This change is needed to prepare for making Interpreter::getStackTrace()
+        private. It does not change the behavior of the code, only the lexical
+        scoping.
+
+        * interpreter/Interpreter.h:
+        - Added helper functions for ErrorConstructor and NativeErrorConstructor.
+        * runtime/ErrorConstructor.cpp:
+        (JSC::Interpreter::constructWithErrorConstructor):
+        (JSC::ErrorConstructor::getConstructData):
+        (JSC::Interpreter::callErrorConstructor):
+        (JSC::ErrorConstructor::getCallData):
+        - Don't want ErrorConstructor to call Interpreter::getStackTrace()
+          directly. So, we moved the helper functions into the Interpreter
+          class.
+        * runtime/NativeErrorConstructor.cpp:
+        (JSC::Interpreter::constructWithNativeErrorConstructor):
+        (JSC::NativeErrorConstructor::getConstructData):
+        (JSC::Interpreter::callNativeErrorConstructor):
+        (JSC::NativeErrorConstructor::getCallData):
+        - Don't want NativeErrorConstructor to call Interpreter::getStackTrace()
+          directly. So, we moved the helper functions into the Interpreter
+          class.
+
 2013-08-07  Mark Hahnenberg  <[email protected]>
 
         32-bit code gen for TypeOf doesn't properly update the AbstractInterpreter state

Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.h (153822 => 153823)


--- trunk/Source/_javascript_Core/interpreter/Interpreter.h	2013-08-08 14:49:44 UTC (rev 153822)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.h	2013-08-08 16:38:31 UTC (rev 153823)
@@ -222,6 +222,11 @@
         static void addStackTraceIfNecessary(CallFrame*, JSValue error);
         JSString* stackTraceAsString(ExecState*, Vector<StackFrame>);
 
+        static EncodedJSValue JSC_HOST_CALL constructWithErrorConstructor(ExecState*);
+        static EncodedJSValue JSC_HOST_CALL callErrorConstructor(ExecState*);
+        static EncodedJSValue JSC_HOST_CALL constructWithNativeErrorConstructor(ExecState*);
+        static EncodedJSValue JSC_HOST_CALL callNativeErrorConstructor(ExecState*);
+
         void dumpSampleData(ExecState* exec);
         void startSampling();
         void stopSampling();

Modified: trunk/Source/_javascript_Core/runtime/ErrorConstructor.cpp (153822 => 153823)


--- trunk/Source/_javascript_Core/runtime/ErrorConstructor.cpp	2013-08-08 14:49:44 UTC (rev 153822)
+++ trunk/Source/_javascript_Core/runtime/ErrorConstructor.cpp	2013-08-08 16:38:31 UTC (rev 153823)
@@ -48,7 +48,7 @@
 
 // ECMA 15.9.3
 
-static EncodedJSValue JSC_HOST_CALL constructWithErrorConstructor(ExecState* exec)
+EncodedJSValue JSC_HOST_CALL Interpreter::constructWithErrorConstructor(ExecState* exec)
 {
     JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
     Structure* errorStructure = asInternalFunction(exec->callee())->globalObject()->errorStructure();
@@ -60,11 +60,11 @@
 
 ConstructType ErrorConstructor::getConstructData(JSCell*, ConstructData& constructData)
 {
-    constructData.native.function = constructWithErrorConstructor;
+    constructData.native.function = Interpreter::constructWithErrorConstructor;
     return ConstructTypeHost;
 }
 
-static EncodedJSValue JSC_HOST_CALL callErrorConstructor(ExecState* exec)
+EncodedJSValue JSC_HOST_CALL Interpreter::callErrorConstructor(ExecState* exec)
 {
     JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
     Structure* errorStructure = asInternalFunction(exec->callee())->globalObject()->errorStructure();
@@ -76,7 +76,7 @@
 
 CallType ErrorConstructor::getCallData(JSCell*, CallData& callData)
 {
-    callData.native.function = callErrorConstructor;
+    callData.native.function = Interpreter::callErrorConstructor;
     return CallTypeHost;
 }
 

Modified: trunk/Source/_javascript_Core/runtime/NativeErrorConstructor.cpp (153822 => 153823)


--- trunk/Source/_javascript_Core/runtime/NativeErrorConstructor.cpp	2013-08-08 14:49:44 UTC (rev 153822)
+++ trunk/Source/_javascript_Core/runtime/NativeErrorConstructor.cpp	2013-08-08 16:38:31 UTC (rev 153823)
@@ -49,7 +49,7 @@
     visitor.append(&thisObject->m_errorStructure);
 }
 
-static EncodedJSValue JSC_HOST_CALL constructWithNativeErrorConstructor(ExecState* exec)
+EncodedJSValue JSC_HOST_CALL Interpreter::constructWithNativeErrorConstructor(ExecState* exec)
 {
     JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
     Structure* errorStructure = static_cast<NativeErrorConstructor*>(exec->callee())->errorStructure();
@@ -62,11 +62,11 @@
 
 ConstructType NativeErrorConstructor::getConstructData(JSCell*, ConstructData& constructData)
 {
-    constructData.native.function = constructWithNativeErrorConstructor;
+    constructData.native.function = Interpreter::constructWithNativeErrorConstructor;
     return ConstructTypeHost;
 }
     
-static EncodedJSValue JSC_HOST_CALL callNativeErrorConstructor(ExecState* exec)
+EncodedJSValue JSC_HOST_CALL Interpreter::callNativeErrorConstructor(ExecState* exec)
 {
     JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
     Structure* errorStructure = static_cast<NativeErrorConstructor*>(exec->callee())->errorStructure();
@@ -78,7 +78,7 @@
 
 CallType NativeErrorConstructor::getCallData(JSCell*, CallData& callData)
 {
-    callData.native.function = callNativeErrorConstructor;
+    callData.native.function = Interpreter::callNativeErrorConstructor;
     return CallTypeHost;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to