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

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

Issue 1894063002: [Interpreter] Remove register file register and replace with LoadParentFramePointer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix gcc 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
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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 int total_registers = locals + contexts + temps; 357 int total_registers = locals + contexts + temps;
358 CHECK_EQ(the_array->frame_size(), total_registers * kPointerSize); 358 CHECK_EQ(the_array->frame_size(), total_registers * kPointerSize);
359 } 359 }
360 } 360 }
361 } 361 }
362 } 362 }
363 363
364 364
365 TEST_F(BytecodeArrayBuilderTest, RegisterValues) { 365 TEST_F(BytecodeArrayBuilderTest, RegisterValues) {
366 int index = 1; 366 int index = 1;
367 int32_t operand = -index;
368 367
369 Register the_register(index); 368 Register the_register(index);
370 CHECK_EQ(the_register.index(), index); 369 CHECK_EQ(the_register.index(), index);
371 370
372 int actual_operand = the_register.ToOperand(); 371 int actual_operand = the_register.ToOperand();
373 CHECK_EQ(actual_operand, operand);
374
375 int actual_index = Register::FromOperand(actual_operand).index(); 372 int actual_index = Register::FromOperand(actual_operand).index();
376 CHECK_EQ(actual_index, index); 373 CHECK_EQ(actual_index, index);
377 } 374 }
378 375
379 376
380 TEST_F(BytecodeArrayBuilderTest, Parameters) { 377 TEST_F(BytecodeArrayBuilderTest, Parameters) {
381 BytecodeArrayBuilder builder(isolate(), zone(), 10, 0, 0); 378 BytecodeArrayBuilder builder(isolate(), zone(), 10, 0, 0);
382 Register param0(builder.Parameter(0)); 379 Register param0(builder.Parameter(0));
383 Register param9(builder.Parameter(9)); 380 Register param9(builder.Parameter(9));
384 CHECK_EQ(param9.index() - param0.index(), 9); 381 CHECK_EQ(param9.index() - param0.index(), 9);
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 static_cast<size_t>(kMaxUInt16)) == OperandSize::kShort); 778 static_cast<size_t>(kMaxUInt16)) == OperandSize::kShort);
782 CHECK(BytecodeArrayBuilder::SizeForUnsignedOperand( 779 CHECK(BytecodeArrayBuilder::SizeForUnsignedOperand(
783 static_cast<size_t>(kMaxUInt16 + 1)) == OperandSize::kQuad); 780 static_cast<size_t>(kMaxUInt16 + 1)) == OperandSize::kQuad);
784 CHECK(BytecodeArrayBuilder::SizeForUnsignedOperand( 781 CHECK(BytecodeArrayBuilder::SizeForUnsignedOperand(
785 static_cast<size_t>(kMaxUInt32)) == OperandSize::kQuad); 782 static_cast<size_t>(kMaxUInt32)) == OperandSize::kQuad);
786 } 783 }
787 784
788 } // namespace interpreter 785 } // namespace interpreter
789 } // namespace internal 786 } // namespace internal
790 } // namespace v8 787 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/node-test-utils.cc ('k') | test/unittests/interpreter/bytecodes-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698