| Index: runtime/vm/intermediate_language_ia32.cc
|
| diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
|
| index 01a6034845323bcc7278d5e032ab7c134b63ae9c..de84c2d10a8774b3ce995adb5dfa35fc03cb9add 100644
|
| --- a/runtime/vm/intermediate_language_ia32.cc
|
| +++ b/runtime/vm/intermediate_language_ia32.cc
|
| @@ -24,21 +24,13 @@ DECLARE_FLAG(bool, trace_functions);
|
|
|
| // Generic summary for call instructions that have all arguments pushed
|
| // on the stack and return the result in a fixed register EAX.
|
| -LocationSummary* Computation::MakeCallSummary() {
|
| +LocationSummary* Instruction::MakeCallSummary() {
|
| LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall);
|
| result->set_out(Location::RegisterLocation(EAX));
|
| return result;
|
| }
|
|
|
|
|
| -void BindInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| - computation()->EmitNativeCode(compiler);
|
| - if (is_used() && !compiler->is_optimizing()) {
|
| - __ pushl(locs()->out().reg());
|
| - }
|
| -}
|
| -
|
| -
|
| LocationSummary* ReturnInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 1;
|
| @@ -118,7 +110,7 @@ void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* ClosureCallComp::MakeLocationSummary() const {
|
| +LocationSummary* ClosureCallInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 0;
|
| const intptr_t kNumTemps = 1;
|
| LocationSummary* result =
|
| @@ -129,27 +121,27 @@ LocationSummary* ClosureCallComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -LocationSummary* LoadLocalComp::MakeLocationSummary() const {
|
| +LocationSummary* LoadLocalInstr::MakeLocationSummary() const {
|
| return LocationSummary::Make(0,
|
| Location::RequiresRegister(),
|
| LocationSummary::kNoCall);
|
| }
|
|
|
|
|
| -void LoadLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register result = locs()->out().reg();
|
| __ movl(result, Address(EBP, local().index() * kWordSize));
|
| }
|
|
|
|
|
| -LocationSummary* StoreLocalComp::MakeLocationSummary() const {
|
| +LocationSummary* StoreLocalInstr::MakeLocationSummary() const {
|
| return LocationSummary::Make(1,
|
| Location::SameAsFirstInput(),
|
| LocationSummary::kNoCall);
|
| }
|
|
|
|
|
| -void StoreLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register value = locs()->in(0).reg();
|
| Register result = locs()->out().reg();
|
| ASSERT(result == value); // Assert that register assignment is correct.
|
| @@ -157,15 +149,15 @@ void StoreLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* ConstantComp::MakeLocationSummary() const {
|
| +LocationSummary* ConstantInstr::MakeLocationSummary() const {
|
| return LocationSummary::Make(0,
|
| Location::RequiresRegister(),
|
| LocationSummary::kNoCall);
|
| }
|
|
|
|
|
| -void ConstantComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| - // Register allocator drops constant definitions that have no uses.
|
| +void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| + // The register allocator drops constant definitions that have no uses.
|
| if (!locs()->out().IsInvalid()) {
|
| Register result = locs()->out().reg();
|
| __ LoadObject(result, value());
|
| @@ -173,7 +165,7 @@ void ConstantComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* AssertAssignableComp::MakeLocationSummary() const {
|
| +LocationSummary* AssertAssignableInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 3;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -186,7 +178,7 @@ LocationSummary* AssertAssignableComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -LocationSummary* AssertBooleanComp::MakeLocationSummary() const {
|
| +LocationSummary* AssertBooleanInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -197,7 +189,7 @@ LocationSummary* AssertBooleanComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void AssertBooleanComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void AssertBooleanInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register obj = locs()->in(0).reg();
|
| Register result = locs()->out().reg();
|
|
|
| @@ -222,7 +214,7 @@ void AssertBooleanComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* ArgumentDefinitionTestComp::MakeLocationSummary() const {
|
| +LocationSummary* ArgumentDefinitionTestInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -233,7 +225,7 @@ LocationSummary* ArgumentDefinitionTestComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void ArgumentDefinitionTestComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void ArgumentDefinitionTestInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register saved_args_desc = locs()->in(0).reg();
|
| Register result = locs()->out().reg();
|
|
|
| @@ -265,7 +257,7 @@ static Condition TokenKindToSmiCondition(Token::Kind kind) {
|
| }
|
|
|
|
|
| -LocationSummary* EqualityCompareComp::MakeLocationSummary() const {
|
| +LocationSummary* EqualityCompareInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 2;
|
| const bool is_checked_strict_equal =
|
| HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid);
|
| @@ -617,7 +609,7 @@ static void EmitDoubleComparisonOp(FlowGraphCompiler* compiler,
|
| }
|
|
|
|
|
| -void EqualityCompareComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void EqualityCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
|
| BranchInstr* kNoBranch = NULL;
|
| if (receiver_class_id() == kSmiCid) {
|
| @@ -650,8 +642,8 @@ void EqualityCompareComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -void EqualityCompareComp::EmitBranchCode(FlowGraphCompiler* compiler,
|
| - BranchInstr* branch) {
|
| +void EqualityCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler,
|
| + BranchInstr* branch) {
|
| ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
|
| if (receiver_class_id() == kSmiCid) {
|
| // Deoptimizes if both arguments not Smi.
|
| @@ -689,7 +681,7 @@ void EqualityCompareComp::EmitBranchCode(FlowGraphCompiler* compiler,
|
| }
|
|
|
|
|
| -LocationSummary* RelationalOpComp::MakeLocationSummary() const {
|
| +LocationSummary* RelationalOpInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 2;
|
| if (operands_class_id() == kDoubleCid) {
|
| const intptr_t kNumTemps = 0;
|
| @@ -720,7 +712,7 @@ LocationSummary* RelationalOpComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void RelationalOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void RelationalOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| if (operands_class_id() == kSmiCid) {
|
| EmitSmiComparisonOp(compiler, *locs(), kind(), NULL);
|
| return;
|
| @@ -776,8 +768,8 @@ void RelationalOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -void RelationalOpComp::EmitBranchCode(FlowGraphCompiler* compiler,
|
| - BranchInstr* branch) {
|
| +void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
|
| + BranchInstr* branch) {
|
| if (operands_class_id() == kSmiCid) {
|
| EmitSmiComparisonOp(compiler, *locs(), kind(), branch);
|
| return;
|
| @@ -792,7 +784,7 @@ void RelationalOpComp::EmitBranchCode(FlowGraphCompiler* compiler,
|
| }
|
|
|
|
|
| -LocationSummary* NativeCallComp::MakeLocationSummary() const {
|
| +LocationSummary* NativeCallInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 0;
|
| const intptr_t kNumTemps = 3;
|
| LocationSummary* locs =
|
| @@ -805,7 +797,7 @@ LocationSummary* NativeCallComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| ASSERT(locs()->temp(0).reg() == EAX);
|
| ASSERT(locs()->temp(1).reg() == ECX);
|
| ASSERT(locs()->temp(2).reg() == EDX);
|
| @@ -834,7 +826,7 @@ void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* LoadIndexedComp::MakeLocationSummary() const {
|
| +LocationSummary* LoadIndexedInstr::MakeLocationSummary() const {
|
| ASSERT((receiver_type() == kGrowableObjectArrayCid) ||
|
| (receiver_type() == kArrayCid) ||
|
| (receiver_type() == kImmutableArrayCid));
|
| @@ -852,7 +844,7 @@ LocationSummary* LoadIndexedComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void LoadIndexedComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register receiver = locs()->in(0).reg();
|
| Register index = locs()->in(1).reg();
|
| Register result = locs()->out().reg();
|
| @@ -881,7 +873,7 @@ void LoadIndexedComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* StoreIndexedComp::MakeLocationSummary() const {
|
| +LocationSummary* StoreIndexedInstr::MakeLocationSummary() const {
|
| ASSERT((receiver_type() == kGrowableObjectArrayCid) ||
|
| (receiver_type() == kArrayCid));
|
| const intptr_t kNumInputs = 3;
|
| @@ -898,7 +890,7 @@ LocationSummary* StoreIndexedComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void StoreIndexedComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register receiver = locs()->in(0).reg();
|
| Register index = locs()->in(1).reg();
|
| Register value = locs()->in(2).reg();
|
| @@ -943,7 +935,7 @@ void StoreIndexedComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* LoadInstanceFieldComp::MakeLocationSummary() const {
|
| +LocationSummary* LoadInstanceFieldInstr::MakeLocationSummary() const {
|
| // TODO(fschneider): For this instruction the input register may be
|
| // reused for the result (but is not required to) because the input
|
| // is not used after the result is defined. We should consider adding
|
| @@ -954,14 +946,14 @@ LocationSummary* LoadInstanceFieldComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void LoadInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void LoadInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register instance_reg = locs()->in(0).reg();
|
| Register result_reg = locs()->out().reg();
|
| __ movl(result_reg, FieldAddress(instance_reg, field().Offset()));
|
| }
|
|
|
|
|
| -LocationSummary* StoreInstanceFieldComp::MakeLocationSummary() const {
|
| +LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t num_temps = 0;
|
| LocationSummary* summary =
|
| @@ -972,7 +964,7 @@ LocationSummary* StoreInstanceFieldComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void StoreInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register instance_reg = locs()->in(0).reg();
|
| Register value_reg = locs()->in(1).reg();
|
| if (this->value()->NeedsStoreBuffer()) {
|
| @@ -985,21 +977,21 @@ void StoreInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* LoadStaticFieldComp::MakeLocationSummary() const {
|
| +LocationSummary* LoadStaticFieldInstr::MakeLocationSummary() const {
|
| return LocationSummary::Make(0,
|
| Location::RequiresRegister(),
|
| LocationSummary::kNoCall);
|
| }
|
|
|
|
|
| -void LoadStaticFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register result = locs()->out().reg();
|
| __ LoadObject(result, field());
|
| __ movl(result, FieldAddress(result, Field::value_offset()));
|
| }
|
|
|
|
|
| -LocationSummary* StoreStaticFieldComp::MakeLocationSummary() const {
|
| +LocationSummary* StoreStaticFieldInstr::MakeLocationSummary() const {
|
| LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall);
|
| locs->set_in(0, Location::RequiresRegister());
|
| locs->set_temp(0, Location::RequiresRegister());
|
| @@ -1008,7 +1000,7 @@ LocationSummary* StoreStaticFieldComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void StoreStaticFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register value = locs()->in(0).reg();
|
| Register temp = locs()->temp(0).reg();
|
| ASSERT(locs()->out().reg() == value);
|
| @@ -1023,7 +1015,7 @@ void StoreStaticFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* InstanceOfComp::MakeLocationSummary() const {
|
| +LocationSummary* InstanceOfInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 3;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -1036,7 +1028,7 @@ LocationSummary* InstanceOfComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void InstanceOfComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| ASSERT(locs()->in(0).reg() == EAX); // Value.
|
| ASSERT(locs()->in(1).reg() == ECX); // Instantiator.
|
| ASSERT(locs()->in(2).reg() == EDX); // Instantiator type arguments.
|
| @@ -1049,7 +1041,7 @@ void InstanceOfComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* CreateArrayComp::MakeLocationSummary() const {
|
| +LocationSummary* CreateArrayInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -1060,7 +1052,7 @@ LocationSummary* CreateArrayComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| // Allocate the array. EDX = length, ECX = element type.
|
| ASSERT(locs()->in(0).reg() == ECX);
|
| __ movl(EDX, Immediate(Smi::RawValue(ArgumentCount())));
|
| @@ -1079,7 +1071,7 @@ void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|
|
|
|
| LocationSummary*
|
| - AllocateObjectWithBoundsCheckComp::MakeLocationSummary() const {
|
| +AllocateObjectWithBoundsCheckInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -1091,7 +1083,7 @@ LocationSummary*
|
| }
|
|
|
|
|
| -void AllocateObjectWithBoundsCheckComp::EmitNativeCode(
|
| +void AllocateObjectWithBoundsCheckInstr::EmitNativeCode(
|
| FlowGraphCompiler* compiler) {
|
| const Class& cls = Class::ZoneHandle(constructor().Owner());
|
| Register type_arguments = locs()->in(0).reg();
|
| @@ -1113,14 +1105,14 @@ void AllocateObjectWithBoundsCheckComp::EmitNativeCode(
|
| }
|
|
|
|
|
| -LocationSummary* LoadVMFieldComp::MakeLocationSummary() const {
|
| +LocationSummary* LoadVMFieldInstr::MakeLocationSummary() const {
|
| return LocationSummary::Make(1,
|
| Location::RequiresRegister(),
|
| LocationSummary::kNoCall);
|
| }
|
|
|
|
|
| -void LoadVMFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void LoadVMFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register instance_reg = locs()->in(0).reg();
|
| Register result_reg = locs()->out().reg();
|
|
|
| @@ -1128,7 +1120,7 @@ void LoadVMFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* InstantiateTypeArgumentsComp::MakeLocationSummary() const {
|
| +LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 1;
|
| LocationSummary* locs =
|
| @@ -1140,7 +1132,7 @@ LocationSummary* InstantiateTypeArgumentsComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void InstantiateTypeArgumentsComp::EmitNativeCode(
|
| +void InstantiateTypeArgumentsInstr::EmitNativeCode(
|
| FlowGraphCompiler* compiler) {
|
| Register instantiator_reg = locs()->in(0).reg();
|
| Register temp = locs()->temp(0).reg();
|
| @@ -1190,7 +1182,7 @@ void InstantiateTypeArgumentsComp::EmitNativeCode(
|
|
|
|
|
| LocationSummary*
|
| - ExtractConstructorTypeArgumentsComp::MakeLocationSummary() const {
|
| +ExtractConstructorTypeArgumentsInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 1;
|
| LocationSummary* locs =
|
| @@ -1202,7 +1194,7 @@ LocationSummary*
|
| }
|
|
|
|
|
| -void ExtractConstructorTypeArgumentsComp::EmitNativeCode(
|
| +void ExtractConstructorTypeArgumentsInstr::EmitNativeCode(
|
| FlowGraphCompiler* compiler) {
|
| Register instantiator_reg = locs()->in(0).reg();
|
| Register result_reg = locs()->out().reg();
|
| @@ -1248,7 +1240,7 @@ void ExtractConstructorTypeArgumentsComp::EmitNativeCode(
|
|
|
|
|
| LocationSummary*
|
| - ExtractConstructorInstantiatorComp::MakeLocationSummary() const {
|
| +ExtractConstructorInstantiatorInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 1;
|
| LocationSummary* locs =
|
| @@ -1260,7 +1252,7 @@ LocationSummary*
|
| }
|
|
|
|
|
| -void ExtractConstructorInstantiatorComp::EmitNativeCode(
|
| +void ExtractConstructorInstantiatorInstr::EmitNativeCode(
|
| FlowGraphCompiler* compiler) {
|
| Register instantiator_reg = locs()->in(0).reg();
|
| ASSERT(locs()->out().reg() == instantiator_reg);
|
| @@ -1314,7 +1306,7 @@ void ExtractConstructorInstantiatorComp::EmitNativeCode(
|
| }
|
|
|
|
|
| -LocationSummary* AllocateContextComp::MakeLocationSummary() const {
|
| +LocationSummary* AllocateContextInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 0;
|
| const intptr_t kNumTemps = 1;
|
| LocationSummary* locs =
|
| @@ -1325,7 +1317,7 @@ LocationSummary* AllocateContextComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void AllocateContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| ASSERT(locs()->temp(0).reg() == EDX);
|
| ASSERT(locs()->out().reg() == EAX);
|
|
|
| @@ -1339,7 +1331,7 @@ void AllocateContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* CloneContextComp::MakeLocationSummary() const {
|
| +LocationSummary* CloneContextInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -1350,7 +1342,7 @@ LocationSummary* CloneContextComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void CloneContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register context_value = locs()->in(0).reg();
|
| Register result = locs()->out().reg();
|
|
|
| @@ -1364,7 +1356,7 @@ void CloneContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* CatchEntryComp::MakeLocationSummary() const {
|
| +LocationSummary* CatchEntryInstr::MakeLocationSummary() const {
|
| return LocationSummary::Make(0,
|
| Location::NoLocation(),
|
| LocationSummary::kNoCall);
|
| @@ -1373,7 +1365,7 @@ LocationSummary* CatchEntryComp::MakeLocationSummary() const {
|
|
|
| // Restore stack and initialize the two exception variables:
|
| // exception and stack trace variables.
|
| -void CatchEntryComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| // Restore RSP from RBP as we are coming from a throw and the code for
|
| // popping arguments has not been run.
|
| const intptr_t locals_space_size = compiler->StackSize() * kWordSize;
|
| @@ -1391,7 +1383,7 @@ void CatchEntryComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* CheckStackOverflowComp::MakeLocationSummary() const {
|
| +LocationSummary* CheckStackOverflowInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 0;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -1404,25 +1396,25 @@ LocationSummary* CheckStackOverflowComp::MakeLocationSummary() const {
|
|
|
| class CheckStackOverflowSlowPath : public SlowPathCode {
|
| public:
|
| - explicit CheckStackOverflowSlowPath(CheckStackOverflowComp* computation)
|
| - : computation_(computation) { }
|
| + explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
|
| + : instruction_(instruction) { }
|
|
|
| virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
|
| __ Bind(entry_label());
|
| - compiler->SaveLiveRegisters(computation_->locs());
|
| - compiler->GenerateCallRuntime(computation_->token_pos(),
|
| + compiler->SaveLiveRegisters(instruction_->locs());
|
| + compiler->GenerateCallRuntime(instruction_->token_pos(),
|
| kStackOverflowRuntimeEntry,
|
| - computation_->locs());
|
| - compiler->RestoreLiveRegisters(computation_->locs());
|
| + instruction_->locs());
|
| + compiler->RestoreLiveRegisters(instruction_->locs());
|
| __ jmp(exit_label());
|
| }
|
|
|
| private:
|
| - CheckStackOverflowComp* computation_;
|
| + CheckStackOverflowInstr* instruction_;
|
| };
|
|
|
|
|
| -void CheckStackOverflowComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this);
|
| compiler->AddSlowPathCode(slow_path);
|
|
|
| @@ -1433,7 +1425,7 @@ void CheckStackOverflowComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* BinarySmiOpComp::MakeLocationSummary() const {
|
| +LocationSummary* BinarySmiOpInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 2;
|
| if (op_kind() == Token::kTRUNCDIV) {
|
| const intptr_t kNumTemps = 3;
|
| @@ -1478,7 +1470,7 @@ LocationSummary* BinarySmiOpComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void BinarySmiOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register left = locs()->in(0).reg();
|
| Register result = locs()->out().reg();
|
| ASSERT(left == result);
|
| @@ -1699,7 +1691,7 @@ void BinarySmiOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* BinaryMintOpComp::MakeLocationSummary() const {
|
| +LocationSummary* BinaryMintOpInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 2;
|
| ASSERT(op_kind() == Token::kBIT_AND);
|
| const intptr_t kNumTemps = 1;
|
| @@ -1713,7 +1705,7 @@ LocationSummary* BinaryMintOpComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void BinaryMintOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void BinaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| // TODO(regis): For now, we only support Token::kBIT_AND for a Mint or Smi
|
| // receiver and a Mint or Smi argument. We fall back to the run time call if
|
| // both receiver and argument are Mint or if one of them is Mint and the other
|
| @@ -1803,7 +1795,7 @@ void BinaryMintOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* CheckEitherNonSmiComp::MakeLocationSummary() const {
|
| +LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary() const {
|
| ASSERT((left()->ResultCid() != kDoubleCid) &&
|
| (right()->ResultCid() != kDoubleCid));
|
| const intptr_t kNumInputs = 2;
|
| @@ -1817,10 +1809,8 @@ LocationSummary* CheckEitherNonSmiComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void CheckEitherNonSmiComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| - Label* deopt = compiler->AddDeoptStub(instance_call_->deopt_id(),
|
| - kDeoptBinaryDoubleOp);
|
| -
|
| +void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| + Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptBinaryDoubleOp);
|
| Register temp = locs()->temp(0).reg();
|
| __ movl(temp, locs()->in(0).reg());
|
| __ orl(temp, locs()->in(1).reg());
|
| @@ -1829,7 +1819,7 @@ void CheckEitherNonSmiComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* BoxDoubleComp::MakeLocationSummary() const {
|
| +LocationSummary* BoxDoubleInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -1844,8 +1834,8 @@ LocationSummary* BoxDoubleComp::MakeLocationSummary() const {
|
|
|
| class BoxDoubleSlowPath : public SlowPathCode {
|
| public:
|
| - explicit BoxDoubleSlowPath(BoxDoubleComp* computation)
|
| - : computation_(computation) { }
|
| + explicit BoxDoubleSlowPath(BoxDoubleInstr* instruction)
|
| + : instruction_(instruction) { }
|
|
|
| virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
|
| __ Bind(entry_label());
|
| @@ -1854,11 +1844,11 @@ class BoxDoubleSlowPath : public SlowPathCode {
|
| Code::Handle(StubCode::GetAllocationStubForClass(double_class));
|
| const ExternalLabel label(double_class.ToCString(), stub.EntryPoint());
|
|
|
| - LocationSummary* locs = computation_->locs();
|
| + LocationSummary* locs = instruction_->locs();
|
| locs->live_registers()->Remove(locs->out());
|
|
|
| compiler->SaveLiveRegisters(locs);
|
| - compiler->GenerateCall(computation_->token_pos(),
|
| + compiler->GenerateCall(instruction_->token_pos(),
|
| &label,
|
| PcDescriptors::kOther,
|
| locs);
|
| @@ -1869,11 +1859,11 @@ class BoxDoubleSlowPath : public SlowPathCode {
|
| }
|
|
|
| private:
|
| - BoxDoubleComp* computation_;
|
| + BoxDoubleInstr* instruction_;
|
| };
|
|
|
|
|
| -void BoxDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
|
| compiler->AddSlowPathCode(slow_path);
|
|
|
| @@ -1890,7 +1880,7 @@ void BoxDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* UnboxDoubleComp::MakeLocationSummary() const {
|
| +LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const {
|
| const intptr_t v_cid = value()->ResultCid();
|
|
|
| const intptr_t kNumInputs = 1;
|
| @@ -1904,7 +1894,7 @@ LocationSummary* UnboxDoubleComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void UnboxDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void UnboxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| const intptr_t v_cid = value()->ResultCid();
|
|
|
| const Register value = locs()->in(0).reg();
|
| @@ -1921,7 +1911,7 @@ void UnboxDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* UnboxedDoubleBinaryOpComp::MakeLocationSummary() const {
|
| +LocationSummary* UnboxedDoubleBinaryOpInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -1933,7 +1923,7 @@ LocationSummary* UnboxedDoubleBinaryOpComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void UnboxedDoubleBinaryOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void UnboxedDoubleBinaryOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| XmmRegister left = locs()->in(0).xmm_reg();
|
| XmmRegister right = locs()->in(1).xmm_reg();
|
|
|
| @@ -1949,7 +1939,7 @@ void UnboxedDoubleBinaryOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* UnarySmiOpComp::MakeLocationSummary() const {
|
| +LocationSummary* UnarySmiOpInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -1960,7 +1950,7 @@ LocationSummary* UnarySmiOpComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void UnarySmiOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register value = locs()->in(0).reg();
|
| ASSERT(value == locs()->out().reg());
|
| switch (op_kind()) {
|
| @@ -1981,7 +1971,7 @@ void UnarySmiOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* NumberNegateComp::MakeLocationSummary() const {
|
| +LocationSummary* NumberNegateInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 1; // Needed for doubles.
|
| LocationSummary* summary =
|
| @@ -1993,7 +1983,7 @@ LocationSummary* NumberNegateComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void NumberNegateComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void NumberNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| const ICData& ic_data = *instance_call()->ic_data();
|
| ASSERT(!ic_data.IsNull());
|
| ASSERT(ic_data.num_args_tested() == 1);
|
| @@ -2039,7 +2029,7 @@ void NumberNegateComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* DoubleToDoubleComp::MakeLocationSummary() const {
|
| +LocationSummary* DoubleToDoubleInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 1;
|
| LocationSummary* locs =
|
| @@ -2051,7 +2041,7 @@ LocationSummary* DoubleToDoubleComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void DoubleToDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register value = locs()->in(0).reg();
|
| Register result = locs()->out().reg();
|
|
|
| @@ -2066,12 +2056,12 @@ void DoubleToDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* SmiToDoubleComp::MakeLocationSummary() const {
|
| +LocationSummary* SmiToDoubleInstr::MakeLocationSummary() const {
|
| return MakeCallSummary(); // Calls a stub to allocate result.
|
| }
|
|
|
|
|
| -void SmiToDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register result = locs()->out().reg();
|
|
|
| Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(),
|
| @@ -2101,12 +2091,12 @@ void SmiToDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* PolymorphicInstanceCallComp::MakeLocationSummary() const {
|
| +LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const {
|
| return MakeCallSummary();
|
| }
|
|
|
|
|
| -void PolymorphicInstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(),
|
| kDeoptPolymorphicInstanceCallTestFail);
|
| if (ic_data().NumberOfChecks() == 0) {
|
| @@ -2147,12 +2137,18 @@ void PolymorphicInstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| +LocationSummary* BranchInstr::MakeLocationSummary() const {
|
| + UNREACHABLE();
|
| + return NULL;
|
| +}
|
| +
|
| +
|
| void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| - computation()->EmitBranchCode(compiler, this);
|
| + comparison()->EmitBranchCode(compiler, this);
|
| }
|
|
|
|
|
| -LocationSummary* CheckClassComp::MakeLocationSummary() const {
|
| +LocationSummary* CheckClassInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 1;
|
| LocationSummary* summary =
|
| @@ -2163,7 +2159,7 @@ LocationSummary* CheckClassComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void CheckClassComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register value = locs()->in(0).reg();
|
| Register temp = locs()->temp(0).reg();
|
| Label* deopt = compiler->AddDeoptStub(deopt_id(),
|
| @@ -2191,7 +2187,7 @@ void CheckClassComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* CheckSmiComp::MakeLocationSummary() const {
|
| +LocationSummary* CheckSmiInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -2201,7 +2197,7 @@ LocationSummary* CheckSmiComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void CheckSmiComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register value = locs()->in(0).reg();
|
| Label* deopt = compiler->AddDeoptStub(deopt_id(),
|
| kDeoptCheckSmi);
|
| @@ -2210,7 +2206,7 @@ void CheckSmiComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* CheckArrayBoundComp::MakeLocationSummary() const {
|
| +LocationSummary* CheckArrayBoundInstr::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -2221,7 +2217,7 @@ LocationSummary* CheckArrayBoundComp::MakeLocationSummary() const {
|
| }
|
|
|
|
|
| -void CheckArrayBoundComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| +void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register receiver = locs()->in(0).reg();
|
|
|
| const DeoptReasonId deopt_reason =
|
|
|