Commit 8ae9fb69 authored by mythria's avatar mythria Committed by Commit bot

[Interpreter] Fixes VisitObjectLiteral to reserve consecutive registers in innerscope.

VisitObjectLiteral has two parts. First it creates a literal and then
sets properties or accessor properties. Setting properties requires a
runtime call and it expects the literal object which was created in the
first part is contiguous with other registers it allocates. Since these
are allocated in a different scope they are not always contiguous.
This causes problems with mjsunit/setter-on-constructor-prototype.js.
This cl fixes by allocating contiguous registers in the inner scope.
Literal value is copied into the newly allocated register so that all
the required registers are always contiguous.

BUG=v8:4280
LOG=N

Review URL: https://codereview.chromium.org/1588903002

Cr-Commit-Position: refs/heads/master@{#33371}
parent 81e796ff
......@@ -1006,10 +1006,13 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
builder()->CreateObjectLiteral(expr->constant_properties(),
expr->literal_index(),
expr->ComputeFlags(true));
Register literal;
// Allocate in the outer scope since this register is used to return the
// expression's results to the caller.
Register literal = register_allocator()->outer()->NewRegister();
builder()->StoreAccumulatorInRegister(literal);
// Store computed values into the literal.
bool literal_in_accumulator = true;
int property_index = 0;
AccessorTable accessor_table(zone());
for (; property_index < expr->properties()->length(); property_index++) {
......@@ -1017,12 +1020,6 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
if (property->is_computed_name()) break;
if (property->IsCompileTimeValue()) continue;
if (literal_in_accumulator) {
literal = register_allocator()->NewRegister();
builder()->StoreAccumulatorInRegister(literal);
literal_in_accumulator = false;
}
RegisterAllocationScope inner_register_scope(this);
Literal* literal_key = property->key()->AsLiteral();
switch (property->kind()) {
......@@ -1044,14 +1041,14 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
VisitForEffect(property->value());
}
} else {
register_allocator()->PrepareForConsecutiveAllocations(3);
register_allocator()->PrepareForConsecutiveAllocations(4);
Register literal_argument =
register_allocator()->NextConsecutiveRegister();
Register key = register_allocator()->NextConsecutiveRegister();
Register value = register_allocator()->NextConsecutiveRegister();
Register language = register_allocator()->NextConsecutiveRegister();
// TODO(oth): This is problematic - can't assume contiguous here.
// literal is allocated in outer register scope, whereas key, value,
// language are in another.
DCHECK(Register::AreContiguous(literal, key, value, language));
builder()->MoveRegister(literal, literal_argument);
VisitForAccumulatorValue(property->key());
builder()->StoreAccumulatorInRegister(key);
VisitForAccumulatorValue(property->value());
......@@ -1060,20 +1057,23 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
builder()
->LoadLiteral(Smi::FromInt(SLOPPY))
.StoreAccumulatorInRegister(language)
.CallRuntime(Runtime::kSetProperty, literal, 4);
.CallRuntime(Runtime::kSetProperty, literal_argument, 4);
VisitSetHomeObject(value, literal, property);
}
}
break;
}
case ObjectLiteral::Property::PROTOTYPE: {
register_allocator()->PrepareForConsecutiveAllocations(1);
DCHECK(property->emit_store());
register_allocator()->PrepareForConsecutiveAllocations(2);
Register literal_argument =
register_allocator()->NextConsecutiveRegister();
Register value = register_allocator()->NextConsecutiveRegister();
DCHECK(Register::AreContiguous(literal, value));
builder()->MoveRegister(literal, literal_argument);
VisitForAccumulatorValue(property->value());
builder()->StoreAccumulatorInRegister(value).CallRuntime(
Runtime::kInternalSetPrototype, literal, 2);
Runtime::kInternalSetPrototype, literal_argument, 2);
break;
}
case ObjectLiteral::Property::GETTER:
......@@ -1094,12 +1094,14 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
for (AccessorTable::Iterator it = accessor_table.begin();
it != accessor_table.end(); ++it) {
RegisterAllocationScope inner_register_scope(this);
register_allocator()->PrepareForConsecutiveAllocations(4);
register_allocator()->PrepareForConsecutiveAllocations(5);
Register literal_argument = register_allocator()->NextConsecutiveRegister();
Register name = register_allocator()->NextConsecutiveRegister();
Register getter = register_allocator()->NextConsecutiveRegister();
Register setter = register_allocator()->NextConsecutiveRegister();
Register attr = register_allocator()->NextConsecutiveRegister();
DCHECK(Register::AreContiguous(literal, name, getter, setter, attr));
builder()->MoveRegister(literal, literal_argument);
VisitForAccumulatorValue(it->first);
builder()->StoreAccumulatorInRegister(name);
VisitObjectLiteralAccessor(literal, it->second->getter, getter);
......@@ -1107,7 +1109,8 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
builder()
->LoadLiteral(Smi::FromInt(NONE))
.StoreAccumulatorInRegister(attr)
.CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, literal, 5);
.CallRuntime(Runtime::kDefineAccessorPropertyUnchecked,
literal_argument, 5);
}
// Object literals have two parts. The "static" part on the left contains no
......@@ -1120,30 +1123,31 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
// compile them into a series of "SetOwnProperty" runtime calls. This will
// preserve insertion order.
for (; property_index < expr->properties()->length(); property_index++) {
if (literal_in_accumulator) {
literal = register_allocator()->NewRegister();
builder()->StoreAccumulatorInRegister(literal);
literal_in_accumulator = false;
}
ObjectLiteral::Property* property = expr->properties()->at(property_index);
RegisterAllocationScope inner_register_scope(this);
if (property->kind() == ObjectLiteral::Property::PROTOTYPE) {
DCHECK(property->emit_store());
Register value = register_allocator()->NewRegister();
DCHECK(Register::AreContiguous(literal, value));
register_allocator()->PrepareForConsecutiveAllocations(2);
Register literal_argument =
register_allocator()->NextConsecutiveRegister();
Register value = register_allocator()->NextConsecutiveRegister();
builder()->MoveRegister(literal, literal_argument);
VisitForAccumulatorValue(property->value());
builder()->StoreAccumulatorInRegister(value).CallRuntime(
Runtime::kInternalSetPrototype, literal, 2);
Runtime::kInternalSetPrototype, literal_argument, 2);
continue;
}
register_allocator()->PrepareForConsecutiveAllocations(3);
register_allocator()->PrepareForConsecutiveAllocations(4);
Register literal_argument = register_allocator()->NextConsecutiveRegister();
Register key = register_allocator()->NextConsecutiveRegister();
Register value = register_allocator()->NextConsecutiveRegister();
Register attr = register_allocator()->NextConsecutiveRegister();
DCHECK(Register::AreContiguous(literal, key, value, attr));
DCHECK(Register::AreContiguous(literal_argument, key, value, attr));
builder()->MoveRegister(literal, literal_argument);
VisitForAccumulatorValue(property->key());
builder()->CastAccumulatorToName().StoreAccumulatorInRegister(key);
VisitForAccumulatorValue(property->value());
......@@ -1167,20 +1171,15 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
function_id = Runtime::kDefineSetterPropertyUnchecked;
break;
}
builder()->CallRuntime(function_id, literal, 4);
builder()->CallRuntime(function_id, literal_argument, 4);
}
// Transform literals that contain functions to fast properties.
if (expr->has_function()) {
DCHECK(!literal_in_accumulator);
builder()->CallRuntime(Runtime::kToFastProperties, literal, 1);
}
if (!literal_in_accumulator) {
// Restore literal array into accumulator.
builder()->LoadAccumulatorWithRegister(literal);
}
execution_result()->SetResultInAccumulator();
execution_result()->SetResultInRegister(literal);
}
......
......@@ -3200,57 +3200,52 @@ TEST(Delete) {
{"var a = {x:13, y:14}; return delete a.x;",
2 * kPointerSize,
1,
13,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
B(Star), R(1), //
B(LdaConstant), U8(1), //
B(DeletePropertySloppy), R(1), //
B(Return)
},
15,
{B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(1), //
B(Star), R(0), //
B(Star), R(1), //
B(LdaConstant), U8(1), //
B(DeletePropertySloppy), R(1), //
B(Return)},
2,
{InstanceType::FIXED_ARRAY_TYPE,
InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}},
{"'use strict'; var a = {x:13, y:14}; return delete a.x;",
2 * kPointerSize,
1,
13,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
B(Star), R(1), //
B(LdaConstant), U8(1), //
B(DeletePropertyStrict), R(1), //
B(Return)
},
15,
{B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(1), //
B(Star), R(0), //
B(Star), R(1), //
B(LdaConstant), U8(1), //
B(DeletePropertyStrict), R(1), //
B(Return)},
2,
{InstanceType::FIXED_ARRAY_TYPE,
InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}},
{"var a = {1:13, 2:14}; return delete a[2];",
2 * kPointerSize,
1,
13,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
B(Star), R(1), //
B(LdaSmi8), U8(2), //
B(DeletePropertySloppy), R(1), //
B(Return)
},
15,
{B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(1), //
B(Star), R(0), //
B(Star), R(1), //
B(LdaSmi8), U8(2), //
B(DeletePropertySloppy), R(1), //
B(Return)},
1,
{InstanceType::FIXED_ARRAY_TYPE}},
{"var a = 10; return delete a;",
1 * kPointerSize,
1,
6,
{
B(LdaSmi8), U8(10), //
B(Star), R(0), //
B(LdaFalse), //
B(Return)
},
{B(LdaSmi8), U8(10), //
B(Star), R(0), //
B(LdaFalse), //
B(Return)},
0},
{"'use strict';"
"var a = {1:10};"
......@@ -3258,20 +3253,19 @@ TEST(Delete) {
"return delete a[1];",
2 * kPointerSize,
1,
27,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
B(PushContext), R(0), //
B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(StaContextSlot), R(0), U8(first_context_slot), //
B(CreateClosure), U8(1), U8(0), //
B(LdaContextSlot), R(0), U8(first_context_slot), //
B(Star), R(1), //
B(LdaSmi8), U8(1), //
B(DeletePropertyStrict), R(1), //
B(Return)
},
29,
{B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
B(PushContext), R(0), //
B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(1), //
B(StaContextSlot), R(0), U8(first_context_slot), //
B(CreateClosure), U8(1), U8(0), //
B(LdaContextSlot), R(0), U8(first_context_slot), //
B(Star), R(1), //
B(LdaSmi8), U8(1), //
B(DeletePropertyStrict), R(1), //
B(Return)},
2,
{InstanceType::FIXED_ARRAY_TYPE,
InstanceType::SHARED_FUNCTION_INFO_TYPE}},
......@@ -3279,10 +3273,8 @@ TEST(Delete) {
0 * kPointerSize,
1,
2,
{
B(LdaTrue), //
B(Return)
},
{B(LdaTrue), //
B(Return)},
0},
};
......@@ -3684,21 +3676,23 @@ TEST(ObjectLiterals) {
ObjectLiteral::kFastElements | ObjectLiteral::kDisableMementos;
ExpectedSnippet<InstanceType> snippets[] = {
{"return { };",
0,
kPointerSize,
1,
5,
7,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(simple_flags), //
B(Star), R(0), //
B(Return) //
},
1,
{InstanceType::FIXED_ARRAY_TYPE}},
{"return { name: 'string', val: 9.2 };",
0,
kPointerSize,
1,
5,
7,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
B(Return) //
},
1,
......@@ -3753,8 +3747,7 @@ TEST(ObjectLiterals) {
B(Return), //
},
3,
{InstanceType::FIXED_ARRAY_TYPE,
InstanceType::SHARED_FUNCTION_INFO_TYPE,
{InstanceType::FIXED_ARRAY_TYPE, InstanceType::SHARED_FUNCTION_INFO_TYPE,
InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}},
{"return { func(a) { return a; } };",
1 * kPointerSize,
......@@ -3769,26 +3762,26 @@ TEST(ObjectLiterals) {
B(Return), //
},
3,
{InstanceType::FIXED_ARRAY_TYPE,
InstanceType::SHARED_FUNCTION_INFO_TYPE,
{InstanceType::FIXED_ARRAY_TYPE, InstanceType::SHARED_FUNCTION_INFO_TYPE,
InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}},
{"return { get a() { return 2; } };",
5 * kPointerSize,
6 * kPointerSize,
1,
29,
32,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
B(Mov), R(0), R(1), //
B(LdaConstant), U8(1), //
B(Star), R(1), //
B(CreateClosure), U8(2), U8(0), //
B(Star), R(2), //
B(LdaNull), //
B(CreateClosure), U8(2), U8(0), //
B(Star), R(3), //
B(LdaZero), //
B(LdaNull), //
B(Star), R(4), //
B(LdaZero), //
B(Star), R(5), //
B(CallRuntime), U16(Runtime::kDefineAccessorPropertyUnchecked), //
R(0), U8(5), //
R(1), U8(5), //
B(Ldar), R(0), //
B(Return), //
},
......@@ -3797,22 +3790,23 @@ TEST(ObjectLiterals) {
InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE,
InstanceType::SHARED_FUNCTION_INFO_TYPE}},
{"return { get a() { return this.x; }, set a(val) { this.x = val } };",
5 * kPointerSize,
6 * kPointerSize,
1,
31,
34,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
B(Mov), R(0), R(1), //
B(LdaConstant), U8(1), //
B(Star), R(1), //
B(CreateClosure), U8(2), U8(0), //
B(Star), R(2), //
B(CreateClosure), U8(3), U8(0), //
B(CreateClosure), U8(2), U8(0), //
B(Star), R(3), //
B(LdaZero), //
B(CreateClosure), U8(3), U8(0), //
B(Star), R(4), //
B(LdaZero), //
B(Star), R(5), //
B(CallRuntime), U16(Runtime::kDefineAccessorPropertyUnchecked), //
R(0), U8(5), //
R(1), U8(5), //
B(Ldar), R(0), //
B(Return), //
},
......@@ -3822,22 +3816,23 @@ TEST(ObjectLiterals) {
InstanceType::SHARED_FUNCTION_INFO_TYPE,
InstanceType::SHARED_FUNCTION_INFO_TYPE}},
{"return { set b(val) { this.y = val } };",
5 * kPointerSize,
6 * kPointerSize,
1,
29,
32,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
B(Mov), R(0), R(1), //
B(LdaConstant), U8(1), //
B(Star), R(1), //
B(LdaNull), //
B(Star), R(2), //
B(CreateClosure), U8(2), U8(0), //
B(LdaNull), //
B(Star), R(3), //
B(LdaZero), //
B(CreateClosure), U8(2), U8(0), //
B(Star), R(4), //
B(LdaZero), //
B(Star), R(5), //
B(CallRuntime), U16(Runtime::kDefineAccessorPropertyUnchecked), //
R(0), U8(5), //
R(1), U8(5), //
B(Ldar), R(0), //
B(Return), //
},
......@@ -3846,58 +3841,61 @@ TEST(ObjectLiterals) {
InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE,
InstanceType::SHARED_FUNCTION_INFO_TYPE}},
{"var a = 1; return { 1: a };",
5 * kPointerSize,
6 * kPointerSize,
1,
29,
32,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(1), //
B(Mov), R(1), R(2), //
B(LdaSmi8), U8(1), //
B(Star), R(2), //
B(Ldar), R(0), //
B(Star), R(3), //
B(LdaZero), //
B(Ldar), R(0), //
B(Star), R(4), //
B(CallRuntime), U16(Runtime::kSetProperty), R(1), U8(4), //
B(LdaZero), //
B(Star), R(5), //
B(CallRuntime), U16(Runtime::kSetProperty), R(2), U8(4), //
B(Ldar), R(1), //
B(Return), //
},
1,
{InstanceType::FIXED_ARRAY_TYPE}},
{"return { __proto__: null }",
2 * kPointerSize,
3 * kPointerSize,
1,
17,
20,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(simple_flags), //
B(Star), R(0), //
B(LdaNull), B(Star), R(1), //
B(CallRuntime), U16(Runtime::kInternalSetPrototype), R(0), U8(2), //
B(Mov), R(0), R(1), //
B(LdaNull), B(Star), R(2), //
B(CallRuntime), U16(Runtime::kInternalSetPrototype), R(1), U8(2), //
B(Ldar), R(0), //
B(Return), //
},
1,
{InstanceType::FIXED_ARRAY_TYPE}},
{"var a = 'test'; return { [a]: 1 }",
5 * kPointerSize,
6 * kPointerSize,
1,
30,
33,
{
B(LdaConstant), U8(0), //
B(Star), R(0), //
B(CreateObjectLiteral), U8(1), U8(0), U8(simple_flags), //
B(Star), R(1), //
B(Mov), R(1), R(2), //
B(Ldar), R(0), //
B(ToName), //
B(Star), R(2), //
B(LdaSmi8), U8(1), //
B(Star), R(3), //
B(LdaZero), //
B(LdaSmi8), U8(1), //
B(Star), R(4), //
B(CallRuntime), U16(Runtime::kDefineDataPropertyUnchecked), R(1), //
U8(4), //
B(LdaZero), //
B(Star), R(5), //
B(CallRuntime), U16(Runtime::kDefineDataPropertyUnchecked), R(2), //
U8(4), //
B(Ldar), R(1), //
B(Return), //
},
......@@ -3905,9 +3903,9 @@ TEST(ObjectLiterals) {
{InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE,
InstanceType::FIXED_ARRAY_TYPE}},
{"var a = 'test'; return { val: a, [a]: 1 }",
5 * kPointerSize,
6 * kPointerSize,
1,
36,
39,
{
B(LdaConstant), U8(0), //
B(Star), R(0), //
......@@ -3915,15 +3913,16 @@ TEST(ObjectLiterals) {
B(Star), R(1), //
B(Ldar), R(0), //
B(StoreICSloppy), R(1), U8(2), U8(vector->GetIndex(slot1)), //
B(Mov), R(1), R(2), //
B(Ldar), R(0), //
B(ToName), //
B(Star), R(2), //
B(LdaSmi8), U8(1), //
B(Star), R(3), //
B(LdaZero), //
B(LdaSmi8), U8(1), //
B(Star), R(4), //
B(CallRuntime), U16(Runtime::kDefineDataPropertyUnchecked), R(1), //
U8(4), //
B(LdaZero), //
B(Star), R(5), //
B(CallRuntime), U16(Runtime::kDefineDataPropertyUnchecked), R(2), //
U8(4), //
B(Ldar), R(1), //
B(Return), //
},
......@@ -3932,26 +3931,29 @@ TEST(ObjectLiterals) {
InstanceType::FIXED_ARRAY_TYPE,
InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}},
{"var a = 'test'; return { [a]: 1, __proto__: {} }",
5 * kPointerSize,
6 * kPointerSize,
1,
41,
49,
{
B(LdaConstant), U8(0), //
B(Star), R(0), //
B(CreateObjectLiteral), U8(1), U8(1), U8(simple_flags), //
B(Star), R(1), //
B(Mov), R(1), R(2), //
B(Ldar), R(0), //
B(ToName), //
B(Star), R(2), //
B(LdaSmi8), U8(1), //
B(Star), R(3), //
B(LdaZero), //
B(LdaSmi8), U8(1), //
B(Star), R(4), //
B(CallRuntime), U16(Runtime::kDefineDataPropertyUnchecked), R(1), //
U8(4), //
B(LdaZero), //
B(Star), R(5), //
B(CallRuntime), U16(Runtime::kDefineDataPropertyUnchecked), R(2), //
U8(4), //
B(Mov), R(1), R(2), //
B(CreateObjectLiteral), U8(1), U8(0), U8(13), //
B(Star), R(2), //
B(CallRuntime), U16(Runtime::kInternalSetPrototype), R(1), U8(2), //
B(Star), R(4), //
B(Star), R(3), //
B(CallRuntime), U16(Runtime::kInternalSetPrototype), R(2), U8(2), //
B(Ldar), R(1), //
B(Return), //
},
......@@ -3959,39 +3961,42 @@ TEST(ObjectLiterals) {
{InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE,
InstanceType::FIXED_ARRAY_TYPE}},
{"var n = 'name'; return { [n]: 'val', get a() { }, set a(b) {} };",
5 * kPointerSize,
6 * kPointerSize,
1,
64,
73,
{
B(LdaConstant), U8(0), //
B(Star), R(0), //
B(CreateObjectLiteral), U8(1), U8(0), U8(simple_flags), //
B(Star), R(1), //
B(Mov), R(1), R(2), //
B(Ldar), R(0), //
B(ToName), //
B(Star), R(2), //
B(LdaConstant), U8(2), //
B(Star), R(3), //
B(LdaZero), //
B(LdaConstant), U8(2), //
B(Star), R(4), //
B(CallRuntime), U16(Runtime::kDefineDataPropertyUnchecked), R(1), //
U8(4), //
B(LdaZero), //
B(Star), R(5), //
B(CallRuntime), U16(Runtime::kDefineDataPropertyUnchecked), R(2), //
U8(4), //
B(Mov), R(1), R(2), //
B(LdaConstant), U8(3), //
B(Star), R(2), //
B(CreateClosure), U8(4), U8(0), //
B(Star), R(3), //
B(LdaZero), //
B(CreateClosure), U8(4), U8(0), //
B(Star), R(4), //
B(LdaZero), //
B(Star), R(5), //
B(CallRuntime), U16(Runtime::kDefineGetterPropertyUnchecked), //
R(1), U8(4), //
R(2), U8(4), //
B(Mov), R(1), R(2), //
B(LdaConstant), U8(3), //
B(Star), R(2), //
B(CreateClosure), U8(5), U8(0), //
B(Star), R(3), //
B(LdaZero), //
B(CreateClosure), U8(5), U8(0), //
B(Star), R(4), //
B(LdaZero), //
B(Star), R(5), //
B(CallRuntime), U16(Runtime::kDefineSetterPropertyUnchecked), //
R(1), U8(4), //
R(2), U8(4), //
B(Ldar), R(1), //
B(Return), //
},
......@@ -4024,16 +4029,18 @@ TEST(ObjectLiteralsWide) {
ExpectedSnippet<InstanceType, 257> snippets[] = {
{"var a;" REPEAT_256(SPACE,
"a = 1.23;") "return { name: 'string', val: 9.2 };",
1 * kPointerSize,
2 * kPointerSize,
1,
1031,
1033,
{
REPEAT_256(COMMA, //
B(LdaConstant), U8(wide_idx++), //
B(Star), R(0)), //
B(CreateObjectLiteralWide), U16(256), U16(0), //
U8(deep_elements_flags), //
B(Return) //
REPEAT_256(COMMA, //
B(LdaConstant), U8(wide_idx++), //
B(Star), R(0)), //
B(CreateObjectLiteralWide),
U16(256), U16(0), //
U8(deep_elements_flags), //
B(Star), R(1), //
B(Return) //
},
257,
{REPEAT_256(COMMA, InstanceType::HEAP_NUMBER_TYPE),
......@@ -4678,9 +4685,10 @@ TEST(CountOperators) {
{"var a = { val: 1 }; return a.val++;",
3 * kPointerSize,
1,
23,
25,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(object_literal_flags), //
B(Star), R(1), //
B(Star), R(0), //
B(Star), R(1), //
B(LoadICSloppy), R(1), U8(1), U8(vector->GetIndex(slot1)), //
......@@ -4697,9 +4705,10 @@ TEST(CountOperators) {
{"var a = { val: 1 }; return --a.val;",
2 * kPointerSize,
1,
19,
21,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(object_literal_flags), //
B(Star), R(1), //
B(Star), R(0), //
B(Star), R(1), //
B(LoadICSloppy), R(1), U8(1), U8(vector->GetIndex(slot1)), //
......@@ -4714,11 +4723,12 @@ TEST(CountOperators) {
{"var name = 'var'; var a = { val: 1 }; return a[name]--;",
5 * kPointerSize,
1,
30,
32,
{
B(LdaConstant), U8(0), //
B(Star), R(0), //
B(CreateObjectLiteral), U8(1), U8(0), U8(object_literal_flags), //
B(Star), R(2), //
B(Star), R(1), //
B(Star), R(2), //
B(Ldar), R(0), //
......@@ -4737,11 +4747,12 @@ TEST(CountOperators) {
{"var name = 'var'; var a = { val: 1 }; return ++a[name];",
4 * kPointerSize,
1,
26,
28,
{
B(LdaConstant), U8(0), //
B(Star), R(0), //
B(CreateObjectLiteral), U8(1), U8(0), U8(object_literal_flags), //
B(Star), R(2), //
B(Star), R(1), //
B(Star), R(2), //
B(Ldar), R(0), //
......@@ -4761,7 +4772,7 @@ TEST(CountOperators) {
26,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), //
U8(1), //
U8(1), //
B(PushContext), R(1), //
B(LdaSmi8), U8(1), //
B(StaContextSlot), R(1), U8(first_context_slot), //
......@@ -4781,7 +4792,7 @@ TEST(CountOperators) {
30,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), //
U8(1), //
U8(1), //
B(PushContext), R(1), //
B(LdaSmi8), U8(1), //
B(StaContextSlot), R(1), U8(first_context_slot), //
......@@ -4802,20 +4813,20 @@ TEST(CountOperators) {
1,
27,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(CreateArrayLiteral), U8(0), U8(0), U8(array_literal_flags), //
B(Star), R(1), //
B(Star), R(2), //
B(Ldar), R(0), //
B(ToNumber), //
B(Star), R(3), //
B(Inc), //
B(Star), R(0), //
B(LdaSmi8), U8(2), //
B(KeyedStoreICSloppy), R(2), R(3), //
U8(store_vector->GetIndex(store_slot)), //
B(Return), //
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(CreateArrayLiteral), U8(0), U8(0), U8(array_literal_flags), //
B(Star), R(1), //
B(Star), R(2), //
B(Ldar), R(0), //
B(ToNumber), //
B(Star), R(3), //
B(Inc), //
B(Star), R(0), //
B(LdaSmi8), U8(2), //
B(KeyedStoreICSloppy), R(2), R(3), //
U8(store_vector->GetIndex(store_slot)), //
B(Return), //
},
1,
{InstanceType::FIXED_ARRAY_TYPE}},
......@@ -4958,9 +4969,10 @@ TEST(CompoundExpressions) {
{"var a = { val: 2 }; a.name *= 2;",
3 * kPointerSize,
1,
24,
26,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(object_literal_flags), //
B(Star), R(1), //
B(Star), R(0), //
B(Star), R(1), //
B(LoadICSloppy), R(1), U8(1), U8(vector->GetIndex(slot1)), //
......@@ -4977,9 +4989,10 @@ TEST(CompoundExpressions) {
{"var a = { 1: 2 }; a[1] ^= 2;",
4 * kPointerSize,
1,
27,
29,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(object_literal_flags), //
B(Star), R(1), //
B(Star), R(0), //
B(Star), R(1), //
B(LdaSmi8), U8(1), //
......@@ -5000,7 +5013,7 @@ TEST(CompoundExpressions) {
29,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), //
U8(1), //
U8(1), //
B(PushContext), R(0), //
B(LdaSmi8), U8(1), //
B(StaContextSlot), R(0), U8(first_context_slot), //
......@@ -5319,9 +5332,10 @@ TEST(ForIn) {
"}",
8 * kPointerSize,
1,
91,
93,
{
B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(1), //
B(Star), R(0), //
B(CreateArrayLiteral), U8(1), U8(1), U8(simple_flags), //
B(JumpIfUndefined), U8(79), //
......
......@@ -755,7 +755,6 @@
'arguments-load-across-eval': [SKIP],
'arguments-read-and-assignment': [SKIP],
'array-bounds-check-removal': [SKIP],
'array-elements-from-array-prototype-chain': [SKIP],
'array-functions-prototype-misc': [SKIP],
'array-join': [SKIP],
'array-literal-feedback': [SKIP],
......@@ -855,7 +854,6 @@
'regress/regress-133211b': [SKIP],
'regress/regress-1365': [SKIP],
'regress/regress-1369': [SKIP],
'regress/regress-1403': [SKIP],
'regress/regress-1412': [SKIP],
'regress/regress-1436': [SKIP],
'regress/regress-1493017': [SKIP],
......@@ -947,7 +945,6 @@
'regress/regress-568765': [SKIP],
'regress/regress-572589': [SKIP],
'regress/regress-580': [SKIP],
'regress/regress-618': [SKIP],
'regress/regress-69': [SKIP],
'regress/regress-70066': [SKIP],
'regress/regress-747': [SKIP],
......@@ -1047,7 +1044,6 @@
'regress/regress-transcendental': [SKIP],
'regress/regress-typedarray-length': [SKIP],
'regress/splice-missing-wb': [SKIP],
'setter-on-constructor-prototype': [SKIP],
'shift-for-integer-div': [SKIP],
'simple-constructor': [SKIP],
'sparse-array-reverse': [SKIP],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment