Changeset 153147 in webkit for trunk/Source/JavaScriptCore/jit/JITDriver.h
- Timestamp:
- Jul 24, 2013, 8:59:47 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITDriver.h
r153115 r153147 1 1 /* 2 * Copyright (C) 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 39 39 40 40 template<typename CodeBlockType> 41 inline bool jitCompileIfAppropriate(ExecState* exec, OwnPtr<CodeBlockType>&codeBlock, RefPtr<JITCode>& jitCode, JITCode::JITType jitType, unsigned bytecodeIndex, JITCompilationEffort effort)41 inline bool jitCompileIfAppropriate(ExecState* exec, CodeBlockType* codeBlock, RefPtr<JITCode>& jitCode, JITCode::JITType jitType, unsigned bytecodeIndex, JITCompilationEffort effort) 42 42 { 43 43 VM& vm = exec->vm(); … … 53 53 RefPtr<JITCode> oldJITCode = jitCode; 54 54 55 bool dfgCompiled = false; 56 if (JITCode::isOptimizingJIT(jitType)) 57 dfgCompiled = DFG::tryCompile(exec, codeBlock.get(), jitCode, bytecodeIndex); 58 if (dfgCompiled) { 59 if (codeBlock->alternative()) 55 if (JITCode::isOptimizingJIT(jitType)) { 56 if (DFG::tryCompile(exec, codeBlock, jitCode, bytecodeIndex)) 60 57 codeBlock->alternative()->unlinkIncomingCalls(); 61 } else { 62 if (codeBlock->alternative()) { 63 codeBlock = static_pointer_cast<CodeBlockType>(codeBlock->releaseAlternative()); 64 jitCode = oldJITCode; 58 else { 59 ASSERT(oldJITCode == jitCode); 65 60 return false; 66 61 } 67 jitCode = JIT::compile(&vm, codeBlock.get(), effort); 68 if (!jitCode) { 69 jitCode = oldJITCode; 62 } else { 63 RefPtr<JITCode> result = JIT::compile(&vm, codeBlock, effort); 64 if (result) 65 jitCode = result; 66 else 70 67 return false; 71 }72 68 } 69 73 70 codeBlock->setJITCode(jitCode, MacroAssemblerCodePtr()); 74 71 … … 76 73 } 77 74 78 inline bool jitCompileFunctionIfAppropriate(ExecState* exec, OwnPtr<FunctionCodeBlock>&codeBlock, RefPtr<JITCode>& jitCode, MacroAssemblerCodePtr& jitCodeWithArityCheck, JITCode::JITType jitType, unsigned bytecodeIndex, JITCompilationEffort effort)75 inline bool jitCompileFunctionIfAppropriate(ExecState* exec, FunctionCodeBlock* codeBlock, RefPtr<JITCode>& jitCode, MacroAssemblerCodePtr& jitCodeWithArityCheck, JITCode::JITType jitType, unsigned bytecodeIndex, JITCompilationEffort effort) 79 76 { 80 77 VM& vm = exec->vm(); … … 91 88 MacroAssemblerCodePtr oldJITCodeWithArityCheck = jitCodeWithArityCheck; 92 89 93 bool dfgCompiled = false; 94 if (JITCode::isOptimizingJIT(jitType)) 95 dfgCompiled = DFG::tryCompileFunction(exec, codeBlock.get(), jitCode, jitCodeWithArityCheck, bytecodeIndex); 96 if (dfgCompiled) { 97 if (codeBlock->alternative()) 90 if (JITCode::isOptimizingJIT(jitType)) { 91 if (DFG::tryCompileFunction(exec, codeBlock, jitCode, jitCodeWithArityCheck, bytecodeIndex)) 98 92 codeBlock->alternative()->unlinkIncomingCalls(); 99 } else { 100 if (codeBlock->alternative()) { 101 codeBlock = static_pointer_cast<FunctionCodeBlock>(codeBlock->releaseAlternative()); 102 jitCode = oldJITCode; 103 jitCodeWithArityCheck = oldJITCodeWithArityCheck; 93 else { 94 ASSERT(oldJITCode == jitCode); 95 ASSERT_UNUSED(oldJITCodeWithArityCheck, oldJITCodeWithArityCheck == jitCodeWithArityCheck); 104 96 return false; 105 97 } 106 jitCode = JIT::compile(&vm, codeBlock.get(), effort, &jitCodeWithArityCheck); 107 if (!jitCode) { 108 jitCode = oldJITCode; 109 jitCodeWithArityCheck = oldJITCodeWithArityCheck; 98 } else { 99 RefPtr<JITCode> result = 100 JIT::compile(&vm, codeBlock, effort, &jitCodeWithArityCheck); 101 if (result) 102 jitCode = result; 103 else { 104 ASSERT_UNUSED(oldJITCodeWithArityCheck, oldJITCodeWithArityCheck == jitCodeWithArityCheck); 110 105 return false; 111 106 } 112 107 } 108 113 109 codeBlock->setJITCode(jitCode, jitCodeWithArityCheck); 114 110
Note:
See TracChangeset
for help on using the changeset viewer.