Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: src/interpreter/bytecode-array-builder.cc

Issue 1634153002: [Interpreter] Adds support for const/let variables to interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Refactored VisitVariableAssignment. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/bytecode-array-builder.h" 5 #include "src/interpreter/bytecode-array-builder.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 namespace interpreter { 9 namespace interpreter {
10 10
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 } 817 }
818 } 818 }
819 819
820 820
821 // static 821 // static
822 Bytecode BytecodeArrayBuilder::GetJumpWithToBoolean(Bytecode jump_bytecode) { 822 Bytecode BytecodeArrayBuilder::GetJumpWithToBoolean(Bytecode jump_bytecode) {
823 switch (jump_bytecode) { 823 switch (jump_bytecode) {
824 case Bytecode::kJump: 824 case Bytecode::kJump:
825 case Bytecode::kJumpIfNull: 825 case Bytecode::kJumpIfNull:
826 case Bytecode::kJumpIfUndefined: 826 case Bytecode::kJumpIfUndefined:
827 case Bytecode::kJumpIfHole:
828 case Bytecode::kJumpIfNotHole:
827 return jump_bytecode; 829 return jump_bytecode;
828 case Bytecode::kJumpIfTrue: 830 case Bytecode::kJumpIfTrue:
829 return Bytecode::kJumpIfToBooleanTrue; 831 return Bytecode::kJumpIfToBooleanTrue;
830 case Bytecode::kJumpIfFalse: 832 case Bytecode::kJumpIfFalse:
831 return Bytecode::kJumpIfToBooleanFalse; 833 return Bytecode::kJumpIfToBooleanFalse;
832 default: 834 default:
833 UNREACHABLE(); 835 UNREACHABLE();
834 } 836 }
835 return static_cast<Bytecode>(-1); 837 return static_cast<Bytecode>(-1);
836 } 838 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNull(BytecodeLabel* label) { 976 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNull(BytecodeLabel* label) {
975 return OutputJump(Bytecode::kJumpIfNull, label); 977 return OutputJump(Bytecode::kJumpIfNull, label);
976 } 978 }
977 979
978 980
979 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfUndefined( 981 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfUndefined(
980 BytecodeLabel* label) { 982 BytecodeLabel* label) {
981 return OutputJump(Bytecode::kJumpIfUndefined, label); 983 return OutputJump(Bytecode::kJumpIfUndefined, label);
982 } 984 }
983 985
986 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfHole(BytecodeLabel* label) {
987 return OutputJump(Bytecode::kJumpIfHole, label);
988 }
989
990 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNotHole(
991 BytecodeLabel* label) {
992 return OutputJump(Bytecode::kJumpIfNotHole, label);
993 }
984 994
985 BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() { 995 BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() {
986 Output(Bytecode::kThrow); 996 Output(Bytecode::kThrow);
987 exit_seen_in_block_ = true; 997 exit_seen_in_block_ = true;
988 return *this; 998 return *this;
989 } 999 }
990 1000
991 1001
992 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() { 1002 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() {
993 Output(Bytecode::kReThrow); 1003 Output(Bytecode::kReThrow);
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
1813 } 1823 }
1814 1824
1815 // static 1825 // static
1816 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) { 1826 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) {
1817 return value.is_short_operand(); 1827 return value.is_short_operand();
1818 } 1828 }
1819 1829
1820 } // namespace interpreter 1830 } // namespace interpreter
1821 } // namespace internal 1831 } // namespace internal
1822 } // namespace v8 1832 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698