| Index: runtime/vm/intermediate_language_mips.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language_mips.cc (revision 31159)
|
| +++ runtime/vm/intermediate_language_mips.cc (working copy)
|
| @@ -34,7 +34,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* PushArgumentInstr::MakeLocationSummary() const {
|
| +LocationSummary* PushArgumentInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps= 0;
|
| LocationSummary* locs =
|
| @@ -64,7 +64,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* ReturnInstr::MakeLocationSummary() const {
|
| +LocationSummary* ReturnInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -134,8 +134,9 @@
|
| }
|
|
|
|
|
| -LocationSummary* IfThenElseInstr::MakeLocationSummary() const {
|
| - return comparison()->MakeLocationSummary();
|
| +LocationSummary* IfThenElseInstr::MakeLocationSummary(bool opt) const {
|
| + comparison()->InitializeLocationSummary(opt);
|
| + return comparison()->locs();
|
| }
|
|
|
|
|
| @@ -215,7 +216,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* ClosureCallInstr::MakeLocationSummary() const {
|
| +LocationSummary* ClosureCallInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 0;
|
| const intptr_t kNumTemps = 1;
|
| LocationSummary* result =
|
| @@ -245,7 +246,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* LoadLocalInstr::MakeLocationSummary() const {
|
| +LocationSummary* LoadLocalInstr::MakeLocationSummary(bool opt) const {
|
| return LocationSummary::Make(0,
|
| Location::RequiresRegister(),
|
| LocationSummary::kNoCall);
|
| @@ -259,7 +260,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* StoreLocalInstr::MakeLocationSummary() const {
|
| +LocationSummary* StoreLocalInstr::MakeLocationSummary(bool opt) const {
|
| return LocationSummary::Make(1,
|
| Location::SameAsFirstInput(),
|
| LocationSummary::kNoCall);
|
| @@ -275,7 +276,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* ConstantInstr::MakeLocationSummary() const {
|
| +LocationSummary* ConstantInstr::MakeLocationSummary(bool opt) const {
|
| return LocationSummary::Make(0,
|
| Location::RequiresRegister(),
|
| LocationSummary::kNoCall);
|
| @@ -292,7 +293,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* AssertAssignableInstr::MakeLocationSummary() const {
|
| +LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 3;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -305,7 +306,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* AssertBooleanInstr::MakeLocationSummary() const {
|
| +LocationSummary* AssertBooleanInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -350,7 +351,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* EqualityCompareInstr::MakeLocationSummary() const {
|
| +LocationSummary* EqualityCompareInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 2;
|
| if (operation_cid() == kMintCid) {
|
| const intptr_t kNumTemps = 1;
|
| @@ -602,7 +603,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* TestSmiInstr::MakeLocationSummary() const {
|
| +LocationSummary* TestSmiInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -647,7 +648,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* RelationalOpInstr::MakeLocationSummary() const {
|
| +LocationSummary* RelationalOpInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = 0;
|
| if (operation_cid() == kMintCid) {
|
| @@ -723,7 +724,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* NativeCallInstr::MakeLocationSummary() const {
|
| +LocationSummary* NativeCallInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 0;
|
| const intptr_t kNumTemps = 3;
|
| LocationSummary* locs =
|
| @@ -779,7 +780,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const {
|
| +LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| // TODO(fschneider): Allow immediate operands for the char code.
|
| return LocationSummary::Make(kNumInputs,
|
| @@ -803,7 +804,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* StringInterpolateInstr::MakeLocationSummary() const {
|
| +LocationSummary* StringInterpolateInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -829,7 +830,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* LoadUntaggedInstr::MakeLocationSummary() const {
|
| +LocationSummary* LoadUntaggedInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| return LocationSummary::Make(kNumInputs,
|
| Location::RequiresRegister(),
|
| @@ -844,7 +845,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* LoadClassIdInstr::MakeLocationSummary() const {
|
| +LocationSummary* LoadClassIdInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| return LocationSummary::Make(kNumInputs,
|
| Location::RequiresRegister(),
|
| @@ -940,7 +941,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* LoadIndexedInstr::MakeLocationSummary() const {
|
| +LocationSummary* LoadIndexedInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -1123,7 +1124,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* StoreIndexedInstr::MakeLocationSummary() const {
|
| +LocationSummary* StoreIndexedInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 3;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -1307,7 +1308,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* GuardFieldInstr::MakeLocationSummary() const {
|
| +LocationSummary* GuardFieldInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| LocationSummary* summary =
|
| new LocationSummary(kNumInputs, 0, LocationSummary::kNoCall);
|
| @@ -1640,21 +1641,142 @@
|
| }
|
|
|
|
|
| -LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary() const {
|
| +class StoreInstanceFieldSlowPath : public SlowPathCode {
|
| + public:
|
| + explicit StoreInstanceFieldSlowPath(StoreInstanceFieldInstr* instruction)
|
| + : instruction_(instruction) { }
|
| +
|
| + virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
|
| + __ Comment("StoreInstanceFieldSlowPath");
|
| + __ Bind(entry_label());
|
| + const Class& double_class = compiler->double_class();
|
| + const Code& stub =
|
| + Code::Handle(StubCode::GetAllocationStubForClass(double_class));
|
| + const ExternalLabel label(double_class.ToCString(), stub.EntryPoint());
|
| +
|
| + LocationSummary* locs = instruction_->locs();
|
| + locs->live_registers()->Remove(locs->out());
|
| +
|
| + compiler->SaveLiveRegisters(locs);
|
| + compiler->GenerateCall(Scanner::kDummyTokenIndex, // No token position.
|
| + &label,
|
| + PcDescriptors::kOther,
|
| + locs);
|
| + __ mov(locs->temp(0).reg(), V0);
|
| + compiler->RestoreLiveRegisters(locs);
|
| +
|
| + __ b(exit_label());
|
| + }
|
| +
|
| + private:
|
| + StoreInstanceFieldInstr* instruction_;
|
| +};
|
| +
|
| +
|
| +LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| - new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
|
| + new LocationSummary(kNumInputs, kNumTemps,
|
| + (field().guarded_cid() == kIllegalCid) || (is_initialization_)
|
| + ? LocationSummary::kCallOnSlowPath
|
| + : LocationSummary::kNoCall);
|
| +
|
| summary->set_in(0, Location::RequiresRegister());
|
| - summary->set_in(1, ShouldEmitStoreBarrier()
|
| + if (IsUnboxedStore() && opt) {
|
| + summary->set_in(1, Location::RequiresFpuRegister());
|
| + summary->AddTemp(Location::RequiresRegister());
|
| + summary->AddTemp(Location::RequiresRegister());
|
| + } else if (IsPotentialUnboxedStore()) {
|
| + summary->set_in(1, ShouldEmitStoreBarrier()
|
| + ? Location::WritableRegister()
|
| + : Location::RequiresRegister());
|
| + summary->AddTemp(Location::RequiresRegister());
|
| + summary->AddTemp(Location::RequiresRegister());
|
| + summary->AddTemp(opt ? Location::RequiresFpuRegister()
|
| + : Location::FpuRegisterLocation(D1));
|
| + } else {
|
| + summary->set_in(1, ShouldEmitStoreBarrier()
|
| ? Location::WritableRegister()
|
| : Location::RegisterOrConstant(value()));
|
| + }
|
| return summary;
|
| }
|
|
|
|
|
| void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| + Label skip_store;
|
| +
|
| Register instance_reg = locs()->in(0).reg();
|
| +
|
| + if (IsUnboxedStore() && compiler->is_optimizing()) {
|
| + DRegister value = locs()->in(1).fpu_reg();
|
| + Register temp = locs()->temp(0).reg();
|
| + Register temp2 = locs()->temp(1).reg();
|
| +
|
| + if (is_initialization_) {
|
| + StoreInstanceFieldSlowPath* slow_path =
|
| + new StoreInstanceFieldSlowPath(this);
|
| + compiler->AddSlowPathCode(slow_path);
|
| + __ TryAllocate(compiler->double_class(),
|
| + slow_path->entry_label(),
|
| + temp);
|
| + __ Bind(slow_path->exit_label());
|
| + __ mov(temp2, temp);
|
| + __ StoreIntoObject(instance_reg,
|
| + FieldAddress(instance_reg, field().Offset()),
|
| + temp2);
|
| + } else {
|
| + __ lw(temp, FieldAddress(instance_reg, field().Offset()));
|
| + }
|
| + __ StoreDToOffset(value, temp, Double::value_offset() - kHeapObjectTag);
|
| + return;
|
| + }
|
| +
|
| + if (IsPotentialUnboxedStore()) {
|
| + Register value_reg = locs()->in(1).reg();
|
| + Register temp = locs()->temp(0).reg();
|
| + Register temp2 = locs()->temp(1).reg();
|
| + DRegister fpu_temp = locs()->temp(2).fpu_reg();
|
| +
|
| + Label store_pointer, copy_payload;
|
| + __ LoadObject(temp, Field::ZoneHandle(field().raw()));
|
| + __ lw(temp2, FieldAddress(temp, Field::guarded_cid_offset()));
|
| + __ BranchNotEqual(temp2, kDoubleCid, &store_pointer);
|
| + __ lw(temp2, FieldAddress(temp, Field::is_nullable_offset()));
|
| + __ BranchEqual(temp2, kNullCid, &store_pointer);
|
| +
|
| + __ lw(temp, FieldAddress(instance_reg, field().Offset()));
|
| + __ BranchNotEqual(temp, reinterpret_cast<int32_t>(Object::null()),
|
| + ©_payload);
|
| +
|
| + StoreInstanceFieldSlowPath* slow_path =
|
| + new StoreInstanceFieldSlowPath(this);
|
| + compiler->AddSlowPathCode(slow_path);
|
| +
|
| + if (!compiler->is_optimizing()) {
|
| + locs()->live_registers()->Add(locs()->in(0));
|
| + locs()->live_registers()->Add(locs()->in(1));
|
| + }
|
| +
|
| + __ TryAllocate(compiler->double_class(),
|
| + slow_path->entry_label(),
|
| + temp);
|
| + __ Bind(slow_path->exit_label());
|
| + __ mov(temp2, temp);
|
| + __ StoreIntoObject(instance_reg,
|
| + FieldAddress(instance_reg, field().Offset()),
|
| + temp2);
|
| +
|
| + __ Bind(©_payload);
|
| + __ LoadDFromOffset(fpu_temp,
|
| + value_reg,
|
| + Double::value_offset() - kHeapObjectTag);
|
| + __ StoreDToOffset(fpu_temp, temp, Double::value_offset() - kHeapObjectTag);
|
| + __ b(&skip_store);
|
| + __ Bind(&store_pointer);
|
| + }
|
| +
|
| if (ShouldEmitStoreBarrier()) {
|
| Register value_reg = locs()->in(1).reg();
|
| __ StoreIntoObject(instance_reg,
|
| @@ -1673,10 +1795,11 @@
|
| FieldAddress(instance_reg, field().Offset()), value_reg);
|
| }
|
| }
|
| + __ Bind(&skip_store);
|
| }
|
|
|
|
|
| -LocationSummary* LoadStaticFieldInstr::MakeLocationSummary() const {
|
| +LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -1700,7 +1823,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* StoreStaticFieldInstr::MakeLocationSummary() const {
|
| +LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(bool opt) const {
|
| LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall);
|
| locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
|
| : Location::RequiresRegister());
|
| @@ -1725,7 +1848,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* InstanceOfInstr::MakeLocationSummary() const {
|
| +LocationSummary* InstanceOfInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 3;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -1753,7 +1876,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* CreateArrayInstr::MakeLocationSummary() const {
|
| +LocationSummary* CreateArrayInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -1778,7 +1901,7 @@
|
|
|
|
|
| LocationSummary*
|
| -AllocateObjectWithBoundsCheckInstr::MakeLocationSummary() const {
|
| +AllocateObjectWithBoundsCheckInstr::MakeLocationSummary(bool opt) const {
|
| return MakeCallSummary();
|
| }
|
|
|
| @@ -1796,22 +1919,118 @@
|
| }
|
|
|
|
|
| -LocationSummary* LoadFieldInstr::MakeLocationSummary() const {
|
| - return LocationSummary::Make(1,
|
| - Location::RequiresRegister(),
|
| - LocationSummary::kNoCall);
|
| +class BoxDoubleSlowPath : public SlowPathCode {
|
| + public:
|
| + explicit BoxDoubleSlowPath(Instruction* instruction)
|
| + : instruction_(instruction) { }
|
| +
|
| + virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
|
| + __ Comment("BoxDoubleSlowPath");
|
| + __ Bind(entry_label());
|
| + const Class& double_class = compiler->double_class();
|
| + const Code& stub =
|
| + Code::Handle(StubCode::GetAllocationStubForClass(double_class));
|
| + const ExternalLabel label(double_class.ToCString(), stub.EntryPoint());
|
| +
|
| + LocationSummary* locs = instruction_->locs();
|
| + locs->live_registers()->Remove(locs->out());
|
| +
|
| + compiler->SaveLiveRegisters(locs);
|
| + compiler->GenerateCall(Scanner::kDummyTokenIndex, // No token position.
|
| + &label,
|
| + PcDescriptors::kOther,
|
| + locs);
|
| + if (locs->out().reg() != V0) {
|
| + __ mov(locs->out().reg(), V0);
|
| + }
|
| + compiler->RestoreLiveRegisters(locs);
|
| +
|
| + __ b(exit_label());
|
| + }
|
| +
|
| + private:
|
| + Instruction* instruction_;
|
| +};
|
| +
|
| +
|
| +LocationSummary* LoadFieldInstr::MakeLocationSummary(bool opt) const {
|
| + const intptr_t kNumInputs = 1;
|
| + const intptr_t kNumTemps = 0;
|
| + LocationSummary* locs =
|
| + new LocationSummary(
|
| + kNumInputs, kNumTemps,
|
| + (opt && !IsPotentialUnboxedLoad())
|
| + ? LocationSummary::kNoCall
|
| + : LocationSummary::kCallOnSlowPath);
|
| +
|
| + locs->set_in(0, Location::RequiresRegister());
|
| +
|
| + if (IsUnboxedLoad() && opt) {
|
| + locs->AddTemp(Location::RequiresRegister());
|
| + } else if (IsPotentialUnboxedLoad()) {
|
| + locs->AddTemp(opt ? Location::RequiresFpuRegister()
|
| + : Location::FpuRegisterLocation(D1));
|
| + locs->AddTemp(Location::RequiresRegister());
|
| + }
|
| + locs->set_out(Location::RequiresRegister());
|
| + return locs;
|
| }
|
|
|
|
|
| void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register instance_reg = locs()->in(0).reg();
|
| + if (IsUnboxedLoad() && compiler->is_optimizing()) {
|
| + DRegister result = locs()->out().fpu_reg();
|
| + Register temp = locs()->temp(0).reg();
|
| + __ lw(temp, FieldAddress(instance_reg, offset_in_bytes()));
|
| + __ LoadDFromOffset(result, temp, Double::value_offset() - kHeapObjectTag);
|
| + return;
|
| + }
|
| +
|
| + Label done;
|
| Register result_reg = locs()->out().reg();
|
| + if (IsPotentialUnboxedLoad()) {
|
| + Register temp = locs()->temp(1).reg();
|
| + DRegister value = locs()->temp(0).fpu_reg();
|
|
|
| + Label load_pointer;
|
| + __ LoadObject(result_reg, Field::ZoneHandle(field()->raw()));
|
| +
|
| + FieldAddress field_cid_operand(result_reg, Field::guarded_cid_offset());
|
| + FieldAddress field_nullability_operand(result_reg,
|
| + Field::is_nullable_offset());
|
| +
|
| + __ lw(temp, field_cid_operand);
|
| + __ BranchNotEqual(temp, kDoubleCid, &load_pointer);
|
| +
|
| + __ lw(temp, field_nullability_operand);
|
| + __ BranchEqual(temp, kNullCid, &load_pointer);
|
| +
|
| + BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
|
| + compiler->AddSlowPathCode(slow_path);
|
| +
|
| + if (!compiler->is_optimizing()) {
|
| + locs()->live_registers()->Add(locs()->in(0));
|
| + }
|
| +
|
| + __ TryAllocate(compiler->double_class(),
|
| + slow_path->entry_label(),
|
| + result_reg);
|
| + __ Bind(slow_path->exit_label());
|
| + __ lw(temp, FieldAddress(instance_reg, offset_in_bytes()));
|
| + __ LoadDFromOffset(value, temp, Double::value_offset() - kHeapObjectTag);
|
| + __ StoreDToOffset(value,
|
| + result_reg,
|
| + Double::value_offset() - kHeapObjectTag);
|
| + __ b(&done);
|
| + __ Bind(&load_pointer);
|
| + }
|
| __ lw(result_reg, Address(instance_reg, offset_in_bytes() - kHeapObjectTag));
|
| + __ Bind(&done);
|
| }
|
|
|
|
|
| -LocationSummary* InstantiateTypeInstr::MakeLocationSummary() const {
|
| +LocationSummary* InstantiateTypeInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -1851,7 +2070,8 @@
|
| }
|
|
|
|
|
| -LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const {
|
| +LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary(
|
| + bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -1907,7 +2127,7 @@
|
|
|
|
|
| LocationSummary*
|
| -ExtractConstructorTypeArgumentsInstr::MakeLocationSummary() const {
|
| +ExtractConstructorTypeArgumentsInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -1948,7 +2168,7 @@
|
|
|
|
|
| LocationSummary*
|
| -ExtractConstructorInstantiatorInstr::MakeLocationSummary() const {
|
| +ExtractConstructorInstantiatorInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -1986,7 +2206,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* AllocateContextInstr::MakeLocationSummary() const {
|
| +LocationSummary* AllocateContextInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 0;
|
| const intptr_t kNumTemps = 1;
|
| LocationSummary* locs =
|
| @@ -2013,7 +2233,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* CloneContextInstr::MakeLocationSummary() const {
|
| +LocationSummary* CloneContextInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -2045,7 +2265,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* CatchBlockEntryInstr::MakeLocationSummary() const {
|
| +LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(bool opt) const {
|
| UNREACHABLE();
|
| return NULL;
|
| }
|
| @@ -2085,7 +2305,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* CheckStackOverflowInstr::MakeLocationSummary() const {
|
| +LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 0;
|
| const intptr_t kNumTemps = 1;
|
| LocationSummary* summary =
|
| @@ -2273,7 +2493,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* BinarySmiOpInstr::MakeLocationSummary() const {
|
| +LocationSummary* BinarySmiOpInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = op_kind() == Token::kADD ? 1 : 0;
|
| LocationSummary* summary =
|
| @@ -2619,7 +2839,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary() const {
|
| +LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(bool opt) const {
|
| intptr_t left_cid = left()->Type()->ToCid();
|
| intptr_t right_cid = right()->Type()->ToCid();
|
| ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid));
|
| @@ -2651,7 +2871,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* BoxDoubleInstr::MakeLocationSummary() const {
|
| +LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -2664,40 +2884,6 @@
|
| }
|
|
|
|
|
| -class BoxDoubleSlowPath : public SlowPathCode {
|
| - public:
|
| - explicit BoxDoubleSlowPath(BoxDoubleInstr* instruction)
|
| - : instruction_(instruction) { }
|
| -
|
| - virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
|
| - __ Comment("BoxDoubleSlowPath");
|
| - __ Bind(entry_label());
|
| - const Class& double_class = compiler->double_class();
|
| - const Code& stub =
|
| - Code::Handle(StubCode::GetAllocationStubForClass(double_class));
|
| - const ExternalLabel label(double_class.ToCString(), stub.EntryPoint());
|
| -
|
| - LocationSummary* locs = instruction_->locs();
|
| - locs->live_registers()->Remove(locs->out());
|
| -
|
| - compiler->SaveLiveRegisters(locs);
|
| - compiler->GenerateCall(Scanner::kDummyTokenIndex, // No token position.
|
| - &label,
|
| - PcDescriptors::kOther,
|
| - locs);
|
| - if (locs->out().reg() != V0) {
|
| - __ mov(locs->out().reg(), V0);
|
| - }
|
| - compiler->RestoreLiveRegisters(locs);
|
| -
|
| - __ b(exit_label());
|
| - }
|
| -
|
| - private:
|
| - BoxDoubleInstr* instruction_;
|
| -};
|
| -
|
| -
|
| void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
|
| compiler->AddSlowPathCode(slow_path);
|
| @@ -2713,7 +2899,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const {
|
| +LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t value_cid = value()->Type()->ToCid();
|
| const bool needs_writable_input = (value_cid == kSmiCid);
|
| @@ -2759,7 +2945,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* BoxFloat32x4Instr::MakeLocationSummary() const {
|
| +LocationSummary* BoxFloat32x4Instr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2770,7 +2956,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary() const {
|
| +LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2781,7 +2967,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* BoxInt32x4Instr::MakeLocationSummary() const {
|
| +LocationSummary* BoxInt32x4Instr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2792,7 +2978,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* UnboxInt32x4Instr::MakeLocationSummary() const {
|
| +LocationSummary* UnboxInt32x4Instr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2803,7 +2989,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary() const {
|
| +LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -2829,7 +3015,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary() const {
|
| +LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2840,7 +3026,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary() const {
|
| +LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2852,7 +3038,7 @@
|
|
|
|
|
|
|
| -LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary() const {
|
| +LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2863,7 +3049,8 @@
|
| }
|
|
|
|
|
| -LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary() const {
|
| +LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary(
|
| + bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2874,7 +3061,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Float32x4ZeroInstr::MakeLocationSummary() const {
|
| +LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2885,7 +3072,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Float32x4SplatInstr::MakeLocationSummary() const {
|
| +LocationSummary* Float32x4SplatInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2896,7 +3083,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary() const {
|
| +LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2907,7 +3094,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary() const {
|
| +LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2918,7 +3105,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Float32x4SqrtInstr::MakeLocationSummary() const {
|
| +LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2929,7 +3116,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Float32x4ScaleInstr::MakeLocationSummary() const {
|
| +LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2940,7 +3127,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary() const {
|
| +LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2951,7 +3138,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Float32x4ClampInstr::MakeLocationSummary() const {
|
| +LocationSummary* Float32x4ClampInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2962,7 +3149,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Float32x4WithInstr::MakeLocationSummary() const {
|
| +LocationSummary* Float32x4WithInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2973,7 +3160,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary() const {
|
| +LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2984,7 +3171,8 @@
|
| }
|
|
|
|
|
| -LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary() const {
|
| +LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary(
|
| + bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -2995,7 +3183,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary() const {
|
| +LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -3006,7 +3194,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary() const {
|
| +LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -3017,7 +3205,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Int32x4SelectInstr::MakeLocationSummary() const {
|
| +LocationSummary* Int32x4SelectInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -3028,7 +3216,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary() const {
|
| +LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -3039,7 +3227,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary() const {
|
| +LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -3050,7 +3238,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary() const {
|
| +LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -3061,7 +3249,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* MathUnaryInstr::MakeLocationSummary() const {
|
| +LocationSummary* MathUnaryInstr::MakeLocationSummary(bool opt) const {
|
| if ((kind() == MethodRecognizer::kMathSin) ||
|
| (kind() == MethodRecognizer::kMathCos)) {
|
| const intptr_t kNumInputs = 1;
|
| @@ -3091,7 +3279,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* MathMinMaxInstr::MakeLocationSummary() const {
|
| +LocationSummary* MathMinMaxInstr::MakeLocationSummary(bool opt) const {
|
| if (result_cid() == kDoubleCid) {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = 1;
|
| @@ -3182,7 +3370,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* UnarySmiOpInstr::MakeLocationSummary() const {
|
| +LocationSummary* UnarySmiOpInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -3216,7 +3404,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary() const {
|
| +LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 1;
|
| LocationSummary* summary =
|
| @@ -3241,7 +3429,7 @@
|
|
|
|
|
|
|
| -LocationSummary* SmiToDoubleInstr::MakeLocationSummary() const {
|
| +LocationSummary* SmiToDoubleInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* result =
|
| @@ -3261,7 +3449,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* DoubleToIntegerInstr::MakeLocationSummary() const {
|
| +LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* result =
|
| @@ -3307,7 +3495,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* DoubleToSmiInstr::MakeLocationSummary() const {
|
| +LocationSummary* DoubleToSmiInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* result = new LocationSummary(
|
| @@ -3333,7 +3521,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* DoubleToDoubleInstr::MakeLocationSummary() const {
|
| +LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -3344,7 +3532,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary() const {
|
| +LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(bool opt) const {
|
| // Calling convetion on MIPS uses D6 and D7 to pass the first two
|
| // double arguments.
|
| ASSERT((InputCount() == 1) || (InputCount() == 2));
|
| @@ -3406,7 +3594,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* MergedMathInstr::MakeLocationSummary() const {
|
| +LocationSummary* MergedMathInstr::MakeLocationSummary(bool opt) const {
|
| if (kind() == MergedMathInstr::kTruncDivMod) {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = 3;
|
| @@ -3494,7 +3682,8 @@
|
| }
|
|
|
|
|
| -LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const {
|
| +LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary(
|
| + bool opt) const {
|
| return MakeCallSummary();
|
| }
|
|
|
| @@ -3537,9 +3726,11 @@
|
| }
|
|
|
|
|
| -LocationSummary* BranchInstr::MakeLocationSummary() const {
|
| - UNREACHABLE();
|
| - return NULL;
|
| +LocationSummary* BranchInstr::MakeLocationSummary(bool opt) const {
|
| + comparison()->InitializeLocationSummary(opt);
|
| + // Branches don't produce a result.
|
| + comparison()->locs()->set_out(Location::NoLocation());
|
| + return comparison()->locs();
|
| }
|
|
|
|
|
| @@ -3549,7 +3740,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* CheckClassInstr::MakeLocationSummary() const {
|
| +LocationSummary* CheckClassInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -3603,7 +3794,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* CheckSmiInstr::MakeLocationSummary() const {
|
| +LocationSummary* CheckSmiInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* summary =
|
| @@ -3623,7 +3814,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* CheckArrayBoundInstr::MakeLocationSummary() const {
|
| +LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -3675,7 +3866,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* UnboxIntegerInstr::MakeLocationSummary() const {
|
| +LocationSummary* UnboxIntegerInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -3686,7 +3877,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* BoxIntegerInstr::MakeLocationSummary() const {
|
| +LocationSummary* BoxIntegerInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -3697,7 +3888,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* BinaryMintOpInstr::MakeLocationSummary() const {
|
| +LocationSummary* BinaryMintOpInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -3708,7 +3899,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* ShiftMintOpInstr::MakeLocationSummary() const {
|
| +LocationSummary* ShiftMintOpInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -3719,7 +3910,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* UnaryMintOpInstr::MakeLocationSummary() const {
|
| +LocationSummary* UnaryMintOpInstr::MakeLocationSummary(bool opt) const {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
| @@ -3730,7 +3921,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* ThrowInstr::MakeLocationSummary() const {
|
| +LocationSummary* ThrowInstr::MakeLocationSummary(bool opt) const {
|
| return new LocationSummary(0, 0, LocationSummary::kCall);
|
| }
|
|
|
| @@ -3746,7 +3937,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* ReThrowInstr::MakeLocationSummary() const {
|
| +LocationSummary* ReThrowInstr::MakeLocationSummary(bool opt) const {
|
| return new LocationSummary(0, 0, LocationSummary::kCall);
|
| }
|
|
|
| @@ -3786,7 +3977,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* GotoInstr::MakeLocationSummary() const {
|
| +LocationSummary* GotoInstr::MakeLocationSummary(bool opt) const {
|
| return new LocationSummary(0, 0, LocationSummary::kNoCall);
|
| }
|
|
|
| @@ -3816,7 +4007,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* CurrentContextInstr::MakeLocationSummary() const {
|
| +LocationSummary* CurrentContextInstr::MakeLocationSummary(bool opt) const {
|
| return LocationSummary::Make(0,
|
| Location::RequiresRegister(),
|
| LocationSummary::kNoCall);
|
| @@ -3828,7 +4019,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* StrictCompareInstr::MakeLocationSummary() const {
|
| +LocationSummary* StrictCompareInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = 0;
|
| if (needs_number_check()) {
|
| @@ -3910,7 +4101,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* BooleanNegateInstr::MakeLocationSummary() const {
|
| +LocationSummary* BooleanNegateInstr::MakeLocationSummary(bool opt) const {
|
| return LocationSummary::Make(1,
|
| Location::RequiresRegister(),
|
| LocationSummary::kNoCall);
|
| @@ -3928,7 +4119,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* StoreVMFieldInstr::MakeLocationSummary() const {
|
| +LocationSummary* StoreVMFieldInstr::MakeLocationSummary(bool opt) const {
|
| const intptr_t kNumInputs = 2;
|
| const intptr_t kNumTemps = 0;
|
| LocationSummary* locs =
|
| @@ -3954,7 +4145,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* AllocateObjectInstr::MakeLocationSummary() const {
|
| +LocationSummary* AllocateObjectInstr::MakeLocationSummary(bool opt) const {
|
| return MakeCallSummary();
|
| }
|
|
|
| @@ -3972,7 +4163,7 @@
|
| }
|
|
|
|
|
| -LocationSummary* CreateClosureInstr::MakeLocationSummary() const {
|
| +LocationSummary* CreateClosureInstr::MakeLocationSummary(bool opt) const {
|
| return MakeCallSummary();
|
| }
|
|
|
|
|