Changeset 153823 in webkit


Ignore:
Timestamp:
Aug 8, 2013, 9:38:31 AM (12 years ago)
Author:
mark.lam@apple.com
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.
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r153819 r153823  
     12013-08-08  Mark Lam  <mark.lam@apple.com>
     2
     3        Moved ErrorConstructor and NativeErrorConstructor helper functions into
     4        the Interpreter class.
     5        https://bugs.webkit.org/show_bug.cgi?id=119576.
     6
     7        Reviewed by Oliver Hunt.
     8
     9        This change is needed to prepare for making Interpreter::getStackTrace()
     10        private. It does not change the behavior of the code, only the lexical
     11        scoping.
     12
     13        * interpreter/Interpreter.h:
     14        - Added helper functions for ErrorConstructor and NativeErrorConstructor.
     15        * runtime/ErrorConstructor.cpp:
     16        (JSC::Interpreter::constructWithErrorConstructor):
     17        (JSC::ErrorConstructor::getConstructData):
     18        (JSC::Interpreter::callErrorConstructor):
     19        (JSC::ErrorConstructor::getCallData):
     20        - Don't want ErrorConstructor to call Interpreter::getStackTrace()
     21          directly. So, we moved the helper functions into the Interpreter
     22          class.
     23        * runtime/NativeErrorConstructor.cpp:
     24        (JSC::Interpreter::constructWithNativeErrorConstructor):
     25        (JSC::NativeErrorConstructor::getConstructData):
     26        (JSC::Interpreter::callNativeErrorConstructor):
     27        (JSC::NativeErrorConstructor::getCallData):
     28        - Don't want NativeErrorConstructor to call Interpreter::getStackTrace()
     29          directly. So, we moved the helper functions into the Interpreter
     30          class.
     31
    1322013-08-07  Mark Hahnenberg  <mhahnenberg@apple.com>
    233
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.h

    r153457 r153823  
    223223        JSString* stackTraceAsString(ExecState*, Vector<StackFrame>);
    224224
     225        static EncodedJSValue JSC_HOST_CALL constructWithErrorConstructor(ExecState*);
     226        static EncodedJSValue JSC_HOST_CALL callErrorConstructor(ExecState*);
     227        static EncodedJSValue JSC_HOST_CALL constructWithNativeErrorConstructor(ExecState*);
     228        static EncodedJSValue JSC_HOST_CALL callNativeErrorConstructor(ExecState*);
     229
    225230        void dumpSampleData(ExecState* exec);
    226231        void startSampling();
  • trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp

    r153457 r153823  
    4949// ECMA 15.9.3
    5050
    51 static EncodedJSValue JSC_HOST_CALL constructWithErrorConstructor(ExecState* exec)
     51EncodedJSValue JSC_HOST_CALL Interpreter::constructWithErrorConstructor(ExecState* exec)
    5252{
    5353    JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
     
    6161ConstructType ErrorConstructor::getConstructData(JSCell*, ConstructData& constructData)
    6262{
    63     constructData.native.function = constructWithErrorConstructor;
     63    constructData.native.function = Interpreter::constructWithErrorConstructor;
    6464    return ConstructTypeHost;
    6565}
    6666
    67 static EncodedJSValue JSC_HOST_CALL callErrorConstructor(ExecState* exec)
     67EncodedJSValue JSC_HOST_CALL Interpreter::callErrorConstructor(ExecState* exec)
    6868{
    6969    JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
     
    7777CallType ErrorConstructor::getCallData(JSCell*, CallData& callData)
    7878{
    79     callData.native.function = callErrorConstructor;
     79    callData.native.function = Interpreter::callErrorConstructor;
    8080    return CallTypeHost;
    8181}
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp

    r153457 r153823  
    5050}
    5151
    52 static EncodedJSValue JSC_HOST_CALL constructWithNativeErrorConstructor(ExecState* exec)
     52EncodedJSValue JSC_HOST_CALL Interpreter::constructWithNativeErrorConstructor(ExecState* exec)
    5353{
    5454    JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
     
    6363ConstructType NativeErrorConstructor::getConstructData(JSCell*, ConstructData& constructData)
    6464{
    65     constructData.native.function = constructWithNativeErrorConstructor;
     65    constructData.native.function = Interpreter::constructWithNativeErrorConstructor;
    6666    return ConstructTypeHost;
    6767}
    6868   
    69 static EncodedJSValue JSC_HOST_CALL callNativeErrorConstructor(ExecState* exec)
     69EncodedJSValue JSC_HOST_CALL Interpreter::callNativeErrorConstructor(ExecState* exec)
    7070{
    7171    JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
     
    7979CallType NativeErrorConstructor::getCallData(JSCell*, CallData& callData)
    8080{
    81     callData.native.function = callNativeErrorConstructor;
     81    callData.native.function = Interpreter::callNativeErrorConstructor;
    8282    return CallTypeHost;
    8383}
Note: See TracChangeset for help on using the changeset viewer.