Changeset 154833 in webkit for trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
- Timestamp:
- Aug 29, 2013, 12:28:55 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r154824 r154833 47 47 #include "JSFunction.h" 48 48 #include "JSNameScope.h" 49 #include "LLIntEntrypoints.h"50 49 #include "LowLevelInterpreter.h" 51 50 #include "Operations.h" … … 2694 2693 } 2695 2694 2696 CompilationResult CodeBlock::prepareForExecutionImpl(2697 ExecState* exec, JITCode::JITType jitType, JITCompilationEffort effort,2698 unsigned bytecodeIndex, PassRefPtr<DeferredCompilationCallback> callback)2699 {2700 VM& vm = exec->vm();2701 2702 if (jitType == JITCode::InterpreterThunk) {2703 #if ENABLE(LLINT)2704 switch (codeType()) {2705 case GlobalCode:2706 LLInt::setProgramEntrypoint(vm, static_cast<ProgramCodeBlock*>(this));2707 break;2708 case EvalCode:2709 LLInt::setEvalEntrypoint(vm, static_cast<EvalCodeBlock*>(this));2710 break;2711 case FunctionCode:2712 LLInt::setFunctionEntrypoint(vm, static_cast<FunctionCodeBlock*>(this));2713 break;2714 }2715 return CompilationSuccessful;2716 #else // ENABLE(LLINT)2717 return CompilationFailed;2718 #endif // ENABLE(LLINT)2719 }2720 2721 #if ENABLE(JIT)2722 if (JITCode::isOptimizingJIT(jitType)) {2723 ASSERT(effort == JITCompilationCanFail);2724 bool hadCallback = !!callback;2725 CompilationResult result = DFG::tryCompile(exec, this, bytecodeIndex, callback);2726 ASSERT_UNUSED(hadCallback, result != CompilationDeferred || hadCallback);2727 return result;2728 }2729 2730 MacroAssemblerCodePtr jitCodeWithArityCheck;2731 RefPtr<JITCode> jitCode = JIT::compile(&vm, this, effort, &jitCodeWithArityCheck);2732 if (!jitCode)2733 return CompilationFailed;2734 setJITCode(jitCode, jitCodeWithArityCheck);2735 return CompilationSuccessful;2736 #else2737 UNUSED_PARAM(effort);2738 UNUSED_PARAM(bytecodeIndex);2739 UNUSED_PARAM(callback);2740 return CompilationFailed;2741 #endif // ENABLE(JIT)2742 }2743 2744 CompilationResult CodeBlock::prepareForExecution(2745 ExecState* exec, JITCode::JITType jitType,2746 JITCompilationEffort effort, unsigned bytecodeIndex)2747 {2748 CompilationResult result =2749 prepareForExecutionImpl(exec, jitType, effort, bytecodeIndex, 0);2750 ASSERT(result != CompilationDeferred);2751 return result;2752 }2753 2754 CompilationResult CodeBlock::prepareForExecutionAsynchronously(2755 ExecState* exec, JITCode::JITType jitType,2756 PassRefPtr<DeferredCompilationCallback> passedCallback,2757 JITCompilationEffort effort, unsigned bytecodeIndex)2758 {2759 RefPtr<DeferredCompilationCallback> callback = passedCallback;2760 CompilationResult result =2761 prepareForExecutionImpl(exec, jitType, effort, bytecodeIndex, callback);2762 if (result != CompilationDeferred)2763 callback->compilationDidComplete(this, result);2764 return result;2765 }2766 2767 2695 void CodeBlock::install() 2768 2696 {
Note:
See TracChangeset
for help on using the changeset viewer.