| Index: runtime/vm/intermediate_language_x64.cc
|
| diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
|
| index 81bfe23f18da5b05b4e7fd57959a8bdec1edd005..da4b4c2d825721ea12b7d7ea680811839c812681 100644
|
| --- a/runtime/vm/intermediate_language_x64.cc
|
| +++ b/runtime/vm/intermediate_language_x64.cc
|
| @@ -5697,7 +5697,8 @@ void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Label* deopt = compiler->AddDeoptStub(deopt_id(),
|
| ICData::kDeoptCheckSmi,
|
| licm_hoisted_ ? ICData::kHoisted : 0);
|
| - __ BranchIfNotSmi(value, deopt);
|
| + __ testq(value, Immediate(kSmiTagMask));
|
| + __ j(NOT_ZERO, deopt);
|
| }
|
|
|
|
|
| @@ -5720,70 +5721,6 @@ void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| }
|
|
|
|
|
| -LocationSummary* GenericCheckBoundInstr::MakeLocationSummary(Zone* zone,
|
| - bool opt) const {
|
| - const intptr_t kNumInputs = 2;
|
| - const intptr_t kNumTemps = 0;
|
| - LocationSummary* locs = new(zone) LocationSummary(
|
| - zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
|
| - locs->set_in(kLengthPos, Location::RequiresRegister());
|
| - locs->set_in(kIndexPos, Location::RequiresRegister());
|
| - return locs;
|
| -}
|
| -
|
| -
|
| -class RangeErrorSlowPath : public SlowPathCode {
|
| - public:
|
| - RangeErrorSlowPath(GenericCheckBoundInstr* instruction, intptr_t try_index)
|
| - : instruction_(instruction), try_index_(try_index) { }
|
| -
|
| - virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
|
| - if (Assembler::EmittingComments()) {
|
| - __ Comment("slow path check bound operation");
|
| - }
|
| - __ Bind(entry_label());
|
| - LocationSummary* locs = instruction_->locs();
|
| - __ pushq(locs->in(0).reg());
|
| - __ pushq(locs->in(1).reg());
|
| - compiler->GenerateRuntimeCall(instruction_->token_pos(),
|
| - instruction_->deopt_id(),
|
| - kRangeErrorRuntimeEntry,
|
| - 2,
|
| - instruction_->locs());
|
| - compiler->RecordSafepoint(locs, /* slow_path_argument_count = */ 2);
|
| - compiler->pc_descriptors_list()->AddDescriptor(
|
| - RawPcDescriptors::kOther,
|
| - compiler->assembler()->CodeSize(),
|
| - instruction_->deopt_id(),
|
| - instruction_->token_pos(),
|
| - try_index_);
|
| - __ int3();
|
| - }
|
| -
|
| - private:
|
| - GenericCheckBoundInstr* instruction_;
|
| - intptr_t try_index_;
|
| -};
|
| -
|
| -
|
| -void GenericCheckBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| - RangeErrorSlowPath* slow_path =
|
| - new RangeErrorSlowPath(this, compiler->CurrentTryIndex());
|
| - compiler->AddSlowPathCode(slow_path);
|
| -
|
| - Location length_loc = locs()->in(kLengthPos);
|
| - Location index_loc = locs()->in(kIndexPos);
|
| - Register length = length_loc.reg();
|
| - Register index = index_loc.reg();
|
| - const intptr_t index_cid = this->index()->Type()->ToCid();
|
| - if (index_cid != kSmiCid) {
|
| - __ BranchIfNotSmi(index, slow_path->entry_label());
|
| - }
|
| - __ cmpq(index, length);
|
| - __ j(ABOVE_EQUAL, slow_path->entry_label());
|
| -}
|
| -
|
| -
|
| LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(Zone* zone,
|
| bool opt) const {
|
| const intptr_t kNumInputs = 2;
|
| @@ -5817,7 +5754,6 @@ void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| return;
|
| }
|
|
|
| - const intptr_t index_cid = index()->Type()->ToCid();
|
| if (index_loc.IsConstant()) {
|
| Register length = length_loc.reg();
|
| const Smi& index = Smi::Cast(index_loc.constant());
|
| @@ -5827,9 +5763,6 @@ void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| } else if (length_loc.IsConstant()) {
|
| const Smi& length = Smi::Cast(length_loc.constant());
|
| Register index = index_loc.reg();
|
| - if (index_cid != kSmiCid) {
|
| - __ BranchIfNotSmi(index, deopt);
|
| - }
|
| if (length.Value() == Smi::kMaxValue) {
|
| __ testq(index, index);
|
| __ j(NEGATIVE, deopt);
|
| @@ -5841,9 +5774,6 @@ void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| } else {
|
| Register length = length_loc.reg();
|
| Register index = index_loc.reg();
|
| - if (index_cid != kSmiCid) {
|
| - __ BranchIfNotSmi(index, deopt);
|
| - }
|
| __ cmpq(index, length);
|
| __ j(ABOVE_EQUAL, deopt);
|
| }
|
|
|