Revision: 14612
Author: [email protected]
Date: Fri May 10 02:47:05 2013
Log: Remove obsolete HObjectLiteral instruction.
[email protected]
Review URL: https://codereview.chromium.org/14972008
http://code.google.com/p/v8/source/detail?r=14612
Modified:
/branches/bleeding_edge/src/arm/lithium-arm.cc
/branches/bleeding_edge/src/arm/lithium-arm.h
/branches/bleeding_edge/src/arm/lithium-codegen-arm.cc
/branches/bleeding_edge/src/hydrogen-instructions.cc
/branches/bleeding_edge/src/hydrogen-instructions.h
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc
/branches/bleeding_edge/src/ia32/lithium-ia32.cc
/branches/bleeding_edge/src/ia32/lithium-ia32.h
/branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
/branches/bleeding_edge/src/mips/lithium-mips.cc
/branches/bleeding_edge/src/mips/lithium-mips.h
/branches/bleeding_edge/src/x64/lithium-codegen-x64.cc
/branches/bleeding_edge/src/x64/lithium-x64.cc
/branches/bleeding_edge/src/x64/lithium-x64.h
=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.cc Wed May 8 08:02:08 2013
+++ /branches/bleeding_edge/src/arm/lithium-arm.cc Fri May 10 02:47:05 2013
@@ -2401,11 +2401,6 @@
LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) {
return MarkAsCall(DefineFixed(new(zone()) LArrayLiteral, r0), instr);
}
-
-
-LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) {
- return MarkAsCall(DefineFixed(new(zone()) LObjectLiteral, r0), instr);
-}
LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) {
=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.h Fri May 3 05:21:16 2013
+++ /branches/bleeding_edge/src/arm/lithium-arm.h Fri May 10 02:47:05 2013
@@ -152,7 +152,6 @@
V(NumberTagI) \
V(NumberTagU) \
V(NumberUntagD) \
- V(ObjectLiteral) \
V(OsrEntry) \
V(OuterContext) \
V(Parameter) \
@@ -2469,13 +2468,6 @@
};
-class LObjectLiteral: public LTemplateInstruction<1, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal")
- DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral)
-};
-
-
class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> {
public:
DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Wed May 8
09:48:27 2013
+++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Fri May 10
02:47:05 2013
@@ -5531,37 +5531,6 @@
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
}
}
-
-
-void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) {
- Handle<FixedArray> literals = instr->hydrogen()->literals();
- Handle<FixedArray> constant_properties =
- instr->hydrogen()->constant_properties();
-
- // Set up the parameters to the stub/runtime call.
- __ LoadHeapObject(r3, literals);
- __ mov(r2, Operand(Smi::FromInt(instr->hydrogen()->literal_index())));
- __ mov(r1, Operand(constant_properties));
- int flags = instr->hydrogen()->fast_elements()
- ? ObjectLiteral::kFastElements
- : ObjectLiteral::kNoFlags;
- __ mov(r0, Operand(Smi::FromInt(flags)));
-
- // Pick the right runtime function or stub to call.
- int properties_count = instr->hydrogen()->constant_properties_length() /
2;
- if ((FLAG_track_double_fields && instr->hydrogen()->may_store_doubles())
||
- instr->hydrogen()->depth() > 1) {
- __ Push(r3, r2, r1, r0);
- CallRuntime(Runtime::kCreateObjectLiteral, 4, instr);
- } else if (flags != ObjectLiteral::kFastElements ||
- properties_count >
FastCloneShallowObjectStub::kMaximumClonedProperties) {
- __ Push(r3, r2, r1, r0);
- CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr);
- } else {
- FastCloneShallowObjectStub stub(properties_count);
- CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
- }
-}
void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Wed May 8
08:02:08 2013
+++ /branches/bleeding_edge/src/hydrogen-instructions.cc Fri May 10
02:47:05 2013
@@ -3011,11 +3011,6 @@
HType HArrayLiteral::CalculateInferredType() {
return HType::JSArray();
}
-
-
-HType HObjectLiteral::CalculateInferredType() {
- return HType::JSObject();
-}
HType HRegExpLiteral::CalculateInferredType() {
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Wed May 8 09:48:27
2013
+++ /branches/bleeding_edge/src/hydrogen-instructions.h Fri May 10 02:47:05
2013
@@ -150,7 +150,6 @@
V(Mod) \
V(Mul) \
V(NumericConstraint) \
- V(ObjectLiteral) \
V(OsrEntry) \
V(OuterContext) \
V(Parameter) \
@@ -6131,56 +6130,6 @@
};
-class HObjectLiteral: public HMaterializedLiteral<1> {
- public:
- HObjectLiteral(HValue* context,
- Handle<FixedArray> constant_properties,
- Handle<FixedArray> literals,
- bool fast_elements,
- int literal_index,
- int depth,
- bool may_store_doubles,
- bool has_function)
- : HMaterializedLiteral<1>(literal_index, depth),
- constant_properties_(constant_properties),
- constant_properties_length_(constant_properties->length()),
- literals_(literals),
- fast_elements_(fast_elements),
- may_store_doubles_(may_store_doubles),
- has_function_(has_function) {
- SetOperandAt(0, context);
- SetGVNFlag(kChangesNewSpacePromotion);
- }
-
- HValue* context() { return OperandAt(0); }
- Handle<FixedArray> constant_properties() const {
- return constant_properties_;
- }
- int constant_properties_length() const {
- return constant_properties_length_;
- }
- Handle<FixedArray> literals() const { return literals_; }
- bool fast_elements() const { return fast_elements_; }
- bool may_store_doubles() const { return may_store_doubles_; }
- bool has_function() const { return has_function_; }
-
- virtual Representation RequiredInputRepresentation(int index) {
- return Representation::Tagged();
- }
- virtual HType CalculateInferredType();
-
- DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral)
-
- private:
- Handle<FixedArray> constant_properties_;
- int constant_properties_length_;
- Handle<FixedArray> literals_;
- bool fast_elements_ : 1;
- bool may_store_doubles_ : 1;
- bool has_function_ : 1;
-};
-
-
class HRegExpLiteral: public HMaterializedLiteral<1> {
public:
HRegExpLiteral(HValue* context,
@@ -6301,8 +6250,13 @@
explicit HToFastProperties(HValue* value) : HUnaryOperation(value) {
// This instruction is not marked as having side effects, but
// changes the map of the input operand. Use it only when creating
- // object literals.
- ASSERT(value->IsObjectLiteral());
+ // object literals via a runtime call.
+ ASSERT(value->IsCallRuntime());
+#ifdef DEBUG
+ const Runtime::Function* function =
HCallRuntime::cast(value)->function();
+ ASSERT(function->function_id == Runtime::kCreateObjectLiteral ||
+ function->function_id == Runtime::kCreateObjectLiteralShallow);
+#endif
set_representation(Representation::Tagged());
}
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Fri May 10 02:31:28 2013
+++ /branches/bleeding_edge/src/hydrogen.cc Fri May 10 02:47:05 2013
@@ -6766,16 +6766,32 @@
pointer_size,
DONT_TRACK_ALLOCATION_SITE);
} else {
+ NoObservableSideEffectsScope no_effects(this);
Handle<FixedArray> closure_literals(closure->literals(), isolate());
+ Handle<FixedArray> constant_properties = expr->constant_properties();
+ int literal_index = expr->literal_index();
+ int flags = expr->fast_elements()
+ ? ObjectLiteral::kFastElements : ObjectLiteral::kNoFlags;
+ flags |= expr->has_function()
+ ? ObjectLiteral::kHasFunction : ObjectLiteral::kNoFlags;
+
+ AddInstruction(new(zone()) HPushArgument(AddInstruction(
+ new(zone()) HConstant(closure_literals,
Representation::Tagged()))));
+ AddInstruction(new(zone()) HPushArgument(AddInstruction(
+ new(zone()) HConstant(literal_index, Representation::Tagged()))));
+ AddInstruction(new(zone()) HPushArgument(AddInstruction(
+ new(zone()) HConstant(constant_properties,
Representation::Tagged()))));
+ AddInstruction(new(zone()) HPushArgument(AddInstruction(
+ new(zone()) HConstant(flags, Representation::Tagged()))));
+
+ Runtime::FunctionId function_id =
+ (expr->depth() > 1 || expr->may_store_doubles())
+ ? Runtime::kCreateObjectLiteral :
Runtime::kCreateObjectLiteralShallow;
literal = AddInstruction(
- new(zone()) HObjectLiteral(context,
- expr->constant_properties(),
- closure_literals,
- expr->fast_elements(),
- expr->literal_index(),
- expr->depth(),
- expr->may_store_doubles(),
- expr->has_function()));
+ new(zone()) HCallRuntime(context,
+ isolate()->factory()->empty_string(),
+ Runtime::FunctionForId(function_id),
+ 4));
}
// The object is expected in the bailout environment during computation
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Wed May 8
09:48:27 2013
+++ /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Fri May 10
02:47:05 2013
@@ -6128,47 +6128,6 @@
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
}
}
-
-
-void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) {
- ASSERT(ToRegister(instr->context()).is(esi));
- Handle<FixedArray> literals = instr->hydrogen()->literals();
- Handle<FixedArray> constant_properties =
- instr->hydrogen()->constant_properties();
-
- int flags = instr->hydrogen()->fast_elements()
- ? ObjectLiteral::kFastElements
- : ObjectLiteral::kNoFlags;
- flags |= instr->hydrogen()->has_function()
- ? ObjectLiteral::kHasFunction
- : ObjectLiteral::kNoFlags;
-
- // Set up the parameters to the stub/runtime call and pick the right
- // runtime function or stub to call.
- int properties_count = instr->hydrogen()->constant_properties_length() /
2;
- if ((FLAG_track_double_fields && instr->hydrogen()->may_store_doubles())
||
- instr->hydrogen()->depth() > 1) {
- __ PushHeapObject(literals);
- __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
- __ push(Immediate(constant_properties));
- __ push(Immediate(Smi::FromInt(flags)));
- CallRuntime(Runtime::kCreateObjectLiteral, 4, instr);
- } else if (flags != ObjectLiteral::kFastElements ||
- properties_count >
FastCloneShallowObjectStub::kMaximumClonedProperties) {
- __ PushHeapObject(literals);
- __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
- __ push(Immediate(constant_properties));
- __ push(Immediate(Smi::FromInt(flags)));
- CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr);
- } else {
- __ LoadHeapObject(eax, literals);
- __ mov(ebx,
Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
- __ mov(ecx, Immediate(constant_properties));
- __ mov(edx, Immediate(Smi::FromInt(flags)));
- FastCloneShallowObjectStub stub(properties_count);
- CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
- }
-}
void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.cc Wed May 8 08:02:08
2013
+++ /branches/bleeding_edge/src/ia32/lithium-ia32.cc Fri May 10 02:47:05
2013
@@ -2535,13 +2535,6 @@
return MarkAsCall(
DefineFixed(new(zone()) LArrayLiteral(context), eax), instr);
}
-
-
-LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) {
- LOperand* context = UseFixed(instr->context(), esi);
- return MarkAsCall(
- DefineFixed(new(zone()) LObjectLiteral(context), eax), instr);
-}
LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) {
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.h Wed May 8 08:02:08 2013
+++ /branches/bleeding_edge/src/ia32/lithium-ia32.h Fri May 10 02:47:05 2013
@@ -145,7 +145,6 @@
V(NumberTagI) \
V(NumberTagU) \
V(NumberUntagD) \
- V(ObjectLiteral) \
V(OsrEntry) \
V(OuterContext) \
V(Parameter) \
@@ -2578,19 +2577,6 @@
};
-class LObjectLiteral: public LTemplateInstruction<1, 1, 0> {
- public:
- explicit LObjectLiteral(LOperand* context) {
- inputs_[0] = context;
- }
-
- LOperand* context() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal")
- DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral)
-};
-
-
class LRegExpLiteral: public LTemplateInstruction<1, 1, 0> {
public:
explicit LRegExpLiteral(LOperand* context) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed May 8
15:15:27 2013
+++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Fri May 10
02:47:05 2013
@@ -5235,38 +5235,6 @@
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
}
}
-
-
-void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) {
- ASSERT(ToRegister(instr->result()).is(v0));
- Handle<FixedArray> literals = instr->hydrogen()->literals();
- Handle<FixedArray> constant_properties =
- instr->hydrogen()->constant_properties();
-
- // Set up the parameters to the stub/runtime call.
- __ LoadHeapObject(a3, literals);
- __ li(a2, Operand(Smi::FromInt(instr->hydrogen()->literal_index())));
- __ li(a1, Operand(constant_properties));
- int flags = instr->hydrogen()->fast_elements()
- ? ObjectLiteral::kFastElements
- : ObjectLiteral::kNoFlags;
- __ li(a0, Operand(Smi::FromInt(flags)));
-
- // Pick the right runtime function or stub to call.
- int properties_count = instr->hydrogen()->constant_properties_length() /
2;
- if ((FLAG_track_double_fields && instr->hydrogen()->may_store_doubles())
||
- instr->hydrogen()->depth() > 1) {
- __ Push(a3, a2, a1, a0);
- CallRuntime(Runtime::kCreateObjectLiteral, 4, instr);
- } else if (flags != ObjectLiteral::kFastElements ||
- properties_count >
FastCloneShallowObjectStub::kMaximumClonedProperties) {
- __ Push(a3, a2, a1, a0);
- CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr);
- } else {
- FastCloneShallowObjectStub stub(properties_count);
- CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
- }
-}
void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Wed May 8 15:15:27
2013
+++ /branches/bleeding_edge/src/mips/lithium-mips.cc Fri May 10 02:47:05
2013
@@ -2276,11 +2276,6 @@
LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) {
return MarkAsCall(DefineFixed(new(zone()) LArrayLiteral, v0), instr);
}
-
-
-LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) {
- return MarkAsCall(DefineFixed(new(zone()) LObjectLiteral, v0), instr);
-}
LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.h Fri May 3 05:21:16 2013
+++ /branches/bleeding_edge/src/mips/lithium-mips.h Fri May 10 02:47:05 2013
@@ -150,7 +150,6 @@
V(NumberTagI) \
V(NumberTagU) \
V(NumberUntagD) \
- V(ObjectLiteral) \
V(OsrEntry) \
V(OuterContext) \
V(Parameter) \
@@ -2410,13 +2409,6 @@
};
-class LObjectLiteral: public LTemplateInstruction<1, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal")
- DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral)
-};
-
-
class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> {
public:
DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Wed May 8
09:48:27 2013
+++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Fri May 10
02:47:05 2013
@@ -5210,46 +5210,6 @@
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
}
}
-
-
-void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) {
- Handle<FixedArray> literals = instr->hydrogen()->literals();
- Handle<FixedArray> constant_properties =
- instr->hydrogen()->constant_properties();
-
- int flags = instr->hydrogen()->fast_elements()
- ? ObjectLiteral::kFastElements
- : ObjectLiteral::kNoFlags;
- flags |= instr->hydrogen()->has_function()
- ? ObjectLiteral::kHasFunction
- : ObjectLiteral::kNoFlags;
-
- // Set up the parameters to the stub/runtime call and pick the right
- // runtime function or stub to call.
- int properties_count = instr->hydrogen()->constant_properties_length() /
2;
- if ((FLAG_track_double_fields && instr->hydrogen()->may_store_doubles())
||
- instr->hydrogen()->depth() > 1) {
- __ PushHeapObject(literals);
- __ Push(Smi::FromInt(instr->hydrogen()->literal_index()));
- __ Push(constant_properties);
- __ Push(Smi::FromInt(flags));
- CallRuntime(Runtime::kCreateObjectLiteral, 4, instr);
- } else if (flags != ObjectLiteral::kFastElements ||
- properties_count >
FastCloneShallowObjectStub::kMaximumClonedProperties) {
- __ PushHeapObject(literals);
- __ Push(Smi::FromInt(instr->hydrogen()->literal_index()));
- __ Push(constant_properties);
- __ Push(Smi::FromInt(flags));
- CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr);
- } else {
- __ LoadHeapObject(rax, literals);
- __ Move(rbx, Smi::FromInt(instr->hydrogen()->literal_index()));
- __ Move(rcx, constant_properties);
- __ Move(rdx, Smi::FromInt(flags));
- FastCloneShallowObjectStub stub(properties_count);
- CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
- }
-}
void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.cc Wed May 8 08:02:08 2013
+++ /branches/bleeding_edge/src/x64/lithium-x64.cc Fri May 10 02:47:05 2013
@@ -2338,11 +2338,6 @@
LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) {
return MarkAsCall(DefineFixed(new(zone()) LArrayLiteral, rax), instr);
}
-
-
-LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) {
- return MarkAsCall(DefineFixed(new(zone()) LObjectLiteral, rax), instr);
-}
LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) {
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.h Wed May 8 08:02:08 2013
+++ /branches/bleeding_edge/src/x64/lithium-x64.h Fri May 10 02:47:05 2013
@@ -150,7 +150,6 @@
V(NumberTagI) \
V(NumberTagU) \
V(NumberUntagD) \
- V(ObjectLiteral) \
V(OsrEntry) \
V(OuterContext) \
V(Parameter) \
@@ -2379,13 +2378,6 @@
};
-class LObjectLiteral: public LTemplateInstruction<1, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal")
- DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral)
-};
-
-
class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> {
public:
DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.