| Index: runtime/vm/intermediate_language_x64.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language_x64.cc (revision 8404)
|
| +++ runtime/vm/intermediate_language_x64.cc (working copy)
|
| @@ -21,7 +21,6 @@
|
| DECLARE_FLAG(int, optimization_counter_threshold);
|
| DECLARE_FLAG(bool, trace_functions);
|
|
|
| -
|
| void BindInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| computation()->EmitNativeCode(compiler);
|
| __ pushq(locs()->out().reg());
|
| @@ -309,7 +308,7 @@
|
|
|
| LocationSummary* InstanceSetterComp::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 2;
|
| - return LocationSummary::Make(kNumInputs, Location::RequiresRegister());
|
| + return LocationSummary::Make(kNumInputs, Location::NoLocation());
|
| return NULL;
|
| }
|
|
|
| @@ -317,18 +316,18 @@
|
| void InstanceSetterComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register receiver = locs()->in(0).reg();
|
| Register value = locs()->in(1).reg();
|
| - Register result = locs()->out().reg();
|
|
|
| // Preserve the value (second argument) under the arguments as the result
|
| // of the computation, then call the setter.
|
| const String& function_name =
|
| String::ZoneHandle(Field::SetterSymbol(field_name()));
|
|
|
| - // Insert a copy of the second (last) argument under the arguments.
|
| - // TODO(fschneider): Avoid preserving the value if the result is not used.
|
| - __ pushq(value);
|
| __ pushq(receiver);
|
| __ pushq(value);
|
| + compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
|
| + cid(),
|
| + token_index(),
|
| + try_index());
|
| const intptr_t kArgumentCount = 2;
|
| const intptr_t kCheckedArgumentCount = 1;
|
| compiler->GenerateInstanceCall(cid(),
|
| @@ -338,7 +337,6 @@
|
| kArgumentCount,
|
| Array::ZoneHandle(),
|
| kCheckedArgumentCount);
|
| - __ popq(result);
|
| }
|
|
|
|
|
| @@ -382,6 +380,19 @@
|
| Register instance = locs()->in(0).reg();
|
| Register result = locs()->out().reg();
|
|
|
| + if (class_ids() != NULL) {
|
| + ASSERT(original() != NULL);
|
| + Label* deopt = compiler->AddDeoptStub(original()->cid(),
|
| + original()->token_index(),
|
| + original()->try_index(),
|
| + kDeoptInstanceGetterSameTarget,
|
| + instance,
|
| + kNoRegister);
|
| + // Smis do not have instance fields (Smi class is always first).
|
| + // Use 'result' as temporary register.
|
| + ASSERT(result != instance);
|
| + compiler->EmitClassChecksNoSmi(*class_ids(), instance, result, deopt);
|
| + }
|
| __ movq(result, FieldAddress(instance, field().Offset()));
|
| }
|
|
|
|
|