HIR refactoring.

Review URL: http://codereview.chromium.org/6538080

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6910 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 16cc5283
......@@ -346,7 +346,7 @@ void LAccessArgumentsAt::PrintDataTo(StringStream* stream) {
}
void LStoreNamed::PrintDataTo(StringStream* stream) {
void LStoreNamedField::PrintDataTo(StringStream* stream) {
object()->PrintTo(stream);
stream->Add(".");
stream->Add(*String::cast(*name())->ToCString());
......@@ -355,7 +355,25 @@ void LStoreNamed::PrintDataTo(StringStream* stream) {
}
void LStoreKeyed::PrintDataTo(StringStream* stream) {
void LStoreNamedGeneric::PrintDataTo(StringStream* stream) {
object()->PrintTo(stream);
stream->Add(".");
stream->Add(*String::cast(*name())->ToCString());
stream->Add(" <- ");
value()->PrintTo(stream);
}
void LStoreKeyedFastElement::PrintDataTo(StringStream* stream) {
object()->PrintTo(stream);
stream->Add("[");
key()->PrintTo(stream);
stream->Add("] <- ");
value()->PrintTo(stream);
}
void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) {
object()->PrintTo(stream);
stream->Add("[");
key()->PrintTo(stream);
......
......@@ -42,8 +42,6 @@ class LCodeGen;
#define LITHIUM_ALL_INSTRUCTION_LIST(V) \
V(ControlInstruction) \
V(Call) \
V(StoreKeyed) \
V(StoreNamed) \
LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
......@@ -1523,32 +1521,22 @@ class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
};
class LStoreNamed: public LTemplateInstruction<0, 2, 0> {
class LStoreNamedField: public LTemplateInstruction<0, 2, 0> {
public:
LStoreNamed(LOperand* obj, LOperand* val) {
LStoreNamedField(LOperand* obj, LOperand* val) {
inputs_[0] = obj;
inputs_[1] = val;
}
DECLARE_INSTRUCTION(StoreNamed)
DECLARE_HYDROGEN_ACCESSOR(StoreNamed)
DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
virtual void PrintDataTo(StringStream* stream);
LOperand* object() { return inputs_[0]; }
LOperand* value() { return inputs_[1]; }
Handle<Object> name() const { return hydrogen()->name(); }
};
class LStoreNamedField: public LStoreNamed {
public:
LStoreNamedField(LOperand* obj, LOperand* val)
: LStoreNamed(obj, val) { }
DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
Handle<Object> name() const { return hydrogen()->name(); }
bool is_in_object() { return hydrogen()->is_in_object(); }
int offset() { return hydrogen()->offset(); }
bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
......@@ -1556,25 +1544,35 @@ class LStoreNamedField: public LStoreNamed {
};
class LStoreNamedGeneric: public LStoreNamed {
class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> {
public:
LStoreNamedGeneric(LOperand* obj, LOperand* val)
: LStoreNamed(obj, val) { }
LStoreNamedGeneric(LOperand* obj, LOperand* val) {
inputs_[0] = obj;
inputs_[1] = val;
}
DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
virtual void PrintDataTo(StringStream* stream);
LOperand* object() { return inputs_[0]; }
LOperand* value() { return inputs_[1]; }
Handle<Object> name() const { return hydrogen()->name(); }
};
class LStoreKeyed: public LTemplateInstruction<0, 3, 0> {
class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
public:
LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) {
LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) {
inputs_[0] = obj;
inputs_[1] = key;
inputs_[2] = val;
}
DECLARE_INSTRUCTION(StoreKeyed)
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
"store-keyed-fast-element")
DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
virtual void PrintDataTo(StringStream* stream);
......@@ -1584,23 +1582,21 @@ class LStoreKeyed: public LTemplateInstruction<0, 3, 0> {
};
class LStoreKeyedFastElement: public LStoreKeyed {
class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> {
public:
LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val)
: LStoreKeyed(obj, key, val) {}
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
"store-keyed-fast-element")
DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
};
LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val) {
inputs_[0] = obj;
inputs_[1] = key;
inputs_[2] = val;
}
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
class LStoreKeyedGeneric: public LStoreKeyed {
public:
LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val)
: LStoreKeyed(obj, key, val) { }
virtual void PrintDataTo(StringStream* stream);
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
LOperand* object() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
LOperand* value() { return inputs_[2]; }
};
......
......@@ -284,33 +284,6 @@ void HValue::SetOperandAt(int index, HValue* value) {
}
void HLoadKeyedGeneric::InternalSetOperandAt(int index, HValue* value) {
if (index < 2) {
operands_[index] = value;
} else {
context_ = value;
}
}
void HStoreKeyedGeneric::InternalSetOperandAt(int index, HValue* value) {
if (index < 3) {
operands_[index] = value;
} else {
context_ = value;
}
}
void HStoreNamedGeneric::InternalSetOperandAt(int index, HValue* value) {
if (index < 2) {
operands_[index] = value;
} else {
context_ = value;
}
}
void HValue::ReplaceAndDelete(HValue* other) {
ReplaceValue(other);
Delete();
......@@ -564,15 +537,10 @@ void HInstruction::Verify() {
#endif
void HCall::PrintDataTo(StringStream* stream) {
stream->Add("#%d", argument_count());
}
void HUnaryCall::PrintDataTo(StringStream* stream) {
value()->PrintNameTo(stream);
stream->Add(" ");
HCall::PrintDataTo(stream);
stream->Add("#%d", argument_count());
}
......@@ -581,7 +549,7 @@ void HBinaryCall::PrintDataTo(StringStream* stream) {
stream->Add(" ");
second()->PrintNameTo(stream);
stream->Add(" ");
HCall::PrintDataTo(stream);
stream->Add("#%d", argument_count());
}
......@@ -591,7 +559,7 @@ void HCallConstantFunction::PrintDataTo(StringStream* stream) {
} else {
stream->Add("%o ", function()->shared()->DebugName());
}
HCall::PrintDataTo(stream);
stream->Add("#%d", argument_count());
}
......@@ -609,13 +577,13 @@ void HCallGlobal::PrintDataTo(StringStream* stream) {
void HCallKnownGlobal::PrintDataTo(StringStream* stream) {
stream->Add("o ", target()->shared()->DebugName());
HCall::PrintDataTo(stream);
stream->Add("#%d", argument_count());
}
void HCallRuntime::PrintDataTo(StringStream* stream) {
stream->Add("%o ", *name());
HCall::PrintDataTo(stream);
stream->Add("#%d", argument_count());
}
......@@ -1162,7 +1130,15 @@ void HLoadNamedField::PrintDataTo(StringStream* stream) {
}
void HLoadKeyed::PrintDataTo(StringStream* stream) {
void HLoadKeyedFastElement::PrintDataTo(StringStream* stream) {
object()->PrintNameTo(stream);
stream->Add("[");
key()->PrintNameTo(stream);
stream->Add("]");
}
void HLoadKeyedGeneric::PrintDataTo(StringStream* stream) {
object()->PrintNameTo(stream);
stream->Add("[");
key()->PrintNameTo(stream);
......@@ -1178,7 +1154,7 @@ void HLoadPixelArrayElement::PrintDataTo(StringStream* stream) {
}
void HStoreNamed::PrintDataTo(StringStream* stream) {
void HStoreNamedGeneric::PrintDataTo(StringStream* stream) {
object()->PrintNameTo(stream);
stream->Add(".");
ASSERT(name()->IsString());
......@@ -1189,14 +1165,28 @@ void HStoreNamed::PrintDataTo(StringStream* stream) {
void HStoreNamedField::PrintDataTo(StringStream* stream) {
HStoreNamed::PrintDataTo(stream);
object()->PrintNameTo(stream);
stream->Add(".");
ASSERT(name()->IsString());
stream->Add(*String::cast(*name())->ToCString());
stream->Add(" = ");
value()->PrintNameTo(stream);
if (!transition().is_null()) {
stream->Add(" (transition map %p)", *transition());
}
}
void HStoreKeyed::PrintDataTo(StringStream* stream) {
void HStoreKeyedFastElement::PrintDataTo(StringStream* stream) {
object()->PrintNameTo(stream);
stream->Add("[");
key()->PrintNameTo(stream);
stream->Add("] = ");
value()->PrintNameTo(stream);
}
void HStoreKeyedGeneric::PrintDataTo(StringStream* stream) {
object()->PrintNameTo(stream);
stream->Add("[");
key()->PrintNameTo(stream);
......
This diff is collapsed.
......@@ -2258,7 +2258,8 @@ void HGraphBuilder::PushAndAdd(HInstruction* instr) {
}
void HGraphBuilder::PreProcessCall(HCall* call) {
template <int V>
HInstruction* HGraphBuilder::PreProcessCall(HCall<V>* call) {
int count = call->argument_count();
ZoneList<HValue*> arguments(count);
for (int i = 0; i < count; ++i) {
......@@ -2268,6 +2269,7 @@ void HGraphBuilder::PreProcessCall(HCall* call) {
while (!arguments.is_empty()) {
AddInstruction(new HPushArgument(arguments.RemoveLast()));
}
return call;
}
......@@ -3951,7 +3953,8 @@ void HGraphBuilder::HandlePolymorphicCallNamed(Call* expr,
// Check for bailout, as trying to inline might fail due to bailout
// during hydrogen processing.
CHECK_BAILOUT;
HCall* call = new HCallConstantFunction(expr->target(), argument_count);
HCallConstantFunction* call =
new HCallConstantFunction(expr->target(), argument_count);
call->set_position(expr->position());
PreProcessCall(call);
PushAndAdd(call);
......@@ -3968,7 +3971,7 @@ void HGraphBuilder::HandlePolymorphicCallNamed(Call* expr,
if (maps.length() == 0) {
HContext* context = new HContext;
AddInstruction(context);
HCall* call = new HCallNamed(context, name, argument_count);
HCallNamed* call = new HCallNamed(context, name, argument_count);
call->set_position(expr->position());
PreProcessCall(call);
ast_context()->ReturnInstruction(call, expr->id());
......@@ -3981,7 +3984,7 @@ void HGraphBuilder::HandlePolymorphicCallNamed(Call* expr,
} else {
HContext* context = new HContext;
AddInstruction(context);
HCall* call = new HCallNamed(context, name, argument_count);
HCallNamed* call = new HCallNamed(context, name, argument_count);
call->set_position(expr->position());
PreProcessCall(call);
PushAndAdd(call);
......@@ -4382,7 +4385,7 @@ static bool HasCustomCallGenerator(Handle<JSFunction> function) {
void HGraphBuilder::VisitCall(Call* expr) {
Expression* callee = expr->expression();
int argument_count = expr->arguments()->length() + 1; // Plus receiver.
HCall* call = NULL;
HInstruction* call = NULL;
Property* prop = callee->AsProperty();
if (prop != NULL) {
......@@ -4402,9 +4405,8 @@ void HGraphBuilder::VisitCall(Call* expr) {
HContext* context = new HContext;
AddInstruction(context);
call = new HCallKeyed(context, key, argument_count);
call = PreProcessCall(new HCallKeyed(context, key, argument_count));
call->set_position(expr->position());
PreProcessCall(call);
Drop(1); // Key.
ast_context()->ReturnInstruction(call, expr->id());
return;
......@@ -4444,7 +4446,7 @@ void HGraphBuilder::VisitCall(Call* expr) {
// IC when a primitive receiver check is required.
HContext* context = new HContext;
AddInstruction(context);
call = new HCallNamed(context, name, argument_count);
call = PreProcessCall(new HCallNamed(context, name, argument_count));
} else {
AddCheckConstantFunction(expr, receiver, receiver_map, true);
......@@ -4464,7 +4466,8 @@ void HGraphBuilder::VisitCall(Call* expr) {
// Check for bailout, as the TryInline call in the if condition above
// might return false due to bailout during hydrogen processing.
CHECK_BAILOUT;
call = new HCallConstantFunction(expr->target(), argument_count);
call = PreProcessCall(new HCallConstantFunction(expr->target(),
argument_count));
}
}
} else if (types != NULL && types->length() > 1) {
......@@ -4475,7 +4478,7 @@ void HGraphBuilder::VisitCall(Call* expr) {
} else {
HContext* context = new HContext;
AddInstruction(context);
call = new HCallNamed(context, name, argument_count);
call = PreProcessCall(new HCallNamed(context, name, argument_count));
}
} else {
......@@ -4536,7 +4539,8 @@ void HGraphBuilder::VisitCall(Call* expr) {
// during hydrogen processing.
CHECK_BAILOUT;
call = new HCallKnownGlobal(expr->target(), argument_count);
call = PreProcessCall(new HCallKnownGlobal(expr->target(),
argument_count));
} else {
HContext* context = new HContext;
AddInstruction(context);
......@@ -4544,7 +4548,9 @@ void HGraphBuilder::VisitCall(Call* expr) {
VisitExpressions(expr->arguments());
CHECK_BAILOUT;
call = new HCallGlobal(context, var->name(), argument_count);
call = PreProcessCall(new HCallGlobal(context,
var->name(),
argument_count));
}
} else {
......@@ -4556,12 +4562,11 @@ void HGraphBuilder::VisitCall(Call* expr) {
VisitExpressions(expr->arguments());
CHECK_BAILOUT;
call = new HCallFunction(context, argument_count);
call = PreProcessCall(new HCallFunction(context, argument_count));
}
}
call->set_position(expr->position());
PreProcessCall(call);
ast_context()->ReturnInstruction(call, expr->id());
}
......@@ -4580,7 +4585,7 @@ void HGraphBuilder::VisitCallNew(CallNew* expr) {
// to the construct call.
int arg_count = expr->arguments()->length() + 1; // Plus constructor.
HValue* constructor = environment()->ExpressionStackAt(arg_count - 1);
HCall* call = new HCallNew(context, constructor, arg_count);
HCallNew* call = new HCallNew(context, constructor, arg_count);
call->set_position(expr->position());
PreProcessCall(call);
ast_context()->ReturnInstruction(call, expr->id());
......@@ -4629,7 +4634,7 @@ void HGraphBuilder::VisitCallRuntime(CallRuntime* expr) {
Handle<String> name = expr->name();
int argument_count = expr->arguments()->length();
HCall* call = new HCallRuntime(name, function, argument_count);
HCallRuntime* call = new HCallRuntime(name, function, argument_count);
call->set_position(RelocInfo::kNoPosition);
Drop(argument_count);
ast_context()->ReturnInstruction(call, expr->id());
......
......@@ -729,7 +729,7 @@ class HGraphBuilder: public AstVisitor {
// Remove the arguments from the bailout environment and emit instructions
// to push them as outgoing parameters.
void PreProcessCall(HCall* call);
template <int V> HInstruction* PreProcessCall(HCall<V>* call);
void AssumeRepresentation(HValue* value, Representation r);
static Representation ToRepresentation(TypeInfo info);
......
......@@ -404,7 +404,7 @@ void LChunk::MarkEmptyBlocks() {
}
void LStoreNamed::PrintDataTo(StringStream* stream) {
void LStoreNamedField::PrintDataTo(StringStream* stream) {
object()->PrintTo(stream);
stream->Add(".");
stream->Add(*String::cast(*name())->ToCString());
......@@ -413,7 +413,25 @@ void LStoreNamed::PrintDataTo(StringStream* stream) {
}
void LStoreKeyed::PrintDataTo(StringStream* stream) {
void LStoreNamedGeneric::PrintDataTo(StringStream* stream) {
object()->PrintTo(stream);
stream->Add(".");
stream->Add(*String::cast(*name())->ToCString());
stream->Add(" <- ");
value()->PrintTo(stream);
}
void LStoreKeyedFastElement::PrintDataTo(StringStream* stream) {
object()->PrintTo(stream);
stream->Add("[");
key()->PrintTo(stream);
stream->Add("] <- ");
value()->PrintTo(stream);
}
void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) {
object()->PrintTo(stream);
stream->Add("[");
key()->PrintTo(stream);
......
......@@ -42,8 +42,6 @@ class LCodeGen;
#define LITHIUM_ALL_INSTRUCTION_LIST(V) \
V(ControlInstruction) \
V(Call) \
V(StoreKeyed) \
V(StoreNamed) \
LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
......@@ -1581,34 +1579,23 @@ class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
};
class LStoreNamed: public LTemplateInstruction<0, 2, 1> {
class LStoreNamedField: public LTemplateInstruction<0, 2, 1> {
public:
LStoreNamed(LOperand* obj, LOperand* val) {
LStoreNamedField(LOperand* obj, LOperand* val, LOperand* temp) {
inputs_[0] = obj;
inputs_[1] = val;
temps_[0] = temp;
}
DECLARE_INSTRUCTION(StoreNamed)
DECLARE_HYDROGEN_ACCESSOR(StoreNamed)
DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
virtual void PrintDataTo(StringStream* stream);
LOperand* object() { return inputs_[0]; }
LOperand* value() { return inputs_[1]; }
Handle<Object> name() const { return hydrogen()->name(); }
};
class LStoreNamedField: public LStoreNamed {
public:
LStoreNamedField(LOperand* obj, LOperand* val, LOperand* temp)
: LStoreNamed(obj, val) {
temps_[0] = temp;
}
DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
Handle<Object> name() const { return hydrogen()->name(); }
bool is_in_object() { return hydrogen()->is_in_object(); }
int offset() { return hydrogen()->offset(); }
bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
......@@ -1627,6 +1614,8 @@ class LStoreNamedGeneric: public LTemplateInstruction<0, 3, 0> {
DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
virtual void PrintDataTo(StringStream* stream);
LOperand* context() { return inputs_[0]; }
LOperand* object() { return inputs_[1]; }
LOperand* value() { return inputs_[2]; }
......@@ -1634,15 +1623,17 @@ class LStoreNamedGeneric: public LTemplateInstruction<0, 3, 0> {
};
class LStoreKeyed: public LTemplateInstruction<0, 3, 0> {
class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
public:
LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) {
LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) {
inputs_[0] = obj;
inputs_[1] = key;
inputs_[2] = val;
}
DECLARE_INSTRUCTION(StoreKeyed)
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
"store-keyed-fast-element")
DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
virtual void PrintDataTo(StringStream* stream);
......@@ -1652,17 +1643,6 @@ class LStoreKeyed: public LTemplateInstruction<0, 3, 0> {
};
class LStoreKeyedFastElement: public LStoreKeyed {
public:
LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val)
: LStoreKeyed(obj, key, val) {}
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
"store-keyed-fast-element")
DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
};
class LStorePixelArrayElement: public LTemplateInstruction<0, 3, 1> {
public:
LStorePixelArrayElement(LOperand* external_pointer,
......@@ -1699,6 +1679,8 @@ class LStoreKeyedGeneric: public LTemplateInstruction<0, 4, 0> {
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
virtual void PrintDataTo(StringStream* stream);
LOperand* context() { return inputs_[0]; }
LOperand* object() { return inputs_[1]; }
LOperand* key() { return inputs_[2]; }
......
......@@ -405,7 +405,7 @@ void LChunk::MarkEmptyBlocks() {
}
void LStoreNamed::PrintDataTo(StringStream* stream) {
void LStoreNamedField::PrintDataTo(StringStream* stream) {
object()->PrintTo(stream);
stream->Add(".");
stream->Add(*String::cast(*name())->ToCString());
......@@ -414,7 +414,25 @@ void LStoreNamed::PrintDataTo(StringStream* stream) {
}
void LStoreKeyed::PrintDataTo(StringStream* stream) {
void LStoreNamedGeneric::PrintDataTo(StringStream* stream) {
object()->PrintTo(stream);
stream->Add(".");
stream->Add(*String::cast(*name())->ToCString());
stream->Add(" <- ");
value()->PrintTo(stream);
}
void LStoreKeyedFastElement::PrintDataTo(StringStream* stream) {
object()->PrintTo(stream);
stream->Add("[");
key()->PrintTo(stream);
stream->Add("] <- ");
value()->PrintTo(stream);
}
void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) {
object()->PrintTo(stream);
stream->Add("[");
key()->PrintTo(stream);
......
......@@ -42,8 +42,6 @@ class LCodeGen;
#define LITHIUM_ALL_INSTRUCTION_LIST(V) \
V(ControlInstruction) \
V(Call) \
V(StoreKeyed) \
V(StoreNamed) \
LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
......@@ -1491,34 +1489,23 @@ class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
};
class LStoreNamed: public LTemplateInstruction<0, 2, 1> {
class LStoreNamedField: public LTemplateInstruction<0, 2, 1> {
public:
LStoreNamed(LOperand* object, LOperand* value) {
LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) {
inputs_[0] = object;
inputs_[1] = value;
temps_[0] = temp;
}
DECLARE_INSTRUCTION(StoreNamed)
DECLARE_HYDROGEN_ACCESSOR(StoreNamed)
DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
virtual void PrintDataTo(StringStream* stream);
LOperand* object() { return inputs_[0]; }
LOperand* value() { return inputs_[1]; }
Handle<Object> name() const { return hydrogen()->name(); }
};
class LStoreNamedField: public LStoreNamed {
public:
LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp)
: LStoreNamed(object, value) {
temps_[0] = temp;
}
DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
Handle<Object> name() const { return hydrogen()->name(); }
bool is_in_object() { return hydrogen()->is_in_object(); }
int offset() { return hydrogen()->offset(); }
bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
......@@ -1526,25 +1513,35 @@ class LStoreNamedField: public LStoreNamed {
};
class LStoreNamedGeneric: public LStoreNamed {
class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> {
public:
LStoreNamedGeneric(LOperand* object, LOperand* value)
: LStoreNamed(object, value) { }
LStoreNamedGeneric(LOperand* object, LOperand* value) {
inputs_[0] = object;
inputs_[1] = value;
}
DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
virtual void PrintDataTo(StringStream* stream);
LOperand* object() { return inputs_[0]; }
LOperand* value() { return inputs_[1]; }
Handle<Object> name() const { return hydrogen()->name(); }
};
class LStoreKeyed: public LTemplateInstruction<0, 3, 0> {
class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
public:
LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) {
LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) {
inputs_[0] = obj;
inputs_[1] = key;
inputs_[2] = val;
}
DECLARE_INSTRUCTION(StoreKeyed)
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
"store-keyed-fast-element")
DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
virtual void PrintDataTo(StringStream* stream);
......@@ -1554,17 +1551,6 @@ class LStoreKeyed: public LTemplateInstruction<0, 3, 0> {
};
class LStoreKeyedFastElement: public LStoreKeyed {
public:
LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val)
: LStoreKeyed(obj, key, val) {}
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
"store-keyed-fast-element")
DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
};
class LStorePixelArrayElement: public LTemplateInstruction<0, 3, 0> {
public:
LStorePixelArrayElement(LOperand* external_pointer,
......@@ -1585,12 +1571,21 @@ class LStorePixelArrayElement: public LTemplateInstruction<0, 3, 0> {
};
class LStoreKeyedGeneric: public LStoreKeyed {
class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> {
public:
LStoreKeyedGeneric(LOperand* object, LOperand* key, LOperand* value)
: LStoreKeyed(object, key, value) { }
LStoreKeyedGeneric(LOperand* object, LOperand* key, LOperand* value) {
inputs_[0] = object;
inputs_[1] = key;
inputs_[2] = value;
}
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
virtual void PrintDataTo(StringStream* stream);
LOperand* object() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
LOperand* value() { return inputs_[2]; }
};
......
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