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

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

Issue 1587033002: [Interpreter] Ensure we always have an outer register allocation scope. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_mythri
Patch Set: Similarity 20 Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | test/unittests/interpreter/bytecode-register-allocator-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/interpreter/bytecode-array-builder-unittest.cc
diff --git a/test/unittests/interpreter/bytecode-array-builder-unittest.cc b/test/unittests/interpreter/bytecode-array-builder-unittest.cc
index 2c1f1c9ddcfe88be49df022d0d24f17fc496f40e..2140aa83c7c085b31057fc41c39d11f21580b412 100644
--- a/test/unittests/interpreter/bytecode-array-builder-unittest.cc
+++ b/test/unittests/interpreter/bytecode-array-builder-unittest.cc
@@ -6,6 +6,7 @@
#include "src/interpreter/bytecode-array-builder.h"
#include "src/interpreter/bytecode-array-iterator.h"
+#include "src/interpreter/bytecode-register-allocator.h"
#include "test/unittests/test-utils.h"
namespace v8 {
@@ -317,7 +318,7 @@ TEST_F(BytecodeArrayBuilderTest, FrameSizesLookGood) {
builder.set_locals_count(locals);
builder.set_context_count(contexts);
- TemporaryRegisterScope temporaries(&builder);
+ BytecodeRegisterAllocator temporaries(&builder);
for (int i = 0; i < temps; i++) {
builder.StoreAccumulatorInRegister(temporaries.NewRegister());
}
@@ -332,32 +333,6 @@ TEST_F(BytecodeArrayBuilderTest, FrameSizesLookGood) {
}
-TEST_F(BytecodeArrayBuilderTest, TemporariesRecycled) {
- BytecodeArrayBuilder builder(isolate(), zone());
- builder.set_parameter_count(0);
- builder.set_locals_count(0);
- builder.set_context_count(0);
- builder.Return();
-
- int first;
- {
- TemporaryRegisterScope temporaries(&builder);
- first = temporaries.NewRegister().index();
- temporaries.NewRegister();
- temporaries.NewRegister();
- temporaries.NewRegister();
- }
-
- int second;
- {
- TemporaryRegisterScope temporaries(&builder);
- second = temporaries.NewRegister().index();
- }
-
- CHECK_EQ(first, second);
-}
-
-
TEST_F(BytecodeArrayBuilderTest, RegisterValues) {
int index = 1;
uint8_t operand = static_cast<uint8_t>(-index);
@@ -391,15 +366,15 @@ TEST_F(BytecodeArrayBuilderTest, RegisterType) {
builder.set_locals_count(3);
builder.set_context_count(0);
- TemporaryRegisterScope temporary_register_scope(&builder);
- Register temp0 = temporary_register_scope.NewRegister();
+ BytecodeRegisterAllocator register_allocator(&builder);
+ Register temp0 = register_allocator.NewRegister();
Register param0(builder.Parameter(0));
Register param9(builder.Parameter(9));
- Register temp1 = temporary_register_scope.NewRegister();
+ Register temp1 = register_allocator.NewRegister();
Register reg0(0);
Register reg1(1);
Register reg2(2);
- Register temp2 = temporary_register_scope.NewRegister();
+ Register temp2 = register_allocator.NewRegister();
CHECK_EQ(builder.RegisterIsParameterOrLocal(temp0), false);
CHECK_EQ(builder.RegisterIsParameterOrLocal(temp1), false);
CHECK_EQ(builder.RegisterIsParameterOrLocal(temp2), false);
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | test/unittests/interpreter/bytecode-register-allocator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698