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

Side by Side Diff: test/unittests/interpreter/bytecode-array-builder-unittest.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: Rebased the patch and fixes tests. 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/interpreter/bytecode-array-builder.h" 7 #include "src/interpreter/bytecode-array-builder.h"
8 #include "src/interpreter/bytecode-array-iterator.h" 8 #include "src/interpreter/bytecode-array-iterator.h"
9 #include "src/interpreter/bytecode-register-allocator.h" 9 #include "src/interpreter/bytecode-register-allocator.h"
10 #include "test/unittests/test-utils.h" 10 #include "test/unittests/test-utils.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 // Emit cast operator invocations. 157 // Emit cast operator invocations.
158 builder.CastAccumulatorToNumber() 158 builder.CastAccumulatorToNumber()
159 .CastAccumulatorToJSObject() 159 .CastAccumulatorToJSObject()
160 .CastAccumulatorToName(); 160 .CastAccumulatorToName();
161 161
162 // Emit control flow. Return must be the last instruction. 162 // Emit control flow. Return must be the last instruction.
163 BytecodeLabel start; 163 BytecodeLabel start;
164 builder.Bind(&start); 164 builder.Bind(&start);
165 // Short jumps with Imm8 operands 165 // Short jumps with Imm8 operands
166 builder.Jump(&start).JumpIfNull(&start).JumpIfUndefined(&start); 166 builder.Jump(&start)
167 .JumpIfNull(&start)
168 .JumpIfUndefined(&start)
169 .JumpIfHole(&start)
170 .JumpIfNotHole(&start);
167 // Perform an operation that returns boolean value to 171 // Perform an operation that returns boolean value to
168 // generate JumpIfTrue/False 172 // generate JumpIfTrue/False
169 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK) 173 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK)
170 .JumpIfTrue(&start) 174 .JumpIfTrue(&start)
171 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK) 175 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK)
172 .JumpIfFalse(&start); 176 .JumpIfFalse(&start);
173 // Perform an operation that returns a non-boolean operation to 177 // Perform an operation that returns a non-boolean operation to
174 // generate JumpIfToBooleanTrue/False. 178 // generate JumpIfToBooleanTrue/False.
175 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) 179 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK)
176 .JumpIfTrue(&start) 180 .JumpIfTrue(&start)
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 iterator.Advance(); 660 iterator.Advance();
657 } 661 }
658 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 662 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
659 iterator.Advance(); 663 iterator.Advance();
660 CHECK(iterator.done()); 664 CHECK(iterator.done());
661 } 665 }
662 666
663 } // namespace interpreter 667 } // namespace interpreter
664 } // namespace internal 668 } // namespace internal
665 } // namespace v8 669 } // namespace v8
OLDNEW
« src/compiler/interpreter-assembler.h ('K') | « test/test262/test262.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698