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

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. 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
« no previous file with comments | « test/test262/test262.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 // Emit cast operator invocations. 159 // Emit cast operator invocations.
160 builder.CastAccumulatorToNumber() 160 builder.CastAccumulatorToNumber()
161 .CastAccumulatorToJSObject() 161 .CastAccumulatorToJSObject()
162 .CastAccumulatorToName(); 162 .CastAccumulatorToName();
163 163
164 // Emit control flow. Return must be the last instruction. 164 // Emit control flow. Return must be the last instruction.
165 BytecodeLabel start; 165 BytecodeLabel start;
166 builder.Bind(&start); 166 builder.Bind(&start);
167 // Short jumps with Imm8 operands 167 // Short jumps with Imm8 operands
168 builder.Jump(&start).JumpIfNull(&start).JumpIfUndefined(&start); 168 builder.Jump(&start)
169 .JumpIfNull(&start)
170 .JumpIfUndefined(&start)
171 .JumpIfHole(&start)
172 .JumpIfNotHole(&start);
169 // Perform an operation that returns boolean value to 173 // Perform an operation that returns boolean value to
170 // generate JumpIfTrue/False 174 // generate JumpIfTrue/False
171 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK) 175 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK)
172 .JumpIfTrue(&start) 176 .JumpIfTrue(&start)
173 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK) 177 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK)
174 .JumpIfFalse(&start); 178 .JumpIfFalse(&start);
175 // Perform an operation that returns a non-boolean operation to 179 // Perform an operation that returns a non-boolean operation to
176 // generate JumpIfToBooleanTrue/False. 180 // generate JumpIfToBooleanTrue/False.
177 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) 181 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK)
178 .JumpIfTrue(&start) 182 .JumpIfTrue(&start)
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 iterator.Advance(); 662 iterator.Advance();
659 } 663 }
660 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 664 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
661 iterator.Advance(); 665 iterator.Advance();
662 CHECK(iterator.done()); 666 CHECK(iterator.done());
663 } 667 }
664 668
665 } // namespace interpreter 669 } // namespace interpreter
666 } // namespace internal 670 } // namespace internal
667 } // namespace v8 671 } // namespace v8
OLDNEW
« no previous file with comments | « test/test262/test262.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698