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/frames.h" | 9 #include "src/frames.h" |
10 #include "src/interpreter/bytecode-traits.h" | 10 #include "src/interpreter/bytecode-traits.h" |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
485 default: | 485 default: |
486 return false; | 486 return false; |
487 } | 487 } |
488 } | 488 } |
489 | 489 |
490 // static | 490 // static |
491 bool Bytecodes::IsWithoutExternalSideEffects(Bytecode bytecode) { | 491 bool Bytecodes::IsWithoutExternalSideEffects(Bytecode bytecode) { |
492 // These bytecodes only manipulate interpreter frame state and will | 492 // These bytecodes only manipulate interpreter frame state and will |
493 // never throw. | 493 // never throw. |
494 return (IsAccumulatorLoadWithoutEffects(bytecode) || IsLdarOrStar(bytecode) || | 494 return (IsAccumulatorLoadWithoutEffects(bytecode) || IsLdarOrStar(bytecode) || |
495 bytecode == Bytecode::kMov || bytecode == Bytecode::kNop || | 495 bytecode == Bytecode::kLdrUndefined || bytecode == Bytecode::kMov || |
rmcilroy
2016/06/07 09:46:11
nit - Could we add IsRegisterLoadWithoutEffects, f
oth
2016/06/07 13:46:17
Done.
The thought had occurred whether we should
| |
496 IsJump(bytecode)); | 496 bytecode == Bytecode::kNop || |
497 (IsJump(bytecode) && !IsJumpIfToBoolean(bytecode))); | |
rmcilroy
2016/06/07 09:46:11
nit - could we add IsJumpWithoutExternalEffect() f
oth
2016/06/07 13:46:17
Done.
| |
497 } | 498 } |
498 | 499 |
499 // static | 500 // static |
500 bool Bytecodes::IsJumpOrReturn(Bytecode bytecode) { | 501 bool Bytecodes::IsJumpOrReturn(Bytecode bytecode) { |
501 return bytecode == Bytecode::kReturn || IsJump(bytecode); | 502 return bytecode == Bytecode::kReturn || IsJump(bytecode); |
502 } | 503 } |
503 | 504 |
504 // static | 505 // static |
505 bool Bytecodes::IsMaybeRegisterOperandType(OperandType operand_type) { | 506 bool Bytecodes::IsMaybeRegisterOperandType(OperandType operand_type) { |
506 return operand_type == OperandType::kMaybeReg; | 507 return operand_type == OperandType::kMaybeReg; |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
972 } else { | 973 } else { |
973 std::ostringstream s; | 974 std::ostringstream s; |
974 s << "r" << index(); | 975 s << "r" << index(); |
975 return s.str(); | 976 return s.str(); |
976 } | 977 } |
977 } | 978 } |
978 | 979 |
979 } // namespace interpreter | 980 } // namespace interpreter |
980 } // namespace internal | 981 } // namespace internal |
981 } // namespace v8 | 982 } // namespace v8 |
OLD | NEW |