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) \ |
11 V(Loop) \ | 11 V(Loop) \ |
12 V(Branch) \ | 12 V(Branch) \ |
| 13 V(Switch) \ |
13 V(IfTrue) \ | 14 V(IfTrue) \ |
14 V(IfFalse) \ | 15 V(IfFalse) \ |
15 V(IfSuccess) \ | 16 V(IfSuccess) \ |
16 V(IfException) \ | 17 V(IfException) \ |
17 V(Switch) \ | |
18 V(IfValue) \ | 18 V(IfValue) \ |
19 V(IfDefault) \ | 19 V(IfDefault) \ |
20 V(Merge) \ | 20 V(Merge) \ |
21 V(Deoptimize) \ | 21 V(Deoptimize) \ |
22 V(Return) \ | 22 V(Return) \ |
23 V(OsrNormalEntry) \ | 23 V(OsrNormalEntry) \ |
24 V(OsrLoopEntry) \ | 24 V(OsrLoopEntry) \ |
25 V(Throw) | 25 V(Throw) |
26 | 26 |
27 #define CONTROL_OP_LIST(V) \ | 27 #define CONTROL_OP_LIST(V) \ |
(...skipping 287 matching lines...) Loading... |
315 } | 315 } |
316 | 316 |
317 static bool IsPhiOpcode(Value value) { | 317 static bool IsPhiOpcode(Value value) { |
318 return value == kPhi || value == kEffectPhi; | 318 return value == kPhi || value == kEffectPhi; |
319 } | 319 } |
320 | 320 |
321 static bool IsMergeOpcode(Value value) { | 321 static bool IsMergeOpcode(Value value) { |
322 return value == kMerge || value == kLoop; | 322 return value == kMerge || value == kLoop; |
323 } | 323 } |
324 | 324 |
| 325 static bool IsIfProjectionOpcode(Value value) { |
| 326 return kIfTrue <= value && value <= kIfDefault; |
| 327 } |
| 328 |
325 // Returns true if opcode for comparison operator. | 329 // Returns true if opcode for comparison operator. |
326 static bool IsComparisonOpcode(Value value) { | 330 static bool IsComparisonOpcode(Value value) { |
327 return (kJSEqual <= value && value <= kJSGreaterThanOrEqual) || | 331 return (kJSEqual <= value && value <= kJSGreaterThanOrEqual) || |
328 (kNumberEqual <= value && value <= kStringLessThanOrEqual) || | 332 (kNumberEqual <= value && value <= kStringLessThanOrEqual) || |
329 (kWord32Equal <= value && value <= kFloat64LessThanOrEqual); | 333 (kWord32Equal <= value && value <= kFloat64LessThanOrEqual); |
330 } | 334 } |
331 }; | 335 }; |
332 | 336 |
333 } // namespace compiler | 337 } // namespace compiler |
334 } // namespace internal | 338 } // namespace internal |
335 } // namespace v8 | 339 } // namespace v8 |
336 | 340 |
337 #endif // V8_COMPILER_OPCODES_H_ | 341 #endif // V8_COMPILER_OPCODES_H_ |
OLD | NEW |