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

Side by Side Diff: test/unittests/interpreter/bytecode-array-builder-unittest.cc

Issue 1665853002: [Interpreter] Add explicit StackCheck bytecodes on function entry and back branches. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix unittests. 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/mjsunit/mjsunit.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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 .JumpIfTrue(&start) 188 .JumpIfTrue(&start)
189 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK) 189 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK)
190 .JumpIfFalse(&start); 190 .JumpIfFalse(&start);
191 // Perform an operation that returns a non-boolean operation to 191 // Perform an operation that returns a non-boolean operation to
192 // generate JumpIfToBooleanTrue/False. 192 // generate JumpIfToBooleanTrue/False.
193 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) 193 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK)
194 .JumpIfTrue(&start) 194 .JumpIfTrue(&start)
195 .BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) 195 .BinaryOperation(Token::Value::ADD, reg, Strength::WEAK)
196 .JumpIfFalse(&start); 196 .JumpIfFalse(&start);
197 197
198 // Emit stack check bytecode.
199 builder.StackCheck();
200
198 // Emit throw and re-throw in it's own basic block so that the rest of the 201 // Emit throw and re-throw in it's own basic block so that the rest of the
199 // code isn't omitted due to being dead. 202 // code isn't omitted due to being dead.
200 BytecodeLabel after_throw; 203 BytecodeLabel after_throw;
201 builder.Jump(&after_throw).Throw().Bind(&after_throw); 204 builder.Jump(&after_throw).Throw().Bind(&after_throw);
202 BytecodeLabel after_rethrow; 205 BytecodeLabel after_rethrow;
203 builder.Jump(&after_rethrow).ReThrow().Bind(&after_rethrow); 206 builder.Jump(&after_rethrow).ReThrow().Bind(&after_rethrow);
204 207
205 builder.ForInPrepare(reg) 208 builder.ForInPrepare(reg)
206 .ForInDone(reg, reg) 209 .ForInDone(reg, reg)
207 .ForInNext(reg, reg, reg) 210 .ForInNext(reg, reg, reg)
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 iterator.Advance(); 654 iterator.Advance();
652 } 655 }
653 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 656 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
654 iterator.Advance(); 657 iterator.Advance();
655 CHECK(iterator.done()); 658 CHECK(iterator.done());
656 } 659 }
657 660
658 } // namespace interpreter 661 } // namespace interpreter
659 } // namespace internal 662 } // namespace internal
660 } // namespace v8 663 } // namespace v8
OLDNEW
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698