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) \ | |
10 V(Dead) \ | |
11 V(Loop) \ | |
12 V(Branch) \ | |
13 V(IfTrue) \ | |
14 V(IfFalse) \ | |
15 V(IfSuccess) \ | |
16 V(IfException) \ | |
17 V(Switch) \ | |
18 V(IfValue) \ | |
19 V(IfDefault) \ | |
20 V(Merge) \ | |
21 V(Deoptimize) \ | |
22 V(Return) \ | |
23 V(OsrNormalEntry) \ | |
24 V(OsrLoopEntry) \ | |
25 V(Throw) | |
26 | |
27 #define CONTROL_OP_LIST(V) \ | 9 #define CONTROL_OP_LIST(V) \ |
28 INNER_CONTROL_OP_LIST(V) \ | |
29 V(Start) \ | 10 V(Start) \ |
| 11 V(Dead) \ |
| 12 V(Loop) \ |
| 13 V(Branch) \ |
| 14 V(IfTrue) \ |
| 15 V(IfFalse) \ |
| 16 V(IfSuccess) \ |
| 17 V(IfException) \ |
| 18 V(Switch) \ |
| 19 V(IfValue) \ |
| 20 V(IfDefault) \ |
| 21 V(Merge) \ |
| 22 V(Deoptimize) \ |
| 23 V(Return) \ |
| 24 V(OsrNormalEntry) \ |
| 25 V(OsrLoopEntry) \ |
| 26 V(Throw) \ |
30 V(End) | 27 V(End) |
31 | 28 |
32 // Opcodes for constant operators. | 29 // Opcodes for constant operators. |
33 #define CONSTANT_OP_LIST(V) \ | 30 #define CONSTANT_OP_LIST(V) \ |
34 V(Int32Constant) \ | 31 V(Int32Constant) \ |
35 V(Int64Constant) \ | 32 V(Int64Constant) \ |
36 V(Float32Constant) \ | 33 V(Float32Constant) \ |
37 V(Float64Constant) \ | 34 V(Float64Constant) \ |
38 V(ExternalConstant) \ | 35 V(ExternalConstant) \ |
39 V(NumberConstant) \ | 36 V(NumberConstant) \ |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 #define COUNT_OPCODE(x) +1 | 285 #define COUNT_OPCODE(x) +1 |
289 ALL_OP_LIST(COUNT_OPCODE) | 286 ALL_OP_LIST(COUNT_OPCODE) |
290 #undef COUNT_OPCODE | 287 #undef COUNT_OPCODE |
291 }; | 288 }; |
292 | 289 |
293 // Returns the mnemonic name of an opcode. | 290 // Returns the mnemonic name of an opcode. |
294 static char const* Mnemonic(Value value); | 291 static char const* Mnemonic(Value value); |
295 | 292 |
296 // Returns true if opcode for common operator. | 293 // Returns true if opcode for common operator. |
297 static bool IsCommonOpcode(Value value) { | 294 static bool IsCommonOpcode(Value value) { |
298 return kDead <= value && value <= kAlways; | 295 return kStart <= value && value <= kAlways; |
299 } | 296 } |
300 | 297 |
301 // Returns true if opcode for control operator. | 298 // Returns true if opcode for control operator. |
302 static bool IsControlOpcode(Value value) { | 299 static bool IsControlOpcode(Value value) { |
303 return kDead <= value && value <= kEnd; | 300 return kStart <= value && value <= kEnd; |
304 } | 301 } |
305 | 302 |
306 // Returns true if opcode for JavaScript operator. | 303 // Returns true if opcode for JavaScript operator. |
307 static bool IsJsOpcode(Value value) { | 304 static bool IsJsOpcode(Value value) { |
308 return kJSEqual <= value && value <= kJSStackCheck; | 305 return kJSEqual <= value && value <= kJSStackCheck; |
309 } | 306 } |
310 | 307 |
311 // Returns true if opcode for constant operator. | 308 // Returns true if opcode for constant operator. |
312 static bool IsConstantOpcode(Value value) { | 309 static bool IsConstantOpcode(Value value) { |
313 return kInt32Constant <= value && value <= kHeapConstant; | 310 return kInt32Constant <= value && value <= kHeapConstant; |
(...skipping 13 matching lines...) Expand all Loading... |
327 (kNumberEqual <= value && value <= kStringLessThanOrEqual) || | 324 (kNumberEqual <= value && value <= kStringLessThanOrEqual) || |
328 (kWord32Equal <= value && value <= kFloat64LessThanOrEqual); | 325 (kWord32Equal <= value && value <= kFloat64LessThanOrEqual); |
329 } | 326 } |
330 }; | 327 }; |
331 | 328 |
332 } // namespace compiler | 329 } // namespace compiler |
333 } // namespace internal | 330 } // namespace internal |
334 } // namespace v8 | 331 } // namespace v8 |
335 | 332 |
336 #endif // V8_COMPILER_OPCODES_H_ | 333 #endif // V8_COMPILER_OPCODES_H_ |
OLD | NEW |