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

Unified Diff: test/cctest/interpreter/test-interpreter.cc

Issue 1419003002: [Interpreter] Unify global and unallocated variable access. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix unallocated variable error Created 5 years, 2 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
Index: test/cctest/interpreter/test-interpreter.cc
diff --git a/test/cctest/interpreter/test-interpreter.cc b/test/cctest/interpreter/test-interpreter.cc
index 05da5fe304e962ab5bb22d516ff8b91f7ba62d07..8128be5ddf675130ba3f3965fbed306d1a811746 100644
--- a/test/cctest/interpreter/test-interpreter.cc
+++ b/test/cctest/interpreter/test-interpreter.cc
@@ -780,9 +780,9 @@ TEST(InterpreterLoadNamedProperty) {
builder.set_locals_count(0);
builder.set_context_count(0);
builder.set_parameter_count(1);
- builder.LoadLiteral(name)
- .LoadNamedProperty(builder.Parameter(0), vector->GetIndex(slot),
- i::SLOPPY)
+ size_t name_index = builder.GetConstantPoolEntry(name);
+ builder.LoadNamedProperty(builder.Parameter(0), name_index,
+ vector->GetIndex(slot), i::SLOPPY)
.Return();
Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray();
@@ -879,13 +879,12 @@ TEST(InterpreterStoreNamedProperty) {
name = factory->string_table()->LookupString(isolate, name);
BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone());
- builder.set_locals_count(1);
+ builder.set_locals_count(0);
builder.set_context_count(0);
builder.set_parameter_count(1);
- builder.LoadLiteral(name)
- .StoreAccumulatorInRegister(Register(0))
- .LoadLiteral(Smi::FromInt(999))
- .StoreNamedProperty(builder.Parameter(0), Register(0),
+ size_t name_index = builder.GetConstantPoolEntry(name);
+ builder.LoadLiteral(Smi::FromInt(999))
+ .StoreNamedProperty(builder.Parameter(0), name_index,
vector->GetIndex(slot), i::STRICT)
.Return();
Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray();
@@ -998,8 +997,9 @@ TEST(InterpreterCall) {
builder.set_locals_count(1);
builder.set_context_count(0);
builder.set_parameter_count(1);
- builder.LoadLiteral(name)
- .LoadNamedProperty(builder.Parameter(0), slot_index, i::SLOPPY)
+ size_t name_index = builder.GetConstantPoolEntry(name);
+ builder.LoadNamedProperty(builder.Parameter(0), name_index, slot_index,
+ i::SLOPPY)
.StoreAccumulatorInRegister(Register(0))
.Call(Register(0), builder.Parameter(0), 0)
.Return();
@@ -1020,8 +1020,9 @@ TEST(InterpreterCall) {
builder.set_locals_count(1);
builder.set_context_count(0);
builder.set_parameter_count(1);
- builder.LoadLiteral(name)
- .LoadNamedProperty(builder.Parameter(0), slot_index, i::SLOPPY)
+ size_t name_index = builder.GetConstantPoolEntry(name);
+ builder.LoadNamedProperty(builder.Parameter(0), name_index, slot_index,
+ i::SLOPPY)
.StoreAccumulatorInRegister(Register(0))
.Call(Register(0), builder.Parameter(0), 0)
.Return();
@@ -1045,8 +1046,9 @@ TEST(InterpreterCall) {
builder.set_locals_count(4);
builder.set_context_count(0);
builder.set_parameter_count(1);
- builder.LoadLiteral(name)
- .LoadNamedProperty(builder.Parameter(0), slot_index, i::SLOPPY)
+ size_t name_index = builder.GetConstantPoolEntry(name);
+ builder.LoadNamedProperty(builder.Parameter(0), name_index, slot_index,
+ i::SLOPPY)
.StoreAccumulatorInRegister(Register(0))
.LoadAccumulatorWithRegister(builder.Parameter(0))
.StoreAccumulatorInRegister(Register(1))
@@ -1075,8 +1077,9 @@ TEST(InterpreterCall) {
builder.set_locals_count(12);
builder.set_context_count(0);
builder.set_parameter_count(1);
- builder.LoadLiteral(name)
- .LoadNamedProperty(builder.Parameter(0), slot_index, i::SLOPPY)
+ size_t name_index = builder.GetConstantPoolEntry(name);
+ builder.LoadNamedProperty(builder.Parameter(0), name_index, slot_index,
+ i::SLOPPY)
.StoreAccumulatorInRegister(Register(0))
.LoadAccumulatorWithRegister(builder.Parameter(0))
.StoreAccumulatorInRegister(Register(1))
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/unittests/interpreter/bytecode-array-builder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698