| Index: runtime/vm/intermediate_language_ia32.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language_ia32.cc (revision 8372)
|
| +++ runtime/vm/intermediate_language_ia32.cc (working copy)
|
| @@ -20,7 +20,6 @@
|
| DECLARE_FLAG(int, optimization_counter_threshold);
|
| 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() {
|
| @@ -298,7 +297,7 @@
|
|
|
| LocationSummary* InstanceSetterComp::MakeLocationSummary() const {
|
| const intptr_t kNumInputs = 2;
|
| - return LocationSummary::Make(kNumInputs, Location::RequiresRegister());
|
| + return LocationSummary::Make(kNumInputs, Location::NoLocation());
|
| return NULL;
|
| }
|
|
|
| @@ -306,16 +305,12 @@
|
| 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.
|
| - __ pushl(value);
|
| __ pushl(receiver);
|
| __ pushl(value);
|
| const intptr_t kArgumentCount = 2;
|
| @@ -327,7 +322,6 @@
|
| kArgumentCount,
|
| Array::ZoneHandle(),
|
| kCheckedArgumentCount);
|
| - __ popl(result);
|
| }
|
|
|
|
|
| @@ -342,12 +336,32 @@
|
|
|
|
|
| LocationSummary* LoadInstanceFieldComp::MakeLocationSummary() const {
|
| - return NULL;
|
| + // 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
|
| + // this information to the input policy.
|
| + return LocationSummary::Make(1, Location::RequiresRegister());
|
| }
|
|
|
|
|
| void LoadInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| - UNIMPLEMENTED();
|
| + 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);
|
| + }
|
| + __ movl(result, FieldAddress(instance, field().Offset()));
|
| }
|
|
|
|
|
|
|