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 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 // Opcodes for control operators. | 10 // Opcodes for control operators. |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 } | 365 } |
366 | 366 |
367 static bool IsMergeOpcode(Value value) { | 367 static bool IsMergeOpcode(Value value) { |
368 return value == kMerge || value == kLoop; | 368 return value == kMerge || value == kLoop; |
369 } | 369 } |
370 | 370 |
371 static bool IsIfProjectionOpcode(Value value) { | 371 static bool IsIfProjectionOpcode(Value value) { |
372 return kIfTrue <= value && value <= kIfDefault; | 372 return kIfTrue <= value && value <= kIfDefault; |
373 } | 373 } |
374 | 374 |
| 375 // Returns true if opcode can be inlined. |
| 376 static bool IsInlineeOpcode(Value value) { |
| 377 return value == kJSCallConstruct || value == kJSCallFunction; |
| 378 } |
| 379 |
375 // Returns true if opcode for comparison operator. | 380 // Returns true if opcode for comparison operator. |
376 static bool IsComparisonOpcode(Value value) { | 381 static bool IsComparisonOpcode(Value value) { |
377 return (kJSEqual <= value && value <= kJSGreaterThanOrEqual) || | 382 return (kJSEqual <= value && value <= kJSGreaterThanOrEqual) || |
378 (kNumberEqual <= value && value <= kStringLessThanOrEqual) || | 383 (kNumberEqual <= value && value <= kStringLessThanOrEqual) || |
379 (kWord32Equal <= value && value <= kFloat64LessThanOrEqual); | 384 (kWord32Equal <= value && value <= kFloat64LessThanOrEqual); |
380 } | 385 } |
381 }; | 386 }; |
382 | 387 |
383 std::ostream& operator<<(std::ostream&, IrOpcode::Value); | 388 std::ostream& operator<<(std::ostream&, IrOpcode::Value); |
384 | 389 |
385 } // namespace compiler | 390 } // namespace compiler |
386 } // namespace internal | 391 } // namespace internal |
387 } // namespace v8 | 392 } // namespace v8 |
388 | 393 |
389 #endif // V8_COMPILER_OPCODES_H_ | 394 #endif // V8_COMPILER_OPCODES_H_ |
OLD | NEW |