Changeset 153177 in webkit for trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
- Timestamp:
- Jul 24, 2013, 9:00:54 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r153170 r153177 118 118 void CodeBlock::dump(PrintStream& out) const 119 119 { 120 dumpAssumingJITType(out, getJITType());120 dumpAssumingJITType(out, jitType()); 121 121 } 122 122 … … 2053 2053 { 2054 2054 #if ENABLE(PARALLEL_GC) && ENABLE(DFG_JIT) 2055 if (JITCode::isOptimizingJIT( getJITType())) {2055 if (JITCode::isOptimizingJIT(jitType())) { 2056 2056 DFG::CommonData* dfgCommon = m_jitCode->dfgCommon(); 2057 2057 … … 2302 2302 #if ENABLE(JIT) 2303 2303 // Handle inline caches. 2304 if (!! getJITCode()) {2304 if (!!jitCode()) { 2305 2305 RepatchBuffer repatchBuffer(this); 2306 2306 for (unsigned i = 0; i < numberOfCallLinkInfos(); ++i) { … … 2362 2362 dataLog("Clearing structure cache (kind ", static_cast<int>(stubInfo.accessType), ") in ", *this, ".\n"); 2363 2363 2364 switch ( getJITType()) {2364 switch (jitType()) { 2365 2365 case JITCode::BaselineJIT: 2366 2366 if (isGetByIdAccess(accessType)) … … 2413 2413 2414 2414 #if ENABLE(DFG_JIT) 2415 if (!JITCode::isOptimizingJIT( getJITType()))2415 if (!JITCode::isOptimizingJIT(jitType())) 2416 2416 return; 2417 2417 … … 2436 2436 // to get its replacement. But we'll know that it's the original baseline code 2437 2437 // block because it won't have JIT code yet and it won't have an alternative. 2438 if ( getJITType() == JITCode::None && !alternative())2438 if (jitType() == JITCode::None && !alternative()) 2439 2439 return this; 2440 2440 … … 2444 2444 result = result->alternative(); 2445 2445 ASSERT(result); 2446 ASSERT(JITCode::isBaselineCode(result-> getJITType()));2446 ASSERT(JITCode::isBaselineCode(result->jitType())); 2447 2447 return result; 2448 2448 #else … … 2454 2454 bool CodeBlock::hasOptimizedReplacement() 2455 2455 { 2456 ASSERT(JITCode::isBaselineCode( getJITType()));2457 bool result = JITCode::isHigherTier(replacement()-> getJITType(), getJITType());2456 ASSERT(JITCode::isBaselineCode(jitType())); 2457 bool result = JITCode::isHigherTier(replacement()->jitType(), jitType()); 2458 2458 if (result) 2459 ASSERT(JITCode::isOptimizingJIT(replacement()-> getJITType()));2459 ASSERT(JITCode::isOptimizingJIT(replacement()->jitType())); 2460 2460 else { 2461 ASSERT(JITCode::isBaselineCode(replacement()-> getJITType()));2461 ASSERT(JITCode::isBaselineCode(replacement()->jitType())); 2462 2462 ASSERT(replacement() == this); 2463 2463 } … … 2709 2709 RELEASE_ASSERT(exec->codeBlock()); 2710 2710 RELEASE_ASSERT(exec->codeBlock() == this); 2711 RELEASE_ASSERT(JITCode::isBaselineCode( getJITType()));2711 RELEASE_ASSERT(JITCode::isBaselineCode(jitType())); 2712 2712 Instruction* instruction = exec->currentVPC(); 2713 2713 RELEASE_ASSERT(instruction); … … 2725 2725 return 1; 2726 2726 2727 if ( getJITCode()->contains(returnAddress.value())) {2728 unsigned callReturnOffset = getJITCode()->offsetOf(returnAddress.value());2727 if (jitCode()->contains(returnAddress.value())) { 2728 unsigned callReturnOffset = jitCode()->offsetOf(returnAddress.value()); 2729 2729 CallReturnOffsetToBytecodeOffset* result = 2730 2730 binarySearch<CallReturnOffsetToBytecodeOffset, unsigned>( … … 2759 2759 return false; 2760 2760 2761 if (! getJITCode()->contains(returnAddress.value())) {2761 if (!jitCode()->contains(returnAddress.value())) { 2762 2762 ClosureCallStubRoutine* stub = findClosureCallForReturnPC(returnAddress); 2763 2763 ASSERT(stub); … … 2768 2768 } 2769 2769 2770 unsigned offset = getJITCode()->offsetOf(returnAddress.value());2770 unsigned offset = jitCode()->offsetOf(returnAddress.value()); 2771 2771 CodeOriginAtCallReturnOffset* entry = 2772 2772 tryBinarySearch<CodeOriginAtCallReturnOffset, unsigned>( … … 2842 2842 JSObject* ProgramCodeBlock::compileOptimized(ExecState* exec, JSScope* scope, CompilationResult& result, unsigned bytecodeIndex) 2843 2843 { 2844 if (JITCode::isHigherTier(replacement()-> getJITType(), getJITType())) {2844 if (JITCode::isHigherTier(replacement()->jitType(), jitType())) { 2845 2845 result = CompilationNotNeeded; 2846 2846 return 0; … … 2857 2857 JSObject* EvalCodeBlock::compileOptimized(ExecState* exec, JSScope* scope, CompilationResult& result, unsigned bytecodeIndex) 2858 2858 { 2859 if (JITCode::isHigherTier(replacement()-> getJITType(), getJITType())) {2859 if (JITCode::isHigherTier(replacement()->jitType(), jitType())) { 2860 2860 result = CompilationNotNeeded; 2861 2861 return 0; … … 2872 2872 JSObject* FunctionCodeBlock::compileOptimized(ExecState* exec, JSScope* scope, CompilationResult& result, unsigned bytecodeIndex) 2873 2873 { 2874 if (JITCode::isHigherTier(replacement()-> getJITType(), getJITType())) {2874 if (JITCode::isHigherTier(replacement()->jitType(), jitType())) { 2875 2875 result = CompilationNotNeeded; 2876 2876 return 0; … … 2904 2904 void CodeBlock::jettison() 2905 2905 { 2906 ASSERT(JITCode::isOptimizingJIT( getJITType()));2906 ASSERT(JITCode::isOptimizingJIT(jitType())); 2907 2907 ASSERT(this == replacement()); 2908 2908 alternative()->optimizeAfterWarmUp(); … … 2920 2920 void EvalCodeBlock::jettisonImpl() 2921 2921 { 2922 ASSERT(JITCode::isOptimizingJIT(jitType())); 2923 ASSERT(this == replacement()); 2924 if (DFG::shouldShowDisassembly()) 2925 dataLog("Jettisoning ", *this, ".\n"); 2922 2926 static_cast<EvalExecutable*>(ownerExecutable())->jettisonOptimizedCode(*vm()); 2923 2927 } … … 2925 2929 void FunctionCodeBlock::jettisonImpl() 2926 2930 { 2931 ASSERT(JITCode::isOptimizingJIT(jitType())); 2932 ASSERT(this == replacement()); 2933 if (DFG::shouldShowDisassembly()) 2934 dataLog("Jettisoning ", *this, ".\n"); 2927 2935 static_cast<FunctionExecutable*>(ownerExecutable())->jettisonOptimizedCodeFor(*vm(), m_isConstructor ? CodeForConstruct : CodeForCall); 2928 2936 } … … 2930 2938 CompilationResult ProgramCodeBlock::jitCompileImpl(ExecState* exec) 2931 2939 { 2932 ASSERT( getJITType() == JITCode::InterpreterThunk);2940 ASSERT(jitType() == JITCode::InterpreterThunk); 2933 2941 ASSERT(this == replacement()); 2934 2942 return static_cast<ProgramExecutable*>(ownerExecutable())->jitCompile(exec); … … 2937 2945 CompilationResult EvalCodeBlock::jitCompileImpl(ExecState* exec) 2938 2946 { 2939 ASSERT( getJITType() == JITCode::InterpreterThunk);2947 ASSERT(jitType() == JITCode::InterpreterThunk); 2940 2948 ASSERT(this == replacement()); 2941 2949 return static_cast<EvalExecutable*>(ownerExecutable())->jitCompile(exec); … … 2944 2952 CompilationResult FunctionCodeBlock::jitCompileImpl(ExecState* exec) 2945 2953 { 2946 ASSERT( getJITType() == JITCode::InterpreterThunk);2954 ASSERT(jitType() == JITCode::InterpreterThunk); 2947 2955 ASSERT(this == replacement()); 2948 2956 return static_cast<FunctionExecutable*>(ownerExecutable())->jitCompileFor(exec, m_isConstructor ? CodeForConstruct : CodeForCall); … … 3148 3156 void CodeBlock::setOptimizationThresholdBasedOnCompilationResult(CompilationResult result) 3149 3157 { 3150 RELEASE_ASSERT( getJITType() == JITCode::BaselineJIT);3158 RELEASE_ASSERT(jitType() == JITCode::BaselineJIT); 3151 3159 RELEASE_ASSERT((result == CompilationSuccessful) == (replacement() != this)); 3152 3160 switch (result) { 3153 3161 case CompilationSuccessful: 3154 RELEASE_ASSERT(JITCode::isOptimizingJIT(replacement()-> getJITType()));3162 RELEASE_ASSERT(JITCode::isOptimizingJIT(replacement()->jitType())); 3155 3163 optimizeNextInvocation(); 3156 3164 break; … … 3180 3188 uint32_t CodeBlock::adjustedExitCountThreshold(uint32_t desiredThreshold) 3181 3189 { 3182 ASSERT(JITCode::isOptimizingJIT( getJITType()));3190 ASSERT(JITCode::isOptimizingJIT(jitType())); 3183 3191 // Compute this the lame way so we don't saturate. This is called infrequently 3184 3192 // enough that this loop won't hurt us. … … 3325 3333 void CodeBlock::tallyFrequentExitSites() 3326 3334 { 3327 ASSERT(JITCode::isOptimizingJIT( getJITType()));3328 ASSERT(alternative()-> getJITType() == JITCode::BaselineJIT);3335 ASSERT(JITCode::isOptimizingJIT(jitType())); 3336 ASSERT(alternative()->jitType() == JITCode::BaselineJIT); 3329 3337 3330 3338 CodeBlock* profiledBlock = alternative(); 3331 3339 3332 switch ( getJITType()) {3340 switch (jitType()) { 3333 3341 case JITCode::DFGJIT: { 3334 3342 DFG::JITCode* jitCode = m_jitCode->dfg();
Note:
See TracChangeset
for help on using the changeset viewer.