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

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

Issue 1904933002: Introduce bytecodes for assisting generator suspend and resume. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Nix Created 4 years, 8 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/cctest/interpreter/bytecode_expectations/Generators.golden ('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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 .JumpIfTrue(&start) 282 .JumpIfTrue(&start)
283 .CompareOperation(Token::Value::EQ, reg) 283 .CompareOperation(Token::Value::EQ, reg)
284 .JumpIfFalse(&start); 284 .JumpIfFalse(&start);
285 // Perform an operation that returns a non-boolean operation to 285 // Perform an operation that returns a non-boolean operation to
286 // generate JumpIfToBooleanTrue/False. 286 // generate JumpIfToBooleanTrue/False.
287 builder.BinaryOperation(Token::Value::ADD, reg) 287 builder.BinaryOperation(Token::Value::ADD, reg)
288 .JumpIfTrue(&start) 288 .JumpIfTrue(&start)
289 .BinaryOperation(Token::Value::ADD, reg) 289 .BinaryOperation(Token::Value::ADD, reg)
290 .JumpIfFalse(&start); 290 .JumpIfFalse(&start);
291 291
292 // Emit generator operations
293 builder.SuspendGenerator(reg)
294 .ResumeGenerator(reg);
295
292 // Intrinsics handled by the interpreter. 296 // Intrinsics handled by the interpreter.
293 builder.CallRuntime(Runtime::kInlineIsArray, reg, 1) 297 builder.CallRuntime(Runtime::kInlineIsArray, reg, 1)
294 .CallRuntime(Runtime::kInlineIsArray, wide, 1); 298 .CallRuntime(Runtime::kInlineIsArray, wide, 1);
295 299
296 builder.Debugger(); 300 builder.Debugger();
297 for (size_t i = 0; i < arraysize(end); i++) { 301 for (size_t i = 0; i < arraysize(end); i++) {
298 builder.Bind(&end[i]); 302 builder.Bind(&end[i]);
299 } 303 }
300 builder.Return(); 304 builder.Return();
301 305
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 static_cast<size_t>(kMaxUInt16)) == OperandSize::kShort); 782 static_cast<size_t>(kMaxUInt16)) == OperandSize::kShort);
779 CHECK(BytecodeArrayBuilder::SizeForUnsignedOperand( 783 CHECK(BytecodeArrayBuilder::SizeForUnsignedOperand(
780 static_cast<size_t>(kMaxUInt16 + 1)) == OperandSize::kQuad); 784 static_cast<size_t>(kMaxUInt16 + 1)) == OperandSize::kQuad);
781 CHECK(BytecodeArrayBuilder::SizeForUnsignedOperand( 785 CHECK(BytecodeArrayBuilder::SizeForUnsignedOperand(
782 static_cast<size_t>(kMaxUInt32)) == OperandSize::kQuad); 786 static_cast<size_t>(kMaxUInt32)) == OperandSize::kQuad);
783 } 787 }
784 788
785 } // namespace interpreter 789 } // namespace interpreter
786 } // namespace internal 790 } // namespace internal
787 } // namespace v8 791 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/Generators.golden ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698