Changeset 118270 in webkit for trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h
- Timestamp:
- May 23, 2012, 5:05:21 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h
r118240 r118270 1 1 /* 2 * Copyright (C) 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 29 29 #include "Intrinsic.h" 30 #include "DFGCommon.h" 30 31 #include "DFGNode.h" 31 32 #include "Executable.h" … … 68 69 69 70 // Opcode checking. 70 inline bool canCompileOpcode(OpcodeID opcodeID)71 inline CapabilityLevel canCompileOpcode(OpcodeID opcodeID, CodeBlock*, Instruction*) 71 72 { 72 73 switch (opcodeID) { … … 170 171 case op_get_argument_by_val: 171 172 case op_get_arguments_length: 172 return true; 173 173 case op_jneq_ptr: 174 return CanCompile; 175 176 case op_call_varargs: 177 return ShouldProfile; 178 174 179 default: 175 return false;180 return CannotCompile; 176 181 } 177 182 } 178 183 179 inline bool canInlineOpcode(OpcodeID opcodeID )184 inline bool canInlineOpcode(OpcodeID opcodeID, CodeBlock* codeBlock, Instruction* pc) 180 185 { 181 186 switch (opcodeID) { … … 195 200 // Inlining doesn't correctly remap regular expression operands. 196 201 case op_new_regexp: 197 return false;198 202 199 203 // We don't support inlining code that creates activations or has nested functions. … … 204 208 return false; 205 209 210 // Inlining supports op_call_varargs if it's a call that just forwards the caller's 211 // arguments. 212 case op_call_varargs: 213 return pc[3].u.operand == codeBlock->argumentsRegister(); 214 206 215 default: 207 return canCompileOpcode(opcodeID );216 return canCompileOpcode(opcodeID, codeBlock, pc) == CanCompile; 208 217 } 209 218 } 210 219 211 bool canCompileOpcodes(CodeBlock*);220 CapabilityLevel canCompileOpcodes(CodeBlock*); 212 221 bool canInlineOpcodes(CodeBlock*); 213 222 #else // ENABLE(DFG_JIT) … … 219 228 inline bool mightInlineFunctionForConstruct(CodeBlock*) { return false; } 220 229 221 inline bool canCompileOpcode(OpcodeID) { return false; }222 inline bool canInlineOpcode(OpcodeID ) { return false; }223 inline bool canCompileOpcodes(CodeBlock*) { return false; }230 inline CapabilityLevel canCompileOpcode(OpcodeID, CodeBlock*, Instruction*) { return false; } 231 inline bool canInlineOpcode(OpcodeID, CodeBlock*, Instruction*) { return false; } 232 inline CapabilityLevel canCompileOpcodes(CodeBlock*) { return false; } 224 233 inline bool canInlineOpcodes(CodeBlock*) { return false; } 225 234 #endif // ENABLE(DFG_JIT) 226 235 227 inline bool canCompileEval(CodeBlock* codeBlock) 228 { 229 return mightCompileEval(codeBlock) && canCompileOpcodes(codeBlock); 230 } 231 232 inline bool canCompileProgram(CodeBlock* codeBlock) 233 { 234 return mightCompileProgram(codeBlock) && canCompileOpcodes(codeBlock); 235 } 236 237 inline bool canCompileFunctionForCall(CodeBlock* codeBlock) 238 { 239 return mightCompileFunctionForCall(codeBlock) && canCompileOpcodes(codeBlock); 240 } 241 242 inline bool canCompileFunctionForConstruct(CodeBlock* codeBlock) 243 { 244 return mightCompileFunctionForConstruct(codeBlock) && canCompileOpcodes(codeBlock); 236 inline CapabilityLevel canCompileEval(CodeBlock* codeBlock) 237 { 238 if (!mightCompileEval(codeBlock)) 239 return CannotCompile; 240 241 return canCompileOpcodes(codeBlock); 242 } 243 244 inline CapabilityLevel canCompileProgram(CodeBlock* codeBlock) 245 { 246 if (!mightCompileProgram(codeBlock)) 247 return CannotCompile; 248 249 return canCompileOpcodes(codeBlock); 250 } 251 252 inline CapabilityLevel canCompileFunctionForCall(CodeBlock* codeBlock) 253 { 254 if (!mightCompileFunctionForCall(codeBlock)) 255 return CannotCompile; 256 257 return canCompileOpcodes(codeBlock); 258 } 259 260 inline CapabilityLevel canCompileFunctionForConstruct(CodeBlock* codeBlock) 261 { 262 if (!mightCompileFunctionForConstruct(codeBlock)) 263 return CannotCompile; 264 265 return canCompileOpcodes(codeBlock); 245 266 } 246 267
Note:
See TracChangeset
for help on using the changeset viewer.