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

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: 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 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 // Emit cast operator invocations. 158 // Emit cast operator invocations.
159 builder.CastAccumulatorToNumber() 159 builder.CastAccumulatorToNumber()
160 .CastAccumulatorToJSObject() 160 .CastAccumulatorToJSObject()
161 .CastAccumulatorToName(); 161 .CastAccumulatorToName();
162 162
163 // Emit control flow. Return must be the last instruction. 163 // Emit control flow. Return must be the last instruction.
164 BytecodeLabel start; 164 BytecodeLabel start;
165 builder.Bind(&start); 165 builder.Bind(&start);
166 // Short jumps with Imm8 operands 166 // Short jumps with Imm8 operands
167 builder.Jump(&start).JumpIfNull(&start).JumpIfUndefined(&start); 167 builder.Jump(&start)
168 .JumpIfNull(&start)
169 .JumpIfUndefined(&start)
170 .JumpIfHole(&start)
171 .JumpIfNotHole(&start);
168 // Perform an operation that returns boolean value to 172 // Perform an operation that returns boolean value to
169 // generate JumpIfTrue/False 173 // generate JumpIfTrue/False
170 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK) 174 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK)
171 .JumpIfTrue(&start) 175 .JumpIfTrue(&start)
172 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK) 176 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK)
173 .JumpIfFalse(&start); 177 .JumpIfFalse(&start);
174 // Perform an operation that returns a non-boolean operation to 178 // Perform an operation that returns a non-boolean operation to
175 // generate JumpIfToBooleanTrue/False. 179 // generate JumpIfToBooleanTrue/False.
176 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) 180 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK)
177 .JumpIfTrue(&start) 181 .JumpIfTrue(&start)
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 iterator.Advance(); 685 iterator.Advance();
682 } 686 }
683 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 687 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
684 iterator.Advance(); 688 iterator.Advance();
685 CHECK(iterator.done()); 689 CHECK(iterator.done());
686 } 690 }
687 691
688 } // namespace interpreter 692 } // namespace interpreter
689 } // namespace internal 693 } // namespace internal
690 } // namespace v8 694 } // namespace v8
OLDNEW
« test/cctest/interpreter/test-interpreter.cc ('K') | « test/test262/test262.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698