Changeset 160821 in webkit
- Timestamp:
- Dec 18, 2013, 7:48:08 PM (11 years ago)
- Location:
- branches/jsCStack/Source/JavaScriptCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/jsCStack/Source/JavaScriptCore/ChangeLog
r160815 r160821 1 2013-12-18 Mark Lam <mark.lam@apple.com> 2 3 CStack: Fix baseline to DFG JIT OSR. 4 https://bugs.webkit.org/show_bug.cgi?id=125969. 5 6 Reviewed by Filip Pizlo. 7 8 1. Change operationOptimize() to return a tuple of OSR target address 9 and new topOfFrame value (as opposed to just the OSR target address). 10 2. Change emitEnterOptimizationCheck() and emitSlow_op_loop_hint() to 11 emit code to set the stackPointer with the returned topOfFrame value 12 if we take the OSR path. 13 14 * jit/JIT.cpp: 15 (JSC::JIT::emitEnterOptimizationCheck): 16 * jit/JIT.h: 17 * jit/JITInlines.h: 18 (JSC::JIT::callOperation): 19 * jit/JITOpcodes.cpp: 20 (JSC::JIT::emitSlow_op_loop_hint): 21 * jit/JITOperations.cpp: 22 * jit/JITOperations.h: 23 * runtime/Options.h: 24 1 25 2013-12-18 Michael Saboff <msaboff@apple.com> 2 26 -
branches/jsCStack/Source/JavaScriptCore/jit/JIT.cpp
r160746 r160821 103 103 callOperation(operationOptimize, m_bytecodeOffset); 104 104 skipOptimize.append(branchTestPtr(Zero, returnValueGPR)); 105 move(returnValueGPR2, stackPointerRegister); 105 106 jump(returnValueGPR); 106 107 skipOptimize.link(this); -
branches/jsCStack/Source/JavaScriptCore/jit/JIT.h
r160745 r160821 691 691 MacroAssembler::Call callOperation(J_JITOperation_EZ, int, int32_t); 692 692 MacroAssembler::Call callOperation(P_JITOperation_EJS, GPRReg, size_t); 693 MacroAssembler::Call callOperation(P_JITOperation_EZ, int32_t);694 693 MacroAssembler::Call callOperation(S_JITOperation_ECC, RegisterID, RegisterID); 695 694 MacroAssembler::Call callOperation(S_JITOperation_EJ, RegisterID); 696 695 MacroAssembler::Call callOperation(S_JITOperation_EJJ, RegisterID, RegisterID); 697 696 MacroAssembler::Call callOperation(S_JITOperation_EOJss, RegisterID, RegisterID); 697 MacroAssembler::Call callOperation(Sprt_JITOperation_EZ, int32_t); 698 698 MacroAssembler::Call callOperation(V_JITOperation_E); 699 699 MacroAssembler::Call callOperation(V_JITOperation_EC, RegisterID); -
branches/jsCStack/Source/JavaScriptCore/jit/JITInlines.h
r160253 r160821 218 218 } 219 219 220 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(P_JITOperation_EZ operation, int32_t op) 220 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(S_JITOperation_ECC operation, RegisterID regOp1, RegisterID regOp2) 221 { 222 setupArgumentsWithExecState(regOp1, regOp2); 223 return appendCallWithExceptionCheck(operation); 224 } 225 226 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(S_JITOperation_EOJss operation, RegisterID regOp1, RegisterID regOp2) 227 { 228 setupArgumentsWithExecState(regOp1, regOp2); 229 return appendCallWithExceptionCheck(operation); 230 } 231 232 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(Sprt_JITOperation_EZ operation, int32_t op) 221 233 { 222 234 setupArgumentsWithExecState(TrustedImm32(op)); 223 return appendCallWithExceptionCheck(operation);224 }225 226 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(S_JITOperation_ECC operation, RegisterID regOp1, RegisterID regOp2)227 {228 setupArgumentsWithExecState(regOp1, regOp2);229 return appendCallWithExceptionCheck(operation);230 }231 232 ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(S_JITOperation_EOJss operation, RegisterID regOp1, RegisterID regOp2)233 {234 setupArgumentsWithExecState(regOp1, regOp2);235 235 return appendCallWithExceptionCheck(operation); 236 236 } -
branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes.cpp
r160745 r160821 1117 1117 callOperation(operationOptimize, m_bytecodeOffset); 1118 1118 Jump noOptimizedEntry = branchTestPtr(Zero, returnValueGPR); 1119 move(returnValueGPR2, stackPointerRegister); 1119 1120 jump(returnValueGPR); 1120 1121 noOptimizedEntry.link(this); -
branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.cpp
r160784 r160821 31 31 #include "ArrayConstructor.h" 32 32 #include "CallFrameInlines.h" 33 #include "CommonSlowPaths.h"34 33 #include "DFGCompilationMode.h" 35 34 #include "DFGDriver.h" … … 975 974 976 975 #if ENABLE(DFG_JIT) 977 char*JIT_OPERATION operationOptimize(ExecState* exec, int32_t bytecodeIndex)976 SlowPathReturnType JIT_OPERATION operationOptimize(ExecState* exec, int32_t bytecodeIndex) 978 977 { 979 978 VM& vm = exec->vm(); … … 1025 1024 if (Options::verboseOSR()) 1026 1025 dataLog("Choosing not to optimize ", *codeBlock, " yet, because the threshold hasn't been reached.\n"); 1027 return 0;1026 return encodeResult(0, 0); 1028 1027 } 1029 1028 … … 1033 1032 if (Options::verboseOSR()) 1034 1033 dataLog("Choosing not to optimize ", *codeBlock, " yet, because m_shouldAlwaysBeInlined == true.\n"); 1035 return 0;1034 return encodeResult(0, 0); 1036 1035 } 1037 1036 … … 1073 1072 RELEASE_ASSERT(!codeBlock->hasOptimizedReplacement()); 1074 1073 codeBlock->setOptimizationThresholdBasedOnCompilationResult(CompilationDeferred); 1075 return 0;1074 return encodeResult(0, 0); 1076 1075 } 1077 1076 … … 1086 1085 if (Options::verboseOSR()) 1087 1086 dataLog("Code block ", *codeBlock, " was compiled but it doesn't have an optimized replacement.\n"); 1088 return 0;1087 return encodeResult(0, 0); 1089 1088 } 1090 1089 } else if (codeBlock->hasOptimizedReplacement()) { … … 1111 1110 } 1112 1111 codeBlock->replacement()->jettison(CountReoptimization); 1113 return 0;1112 return encodeResult(0, 0); 1114 1113 } 1115 1114 } else { … … 1120 1119 " because of insufficient profiling.\n"); 1121 1120 } 1122 return 0;1121 return encodeResult(0, 0); 1123 1122 } 1124 1123 … … 1153 1152 1154 1153 if (result != CompilationSuccessful) 1155 return 0;1154 return encodeResult(0, 0); 1156 1155 } 1157 1156 … … 1167 1166 1168 1167 codeBlock->optimizeSoon(); 1169 return static_cast<char*>(address); 1168 ASSERT(exec->codeBlock() == optimizedCodeBlock); 1169 return encodeResult(address, exec->topOfFrame()); 1170 1170 } 1171 1171 … … 1196 1196 } 1197 1197 optimizedCodeBlock->jettison(CountReoptimization); 1198 return 0;1198 return encodeResult(0, 0); 1199 1199 } 1200 1200 … … 1203 1203 codeBlock->optimizeAfterWarmUp(); 1204 1204 1205 return 0;1205 return encodeResult(0, 0); 1206 1206 } 1207 1207 #endif -
branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.h
r160253 r160821 30 30 31 31 #include "CallFrame.h" 32 #include "CommonSlowPaths.h" 32 33 #include "JITExceptions.h" 33 34 #include "JSArray.h" … … 73 74 R: Register 74 75 S: size_t 76 Sprt: SlowPathReturnType 75 77 Ssi: StructureStubInfo* 76 78 St: Structure* … … 134 136 typedef size_t JIT_OPERATION (*S_JITOperation_EOJss)(ExecState*, JSObject*, JSString*); 135 137 typedef size_t JIT_OPERATION (*S_JITOperation_J)(EncodedJSValue); 138 typedef SlowPathReturnType JIT_OPERATION (*Sprt_JITOperation_EZ)(ExecState*, int32_t); 136 139 typedef void JIT_OPERATION (*V_JITOperation_E)(ExecState*); 137 140 typedef void JIT_OPERATION (*V_JITOperation_EC)(ExecState*, JSCell*); … … 174 177 typedef char* JIT_OPERATION (*P_JITOperation_EStSS)(ExecState*, Structure*, size_t, size_t); 175 178 typedef char* JIT_OPERATION (*P_JITOperation_EStZ)(ExecState*, Structure*, int32_t); 176 typedef char* JIT_OPERATION (*P_JITOperation_EZ)(ExecState*, int32_t);177 179 typedef char* JIT_OPERATION (*P_JITOperation_EZZ)(ExecState*, int32_t, int32_t); 178 180 typedef StringImpl* JIT_OPERATION (*I_JITOperation_EJss)(ExecState*, JSString*); … … 242 244 void JIT_OPERATION operationDebug(ExecState*, int32_t) WTF_INTERNAL; 243 245 #if ENABLE(DFG_JIT) 244 char*JIT_OPERATION operationOptimize(ExecState*, int32_t) WTF_INTERNAL;246 SlowPathReturnType JIT_OPERATION operationOptimize(ExecState*, int32_t) WTF_INTERNAL; 245 247 #endif 246 248 void JIT_OPERATION operationPutByIndex(ExecState*, EncodedJSValue, int32_t, EncodedJSValue); -
branches/jsCStack/Source/JavaScriptCore/runtime/Options.h
r160600 r160821 121 121 v(bool, verboseCFA, false) \ 122 122 \ 123 v(bool, enableOSREntryToDFG, false) \123 v(bool, enableOSREntryToDFG, true) \ 124 124 \ 125 125 v(bool, useExperimentalFTL, false) \
Note:
See TracChangeset
for help on using the changeset viewer.