OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include "src/interpreter/bytecodes.h" | 5 #include "src/interpreter/bytecodes.h" |
6 | 6 |
7 #include <iomanip> | 7 #include <iomanip> |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 } | 467 } |
468 return false; | 468 return false; |
469 } | 469 } |
470 | 470 |
471 // static | 471 // static |
472 bool Bytecodes::IsLdarOrStar(Bytecode bytecode) { | 472 bool Bytecodes::IsLdarOrStar(Bytecode bytecode) { |
473 return bytecode == Bytecode::kLdar || bytecode == Bytecode::kStar; | 473 return bytecode == Bytecode::kLdar || bytecode == Bytecode::kStar; |
474 } | 474 } |
475 | 475 |
476 // static | 476 // static |
477 bool Bytecodes::IsLdaSmiOrLdaZero(Bytecode bytecode) { | |
478 return bytecode == Bytecode::kLdaSmi || bytecode == Bytecode::kLdaZero; | |
479 } | |
480 | |
481 // static | |
482 bool Bytecodes::IsBytecodeWithScalableOperands(Bytecode bytecode) { | 477 bool Bytecodes::IsBytecodeWithScalableOperands(Bytecode bytecode) { |
483 switch (bytecode) { | 478 switch (bytecode) { |
484 #define CASE(Name, ...) \ | 479 #define CASE(Name, ...) \ |
485 case Bytecode::k##Name: \ | 480 case Bytecode::k##Name: \ |
486 typedef BytecodeTraits<__VA_ARGS__> Name##Trait; \ | 481 typedef BytecodeTraits<__VA_ARGS__> Name##Trait; \ |
487 return Name##Trait::IsScalable(); | 482 return Name##Trait::IsScalable(); |
488 BYTECODE_LIST(CASE) | 483 BYTECODE_LIST(CASE) |
489 #undef CASE | 484 #undef CASE |
490 } | 485 } |
491 UNREACHABLE(); | 486 UNREACHABLE(); |
492 return false; | 487 return false; |
493 } | 488 } |
494 | 489 |
495 // static | 490 // static |
496 bool Bytecodes::IsPrefixScalingBytecode(Bytecode bytecode) { | 491 bool Bytecodes::IsPrefixScalingBytecode(Bytecode bytecode) { |
497 switch (bytecode) { | 492 switch (bytecode) { |
498 case Bytecode::kExtraWide: | 493 case Bytecode::kExtraWide: |
499 case Bytecode::kDebugBreakExtraWide: | 494 case Bytecode::kDebugBreakExtraWide: |
500 case Bytecode::kWide: | 495 case Bytecode::kWide: |
501 case Bytecode::kDebugBreakWide: | 496 case Bytecode::kDebugBreakWide: |
502 return true; | 497 return true; |
503 default: | 498 default: |
504 return false; | 499 return false; |
505 } | 500 } |
506 } | 501 } |
507 | 502 |
508 // static | 503 // static |
| 504 bool Bytecodes::PutsNameInAccumulator(Bytecode bytecode) { |
| 505 return bytecode == Bytecode::kToName || bytecode == Bytecode::kTypeOf; |
| 506 } |
| 507 |
| 508 // static |
509 bool Bytecodes::IsJumpOrReturn(Bytecode bytecode) { | 509 bool Bytecodes::IsJumpOrReturn(Bytecode bytecode) { |
510 return bytecode == Bytecode::kReturn || IsJump(bytecode); | 510 return bytecode == Bytecode::kReturn || IsJump(bytecode); |
511 } | 511 } |
512 | 512 |
513 // static | 513 // static |
514 bool Bytecodes::IsMaybeRegisterOperandType(OperandType operand_type) { | 514 bool Bytecodes::IsMaybeRegisterOperandType(OperandType operand_type) { |
515 return operand_type == OperandType::kMaybeReg; | 515 return operand_type == OperandType::kMaybeReg; |
516 } | 516 } |
517 | 517 |
518 // static | 518 // static |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 if (!FLAG_always_opt && !FLAG_prepare_always_opt && | 945 if (!FLAG_always_opt && !FLAG_prepare_always_opt && |
946 pretenure == NOT_TENURED && is_function_scope) { | 946 pretenure == NOT_TENURED && is_function_scope) { |
947 result |= FastNewClosureBit::encode(true); | 947 result |= FastNewClosureBit::encode(true); |
948 } | 948 } |
949 return result; | 949 return result; |
950 } | 950 } |
951 | 951 |
952 } // namespace interpreter | 952 } // namespace interpreter |
953 } // namespace internal | 953 } // namespace internal |
954 } // namespace v8 | 954 } // namespace v8 |
OLD | NEW |