Ignore:
Timestamp:
Sep 4, 2013, 8:09:57 PM (12 years ago)
Author:
[email protected]
Message:

run-fast-jsc should work with new-school fast/js tests that loop until the DFG tiers up
https://bugs.webkit.org/show_bug.cgi?id=120697

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore:

  • API/JSCTestRunnerUtils.cpp:

(JSC::numberOfDFGCompiles):
(JSC::setNeverInline):

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Target.pri:
  • jsc.cpp:

(GlobalObject::finishCreation):
(functionNeverInlineFunction):
(functionNumberOfDFGCompiles):

  • runtime/TestRunnerUtils.cpp: Added.

(JSC::getExecutable):
(JSC::numberOfDFGCompiles):
(JSC::setNeverInline):

  • runtime/TestRunnerUtils.h: Added.

LayoutTests:

  • fast/js/resources/standalone-pre.js:

(testPassed):
(testFailed):
(dfgCompiled):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp

    r153286 r155090  
    2828
    2929#include "APICast.h"
    30 #include "CodeBlock.h"
    3130#include "Operations.h"
     31#include "TestRunnerUtils.h"
    3232
    3333namespace JSC {
    3434
    35 static FunctionExecutable* getExecutable(JSContextRef context, JSValueRef theFunctionValueRef)
    36 {
    37     ExecState* exec = toJS(context);
    38     JSValue theFunctionValue = toJS(exec, theFunctionValueRef);
    39    
    40     JSFunction* theFunction = jsDynamicCast<JSFunction*>(theFunctionValue);
    41     if (!theFunction)
    42         return 0;
    43    
    44     FunctionExecutable* executable = jsDynamicCast<FunctionExecutable*>(
    45         theFunction->executable());
    46     return executable;
    47 }
    48 
    4935JSValueRef numberOfDFGCompiles(JSContextRef context, JSValueRef theFunctionValueRef)
    5036{
    51     bool pretendToHaveManyCompiles = false;
    52 #if ENABLE(DFG_JIT)
    53     if (!Options::useJIT() || !Options::useDFGJIT())
    54         pretendToHaveManyCompiles = true;
    55 #else
    56     pretendToHaveManyCompiles = true;
    57 #endif
    58    
    59     if (FunctionExecutable* executable = getExecutable(context, theFunctionValueRef)) {
    60         CodeBlock* baselineCodeBlock = executable->baselineCodeBlockFor(CodeForCall);
    61        
    62         if (!baselineCodeBlock)
    63             return JSValueMakeNumber(context, 0);
    64 
    65         if (pretendToHaveManyCompiles)
    66             return JSValueMakeNumber(context, 1000000.0);
    67         return JSValueMakeNumber(context, baselineCodeBlock->numberOfDFGCompiles());
    68     }
    69    
    70     return JSValueMakeUndefined(context);
     37    ExecState* exec= toJS(context);
     38    return toRef(exec, numberOfDFGCompiles(toJS(exec, theFunctionValueRef)));
    7139}
    7240
    7341JSValueRef setNeverInline(JSContextRef context, JSValueRef theFunctionValueRef)
    7442{
    75     if (FunctionExecutable* executable = getExecutable(context, theFunctionValueRef))
    76         executable->setNeverInline(true);
    77    
    78     return JSValueMakeUndefined(context);
     43    ExecState* exec= toJS(context);
     44    return toRef(exec, setNeverInline(toJS(exec, theFunctionValueRef)));
    7945}
    8046
Note: See TracChangeset for help on using the changeset viewer.