| 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 token_pos(), | 1013 token_pos(), |
| 1014 try_index(), | 1014 try_index(), |
| 1015 function_name, | 1015 function_name, |
| 1016 kArgumentCount, | 1016 kArgumentCount, |
| 1017 Array::ZoneHandle(), | 1017 Array::ZoneHandle(), |
| 1018 kCheckedArgumentCount); | 1018 kCheckedArgumentCount); |
| 1019 } | 1019 } |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 | 1022 |
| 1023 LocationSummary* StaticSetterComp::MakeLocationSummary() const { | |
| 1024 const intptr_t kNumInputs = 1; | |
| 1025 return LocationSummary::Make(kNumInputs, | |
| 1026 Location::RequiresRegister(), | |
| 1027 LocationSummary::kNoCall); | |
| 1028 } | |
| 1029 | |
| 1030 | |
| 1031 void StaticSetterComp::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 1032 Register value = locs()->in(0).reg(); | |
| 1033 Register result = locs()->out().reg(); | |
| 1034 | |
| 1035 // Preserve the argument as the result of the computation, | |
| 1036 // then call the setter. | |
| 1037 | |
| 1038 // Duplicate the argument. | |
| 1039 // TODO(fschneider): Avoid preserving the value if the result is not used. | |
| 1040 __ pushq(value); | |
| 1041 __ pushq(value); | |
| 1042 compiler->GenerateStaticCall(cid(), | |
| 1043 token_pos(), | |
| 1044 try_index(), | |
| 1045 setter_function(), | |
| 1046 1, | |
| 1047 Array::ZoneHandle()); | |
| 1048 __ popq(result); | |
| 1049 } | |
| 1050 | |
| 1051 | |
| 1052 LocationSummary* LoadInstanceFieldComp::MakeLocationSummary() const { | 1023 LocationSummary* LoadInstanceFieldComp::MakeLocationSummary() const { |
| 1053 // TODO(fschneider): For this instruction the input register may be | 1024 // TODO(fschneider): For this instruction the input register may be |
| 1054 // reused for the result (but is not required to) because the input | 1025 // reused for the result (but is not required to) because the input |
| 1055 // is not used after the result is defined. We should consider adding | 1026 // is not used after the result is defined. We should consider adding |
| 1056 // this information to the input policy. | 1027 // this information to the input policy. |
| 1057 return LocationSummary::Make(1, | 1028 return LocationSummary::Make(1, |
| 1058 Location::RequiresRegister(), | 1029 Location::RequiresRegister(), |
| 1059 LocationSummary::kNoCall); | 1030 LocationSummary::kNoCall); |
| 1060 } | 1031 } |
| 1061 | 1032 |
| (...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2203 ASSERT(locs()->out().reg() == RAX); | 2174 ASSERT(locs()->out().reg() == RAX); |
| 2204 __ CompareObject(locs()->out().reg(), compiler->bool_true()); | 2175 __ CompareObject(locs()->out().reg(), compiler->bool_true()); |
| 2205 EmitBranchOnCondition(compiler, branch_condition); | 2176 EmitBranchOnCondition(compiler, branch_condition); |
| 2206 } | 2177 } |
| 2207 | 2178 |
| 2208 } // namespace dart | 2179 } // namespace dart |
| 2209 | 2180 |
| 2210 #undef __ | 2181 #undef __ |
| 2211 | 2182 |
| 2212 #endif // defined TARGET_ARCH_X64 | 2183 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |