| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_COMPILER_OPCODES_H_ | 5 #ifndef V8_COMPILER_OPCODES_H_ |
| 6 #define V8_COMPILER_OPCODES_H_ | 6 #define V8_COMPILER_OPCODES_H_ |
| 7 | 7 |
| 8 // Opcodes for control operators. | 8 // Opcodes for control operators. |
| 9 #define INNER_CONTROL_OP_LIST(V) \ | 9 #define INNER_CONTROL_OP_LIST(V) \ |
| 10 V(Dead) \ | 10 V(Dead) \ |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 V(JSCreateWithContext) \ | 124 V(JSCreateWithContext) \ |
| 125 V(JSCreateBlockContext) \ | 125 V(JSCreateBlockContext) \ |
| 126 V(JSCreateModuleContext) \ | 126 V(JSCreateModuleContext) \ |
| 127 V(JSCreateScriptContext) | 127 V(JSCreateScriptContext) |
| 128 | 128 |
| 129 #define JS_OTHER_OP_LIST(V) \ | 129 #define JS_OTHER_OP_LIST(V) \ |
| 130 V(JSCallConstruct) \ | 130 V(JSCallConstruct) \ |
| 131 V(JSCallFunction) \ | 131 V(JSCallFunction) \ |
| 132 V(JSCallRuntime) \ | 132 V(JSCallRuntime) \ |
| 133 V(JSYield) \ | 133 V(JSYield) \ |
| 134 V(JSDebugger) | 134 V(JSDebugger) \ |
| 135 V(JSStackCheck) |
| 135 | 136 |
| 136 #define JS_OP_LIST(V) \ | 137 #define JS_OP_LIST(V) \ |
| 137 JS_SIMPLE_BINOP_LIST(V) \ | 138 JS_SIMPLE_BINOP_LIST(V) \ |
| 138 JS_SIMPLE_UNOP_LIST(V) \ | 139 JS_SIMPLE_UNOP_LIST(V) \ |
| 139 JS_OBJECT_OP_LIST(V) \ | 140 JS_OBJECT_OP_LIST(V) \ |
| 140 JS_CONTEXT_OP_LIST(V) \ | 141 JS_CONTEXT_OP_LIST(V) \ |
| 141 JS_OTHER_OP_LIST(V) | 142 JS_OTHER_OP_LIST(V) |
| 142 | 143 |
| 143 // Opcodes for VirtuaMachine-level operators. | 144 // Opcodes for VirtuaMachine-level operators. |
| 144 #define SIMPLIFIED_COMPARE_BINOP_LIST(V) \ | 145 #define SIMPLIFIED_COMPARE_BINOP_LIST(V) \ |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 return kDead <= value && value <= kAlways; | 298 return kDead <= value && value <= kAlways; |
| 298 } | 299 } |
| 299 | 300 |
| 300 // Returns true if opcode for control operator. | 301 // Returns true if opcode for control operator. |
| 301 static bool IsControlOpcode(Value value) { | 302 static bool IsControlOpcode(Value value) { |
| 302 return kDead <= value && value <= kEnd; | 303 return kDead <= value && value <= kEnd; |
| 303 } | 304 } |
| 304 | 305 |
| 305 // Returns true if opcode for JavaScript operator. | 306 // Returns true if opcode for JavaScript operator. |
| 306 static bool IsJsOpcode(Value value) { | 307 static bool IsJsOpcode(Value value) { |
| 307 return kJSEqual <= value && value <= kJSDebugger; | 308 return kJSEqual <= value && value <= kJSStackCheck; |
| 308 } | 309 } |
| 309 | 310 |
| 310 // Returns true if opcode for constant operator. | 311 // Returns true if opcode for constant operator. |
| 311 static bool IsConstantOpcode(Value value) { | 312 static bool IsConstantOpcode(Value value) { |
| 312 return kInt32Constant <= value && value <= kHeapConstant; | 313 return kInt32Constant <= value && value <= kHeapConstant; |
| 313 } | 314 } |
| 314 | 315 |
| 315 static bool IsPhiOpcode(Value value) { | 316 static bool IsPhiOpcode(Value value) { |
| 316 return value == kPhi || value == kEffectPhi; | 317 return value == kPhi || value == kEffectPhi; |
| 317 } | 318 } |
| 318 | 319 |
| 319 static bool IsMergeOpcode(Value value) { | 320 static bool IsMergeOpcode(Value value) { |
| 320 return value == kMerge || value == kLoop; | 321 return value == kMerge || value == kLoop; |
| 321 } | 322 } |
| 322 | 323 |
| 323 // Returns true if opcode for comparison operator. | 324 // Returns true if opcode for comparison operator. |
| 324 static bool IsComparisonOpcode(Value value) { | 325 static bool IsComparisonOpcode(Value value) { |
| 325 return (kJSEqual <= value && value <= kJSGreaterThanOrEqual) || | 326 return (kJSEqual <= value && value <= kJSGreaterThanOrEqual) || |
| 326 (kNumberEqual <= value && value <= kStringLessThanOrEqual) || | 327 (kNumberEqual <= value && value <= kStringLessThanOrEqual) || |
| 327 (kWord32Equal <= value && value <= kFloat64LessThanOrEqual); | 328 (kWord32Equal <= value && value <= kFloat64LessThanOrEqual); |
| 328 } | 329 } |
| 329 }; | 330 }; |
| 330 | 331 |
| 331 } // namespace compiler | 332 } // namespace compiler |
| 332 } // namespace internal | 333 } // namespace internal |
| 333 } // namespace v8 | 334 } // namespace v8 |
| 334 | 335 |
| 335 #endif // V8_COMPILER_OPCODES_H_ | 336 #endif // V8_COMPILER_OPCODES_H_ |
| OLD | NEW |