Commit 6c9ef895 authored by klaasb's avatar klaasb Committed by Commit bot

[interpreter] Add register output to ObjectLiteral

Avoids the always generated Star bytecodes after ObjectLiteral.

BUG=v4:4820
LOG=n

Review-Url: https://codereview.chromium.org/2216023003
Cr-Commit-Position: refs/heads/master@{#38480}
parent b5f4de91
......@@ -979,6 +979,7 @@ void BytecodeGraphBuilder::VisitCreateArrayLiteral() {
}
void BytecodeGraphBuilder::VisitCreateObjectLiteral() {
FrameStateBeforeAndAfter states(this);
Handle<FixedArray> constant_properties = Handle<FixedArray>::cast(
bytecode_iterator().GetConstantForIndexOperand(0));
int literal_index = bytecode_iterator().GetIndexOperand(1);
......@@ -987,9 +988,12 @@ void BytecodeGraphBuilder::VisitCreateObjectLiteral() {
interpreter::CreateObjectLiteralFlags::FlagsBits::decode(bytecode_flags);
// TODO(mstarzinger): Thread through number of properties.
int number_of_properties = constant_properties->length() / 2;
const Operator* op = javascript()->CreateLiteralObject(
constant_properties, literal_flags, literal_index, number_of_properties);
BuildCreateLiteral(op);
Node* literal = NewNode(
javascript()->CreateLiteralObject(constant_properties, literal_flags,
literal_index, number_of_properties),
GetFunctionClosure());
environment()->BindRegister(bytecode_iterator().GetRegisterOperand(3),
literal, &states);
}
Node* BytecodeGraphBuilder::ProcessCallArguments(const Operator* call_op,
......
......@@ -372,11 +372,13 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral(
}
BytecodeArrayBuilder& BytecodeArrayBuilder::CreateObjectLiteral(
Handle<FixedArray> constant_properties, int literal_index, int flags) {
Handle<FixedArray> constant_properties, int literal_index, int flags,
Register output) {
size_t constant_properties_entry = GetConstantPoolEntry(constant_properties);
Output(Bytecode::kCreateObjectLiteral,
UnsignedOperand(constant_properties_entry),
UnsignedOperand(literal_index), UnsignedOperand(flags));
UnsignedOperand(literal_index), UnsignedOperand(flags),
RegisterOperand(output));
return *this;
}
......
......@@ -147,7 +147,8 @@ class BytecodeArrayBuilder final : public ZoneObject {
BytecodeArrayBuilder& CreateArrayLiteral(Handle<FixedArray> constant_elements,
int literal_index, int flags);
BytecodeArrayBuilder& CreateObjectLiteral(
Handle<FixedArray> constant_properties, int literal_index, int flags);
Handle<FixedArray> constant_properties, int literal_index, int flags,
Register output);
// Push the context in accumulator as the new context, and store in register
// |context|.
......
......@@ -1614,13 +1614,11 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
FastCloneShallowObjectStub::IsSupported(expr),
FastCloneShallowObjectStub::PropertiesCount(expr->properties_count()),
expr->ComputeFlags());
builder()->CreateObjectLiteral(expr->constant_properties(),
expr->literal_index(), flags);
// 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);
builder()->CreateObjectLiteral(expr->constant_properties(),
expr->literal_index(), flags, literal);
// Store computed values into the literal.
int property_index = 0;
......
......@@ -226,8 +226,8 @@ namespace interpreter {
OperandType::kIdx, OperandType::kFlag8) \
V(CreateArrayLiteral, AccumulatorUse::kWrite, OperandType::kIdx, \
OperandType::kIdx, OperandType::kFlag8) \
V(CreateObjectLiteral, AccumulatorUse::kWrite, OperandType::kIdx, \
OperandType::kIdx, OperandType::kFlag8) \
V(CreateObjectLiteral, AccumulatorUse::kNone, OperandType::kIdx, \
OperandType::kIdx, OperandType::kFlag8, OperandType::kRegOut) \
\
/* Closure allocation */ \
V(CreateClosure, AccumulatorUse::kWrite, OperandType::kIdx, \
......
......@@ -1666,7 +1666,7 @@ void Interpreter::DoCreateObjectLiteral(InterpreterAssembler* assembler) {
Node* result = FastCloneShallowObjectStub::GenerateFastPath(
assembler, &if_not_fast_clone, closure, literal_index,
fast_clone_properties_count);
__ SetAccumulator(result);
__ StoreRegister(result, __ BytecodeOperandReg(3));
__ Dispatch();
}
......@@ -1686,7 +1686,7 @@ void Interpreter::DoCreateObjectLiteral(InterpreterAssembler* assembler) {
Node* result =
__ CallRuntime(Runtime::kCreateObjectLiteral, context, closure,
literal_index, constant_elements, flags);
__ SetAccumulator(result);
__ StoreRegister(result, __ BytecodeOperandReg(3));
// TODO(klaasb) build a single dispatch once the call is inlined
__ Dispatch();
}
......
......@@ -61,9 +61,8 @@ parameter count: 1
bytecode array length: 25
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
B(Star), R(0),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
B(Mov), R(1), R(0),
/* 54 S> */ B(LdrNamedProperty), R(0), U8(1), U8(1), R(2),
B(LdaSmi), U8(2),
B(Mul), R(2), U8(3),
......@@ -87,9 +86,8 @@ parameter count: 1
bytecode array length: 28
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
B(Star), R(0),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
B(Mov), R(1), R(0),
/* 52 S> */ B(LdaSmi), U8(1),
B(Star), R(2),
B(LdrKeyedProperty), R(0), U8(1), R(3),
......
......@@ -100,9 +100,8 @@ parameter count: 1
bytecode array length: 24
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
B(Star), R(0),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
B(Mov), R(1), R(0),
/* 54 S> */ B(LdaNamedProperty), R(0), U8(1), U8(1),
B(ToNumber), R(2),
B(Inc), U8(5),
......@@ -126,9 +125,8 @@ parameter count: 1
bytecode array length: 20
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
B(Star), R(0),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
B(Mov), R(1), R(0),
/* 54 S> */ B(LdaNamedProperty), R(0), U8(1), U8(1),
B(Dec), U8(5),
/* 65 E> */ B(StaNamedPropertySloppy), R(0), U8(1), U8(3),
......@@ -152,9 +150,8 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 45 S> */ B(LdaConstant), U8(0),
B(Star), R(0),
/* 60 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(1),
B(Star), R(2),
B(Star), R(1),
/* 60 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(1), R(2),
B(Mov), R(2), R(1),
/* 72 S> */ B(Ldar), R(0),
/* 81 E> */ B(LdaKeyedProperty), R(1), U8(1),
B(ToNumber), R(4),
......@@ -181,9 +178,8 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 45 S> */ B(LdaConstant), U8(0),
B(Star), R(0),
/* 60 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(1),
B(Star), R(2),
B(Star), R(1),
/* 60 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(1), R(2),
B(Mov), R(2), R(1),
/* 72 S> */ B(Ldar), R(0),
/* 83 E> */ B(LdaKeyedProperty), R(1), U8(1),
B(Inc), U8(5),
......
......@@ -16,9 +16,8 @@ parameter count: 1
bytecode array length: 14
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
B(Star), R(0),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
B(Mov), R(1), R(0),
/* 56 S> */ B(LdaConstant), U8(1),
B(DeletePropertySloppy), R(0),
/* 75 S> */ B(Return),
......@@ -39,9 +38,8 @@ parameter count: 1
bytecode array length: 14
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 56 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
B(Star), R(0),
/* 56 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
B(Mov), R(1), R(0),
/* 70 S> */ B(LdaConstant), U8(1),
B(DeletePropertyStrict), R(0),
/* 89 S> */ B(Return),
......@@ -62,9 +60,8 @@ parameter count: 1
bytecode array length: 14
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
B(Star), R(0),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
B(Mov), R(1), R(0),
/* 56 S> */ B(LdaSmi), U8(2),
B(DeletePropertySloppy), R(0),
/* 76 S> */ B(Return),
......@@ -103,13 +100,13 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 26
bytecode array length: 27
bytecodes: [
B(CreateFunctionContext), U8(1),
B(PushContext), R(0),
/* 30 E> */ B(StackCheck),
/* 56 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 56 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
B(Ldar), R(1),
/* 56 E> */ B(StaContextSlot), R(context), U8(4),
/* 64 S> */ B(CreateClosure), U8(1), U8(2),
/* 93 S> */ B(LdrContextSlot), R(context), U8(4), R(1),
......
......@@ -152,9 +152,8 @@ parameter count: 1
bytecode array length: 80
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
B(Star), R(0),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
B(Mov), R(1), R(0),
/* 77 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(3),
B(JumpIfUndefined), U8(65),
B(JumpIfNull), U8(63),
......
......@@ -456,9 +456,8 @@ parameter count: 1
bytecode array length: 309
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(8),
B(Star), R(6),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(8),
B(Mov), R(8), R(6),
B(LdaZero),
B(Star), R(2),
B(Mov), R(context), R(10),
......
......@@ -13,11 +13,11 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 8
bytecode array length: 9
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(35),
B(Star), R(0),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(35), R(0),
B(Ldar), R(0),
/* 46 S> */ B(Return),
]
constant pool: [
......@@ -32,11 +32,11 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 8
bytecode array length: 9
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(0),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(0),
B(Ldar), R(0),
/* 71 S> */ B(Return),
]
constant pool: [
......@@ -51,14 +51,12 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 20
bytecode array length: 17
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
B(Star), R(0),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
B(Ldar), R(0),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
/* 75 E> */ B(StaNamedPropertySloppy), R(1), U8(1), U8(1),
B(Ldar), R(1),
/* 80 S> */ B(Return),
......@@ -76,13 +74,12 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 21
bytecode array length: 20
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
B(Star), R(0),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
/* 67 E> */ B(AddSmi), U8(1), R(0),
B(StaNamedPropertySloppy), R(1), U8(1), U8(2),
B(Ldar), R(1),
......@@ -101,11 +98,10 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 17
bytecode array length: 16
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(0),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(0),
B(CreateClosure), U8(1), U8(2),
B(StaNamedPropertySloppy), R(0), U8(2), U8(1),
B(Ldar), R(0),
......@@ -125,11 +121,10 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 17
bytecode array length: 16
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(0),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(0),
B(CreateClosure), U8(1), U8(2),
B(StaNamedPropertySloppy), R(0), U8(2), U8(1),
B(Ldar), R(0),
......@@ -149,11 +144,10 @@ snippet: "
"
frame size: 6
parameter count: 1
bytecode array length: 33
bytecode array length: 32
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(0),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(0),
B(LdaConstant), U8(1),
B(Star), R(2),
B(CreateClosure), U8(2), U8(2),
......@@ -181,11 +175,10 @@ snippet: "
"
frame size: 6
parameter count: 1
bytecode array length: 35
bytecode array length: 34
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(0),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(0),
B(LdaConstant), U8(1),
B(Star), R(2),
B(CreateClosure), U8(2), U8(2),
......@@ -214,11 +207,10 @@ snippet: "
"
frame size: 6
parameter count: 1
bytecode array length: 33
bytecode array length: 32
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(0),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(0),
B(LdaConstant), U8(1),
B(Star), R(2),
B(LdaNull),
......@@ -246,13 +238,12 @@ snippet: "
"
frame size: 6
parameter count: 1
bytecode array length: 32
bytecode array length: 31
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
B(Star), R(0),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
B(LdaSmi), U8(1),
B(Star), R(3),
B(LdaZero),
......@@ -275,11 +266,10 @@ snippet: "
"
frame size: 3
parameter count: 1
bytecode array length: 21
bytecode array length: 20
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(35),
B(Star), R(0),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(35), R(0),
B(LdaNull),
B(Star), R(2),
B(Mov), R(0), R(1),
......@@ -299,14 +289,12 @@ snippet: "
"
frame size: 7
parameter count: 1
bytecode array length: 36
bytecode array length: 33
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0),
B(Star), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(35),
B(Star), R(1),
B(Ldar), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(35), R(1),
/* 60 E> */ B(ToName), R(3),
B(LdaSmi), U8(1),
B(Star), R(4),
......@@ -332,14 +320,12 @@ snippet: "
"
frame size: 7
parameter count: 1
bytecode array length: 40
bytecode array length: 37
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0),
B(Star), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(1),
B(Star), R(1),
B(Ldar), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(1), R(1),
/* 64 E> */ B(StaNamedPropertySloppy), R(1), U8(2), U8(1),
/* 68 E> */ B(ToName), R(3),
B(LdaSmi), U8(1),
......@@ -367,14 +353,12 @@ snippet: "
"
frame size: 7
parameter count: 1
bytecode array length: 53
bytecode array length: 49
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0),
B(Star), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(1), U8(35),
B(Star), R(1),
B(Ldar), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(1), U8(35), R(1),
/* 60 E> */ B(ToName), R(3),
B(LdaSmi), U8(1),
B(Star), R(4),
......@@ -384,8 +368,7 @@ bytecodes: [
B(Star), R(6),
B(Mov), R(1), R(2),
B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(2), U8(5),
B(CreateObjectLiteral), U8(1), U8(0), U8(35),
B(Star), R(4),
B(CreateObjectLiteral), U8(1), U8(0), U8(35), R(4),
B(Mov), R(1), R(2),
B(Mov), R(4), R(3),
B(CallRuntime), U16(Runtime::kInternalSetPrototype), R(2), U8(2),
......@@ -405,14 +388,12 @@ snippet: "
"
frame size: 7
parameter count: 1
bytecode array length: 76
bytecode array length: 73
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0),
B(Star), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(35),
B(Star), R(1),
B(Ldar), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(35), R(1),
/* 60 E> */ B(ToName), R(3),
B(LdaConstant), U8(2),
B(Star), R(4),
......
......@@ -270,7 +270,7 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 1035
bytecode array length: 1037
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 41 S> */ B(LdaConstant), U8(0),
......@@ -785,8 +785,8 @@ bytecodes: [
B(Star), R(0),
/* 2591 S> */ B(LdaConstant), U8(255),
B(Star), R(0),
/* 2601 S> */ B(Wide), B(CreateObjectLiteral), U16(256), U16(0), U8(1),
B(Star), R(1),
/* 2601 S> */ B(Wide), B(CreateObjectLiteral), U16(256), U16(0), U8(1), R16(1),
B(Ldar), R(1),
/* 2638 S> */ B(Return),
]
constant pool: [
......
......@@ -14,7 +14,7 @@ snippet: "
"
frame size: 5
parameter count: 1
bytecode array length: 46
bytecode array length: 45
bytecodes: [
B(LdaConstant), U8(0),
B(Star), R(1),
......@@ -26,9 +26,8 @@ bytecodes: [
/* 8 S> */ B(LdaConstant), U8(1),
B(Star), R(1),
B(LdaZero),
B(CreateObjectLiteral), U8(2), U8(0), U8(1), R(4),
B(Star), R(2),
B(CreateObjectLiteral), U8(2), U8(0), U8(1),
B(Star), R(4),
B(CreateClosure), U8(3), U8(0),
B(StaNamedPropertySloppy), R(4), U8(4), U8(3),
B(Mov), R(4), R(3),
......
......@@ -13,11 +13,11 @@ snippet: "
"
frame size: 4
parameter count: 1
bytecode array length: 24
bytecode array length: 25
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
B(Ldar), R(1),
B(ToObject), R(2),
B(Mov), R(closure), R(3),
B(CallRuntime), U16(Runtime::kPushWithContext), R(2), U8(2),
......
......@@ -108,7 +108,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
// Emit literal creation operations.
builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0)
.CreateArrayLiteral(factory->NewFixedArray(1), 0, 0)
.CreateObjectLiteral(factory->NewFixedArray(1), 0, 0);
.CreateObjectLiteral(factory->NewFixedArray(1), 0, 0, reg);
// Call operations.
builder.Call(reg, other, 0, 1)
......@@ -333,7 +333,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("wide_literal"),
0, 0)
.CreateArrayLiteral(factory->NewFixedArray(2), 0, 0)
.CreateObjectLiteral(factory->NewFixedArray(2), 0, 0);
.CreateObjectLiteral(factory->NewFixedArray(2), 0, 0, reg);
// Longer jumps requiring ConstantWide operand
{
......
......@@ -46,10 +46,11 @@ TEST(BytecodeDecoder, DecodeBytecodeAndOperands) {
2,
3,
" Ldar a1"},
{{B(Wide), B(CreateObjectLiteral), U16(513), U16(1027), U8(165)},
7,
{{B(Wide), B(CreateObjectLiteral), U16(513), U16(1027), U8(165),
R16(137)},
9,
0,
"CreateObjectLiteral.Wide [513], [1027], #165"},
"CreateObjectLiteral.Wide [513], [1027], #165, r137"},
{{B(ExtraWide), B(JumpIfNull), U32(123456789)},
6,
0,
......
......@@ -88,7 +88,7 @@ TEST(OperandScaling, ScalableAndNonScalable) {
CHECK_EQ(Bytecodes::Size(Bytecode::kCallRuntime, operand_scale),
1 + 2 + 2 * scale);
CHECK_EQ(Bytecodes::Size(Bytecode::kCreateObjectLiteral, operand_scale),
1 + 2 * scale + 1);
1 + 2 * scale + 1 + 1 * scale);
CHECK_EQ(Bytecodes::Size(Bytecode::kTestIn, operand_scale), 1 + scale);
}
}
......
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