| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 token_pos(), | 999 token_pos(), |
| 1000 try_index(), | 1000 try_index(), |
| 1001 function_name, | 1001 function_name, |
| 1002 kArgumentCount, | 1002 kArgumentCount, |
| 1003 Array::ZoneHandle(), | 1003 Array::ZoneHandle(), |
| 1004 kCheckedArgumentCount); | 1004 kCheckedArgumentCount); |
| 1005 } | 1005 } |
| 1006 } | 1006 } |
| 1007 | 1007 |
| 1008 | 1008 |
| 1009 LocationSummary* StaticSetterComp::MakeLocationSummary() const { | |
| 1010 const intptr_t kNumInputs = 1; | |
| 1011 return LocationSummary::Make(kNumInputs, | |
| 1012 Location::RequiresRegister(), | |
| 1013 LocationSummary::kNoCall); | |
| 1014 } | |
| 1015 | |
| 1016 | |
| 1017 void StaticSetterComp::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 1018 Register value = locs()->in(0).reg(); | |
| 1019 Register result = locs()->out().reg(); | |
| 1020 | |
| 1021 // Preserve the argument as the result of the computation, | |
| 1022 // then call the setter. | |
| 1023 | |
| 1024 // Duplicate the argument. | |
| 1025 // TODO(fschneider): Avoid preserving the value if the result is not used. | |
| 1026 __ pushl(value); | |
| 1027 __ pushl(value); | |
| 1028 compiler->GenerateStaticCall(cid(), | |
| 1029 token_pos(), | |
| 1030 try_index(), | |
| 1031 setter_function(), | |
| 1032 1, | |
| 1033 Array::ZoneHandle()); | |
| 1034 __ popl(result); | |
| 1035 } | |
| 1036 | |
| 1037 | |
| 1038 LocationSummary* LoadInstanceFieldComp::MakeLocationSummary() const { | 1009 LocationSummary* LoadInstanceFieldComp::MakeLocationSummary() const { |
| 1039 // TODO(fschneider): For this instruction the input register may be | 1010 // TODO(fschneider): For this instruction the input register may be |
| 1040 // reused for the result (but is not required to) because the input | 1011 // reused for the result (but is not required to) because the input |
| 1041 // is not used after the result is defined. We should consider adding | 1012 // is not used after the result is defined. We should consider adding |
| 1042 // this information to the input policy. | 1013 // this information to the input policy. |
| 1043 return LocationSummary::Make(1, | 1014 return LocationSummary::Make(1, |
| 1044 Location::RequiresRegister(), | 1015 Location::RequiresRegister(), |
| 1045 LocationSummary::kNoCall); | 1016 LocationSummary::kNoCall); |
| 1046 } | 1017 } |
| 1047 | 1018 |
| (...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2196 ASSERT(locs()->out().reg() == EAX); | 2167 ASSERT(locs()->out().reg() == EAX); |
| 2197 __ CompareObject(locs()->out().reg(), compiler->bool_true()); | 2168 __ CompareObject(locs()->out().reg(), compiler->bool_true()); |
| 2198 EmitBranchOnCondition(compiler, branch_condition); | 2169 EmitBranchOnCondition(compiler, branch_condition); |
| 2199 } | 2170 } |
| 2200 | 2171 |
| 2201 } // namespace dart | 2172 } // namespace dart |
| 2202 | 2173 |
| 2203 #undef __ | 2174 #undef __ |
| 2204 | 2175 |
| 2205 #endif // defined TARGET_ARCH_X64 | 2176 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |