| 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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 // Don't untag smi-index and use TIMES_1 for two byte strings. | 1117 // Don't untag smi-index and use TIMES_1 for two byte strings. |
| 1118 __ movzxw(result, FieldAddress(str, | 1118 __ movzxw(result, FieldAddress(str, |
| 1119 index, | 1119 index, |
| 1120 TIMES_1, | 1120 TIMES_1, |
| 1121 TwoByteString::data_offset())); | 1121 TwoByteString::data_offset())); |
| 1122 __ SmiTag(result); | 1122 __ SmiTag(result); |
| 1123 } | 1123 } |
| 1124 } | 1124 } |
| 1125 | 1125 |
| 1126 | 1126 |
| 1127 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const { |
| 1128 const intptr_t kNumInputs = 1; |
| 1129 const intptr_t kNumTemps = 0; |
| 1130 LocationSummary* locs = |
| 1131 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1132 // TODO(fschneider): Allow immediate operands for the char code. |
| 1133 locs->set_in(0, Location::RequiresRegister()); |
| 1134 locs->set_out(Location::RequiresRegister()); |
| 1135 return locs; |
| 1136 } |
| 1137 |
| 1138 |
| 1139 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1140 Register char_code = locs()->in(0).reg(); |
| 1141 Register result = locs()->out().reg(); |
| 1142 __ movl(result, |
| 1143 Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress()))); |
| 1144 __ movl(result, Address(result, |
| 1145 char_code, |
| 1146 TIMES_HALF_WORD_SIZE, // Char code is a smi. |
| 1147 Symbols::kNullCharId * kWordSize)); |
| 1148 } |
| 1149 |
| 1150 |
| 1127 LocationSummary* LoadIndexedInstr::MakeLocationSummary() const { | 1151 LocationSummary* LoadIndexedInstr::MakeLocationSummary() const { |
| 1128 const intptr_t kNumInputs = 2; | 1152 const intptr_t kNumInputs = 2; |
| 1129 const intptr_t kNumTemps = 0; | 1153 const intptr_t kNumTemps = 0; |
| 1130 LocationSummary* locs = | 1154 LocationSummary* locs = |
| 1131 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1155 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1132 locs->set_in(0, Location::RequiresRegister()); | 1156 locs->set_in(0, Location::RequiresRegister()); |
| 1133 locs->set_in(1, CanBeImmediateIndex(index()) | 1157 locs->set_in(1, CanBeImmediateIndex(index()) |
| 1134 ? Location::RegisterOrConstant(index()) | 1158 ? Location::RegisterOrConstant(index()) |
| 1135 : Location::RequiresRegister()); | 1159 : Location::RequiresRegister()); |
| 1136 if (representation() == kUnboxedDouble) { | 1160 if (representation() == kUnboxedDouble) { |
| (...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2728 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. | 2752 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. |
| 2729 __ pxor(value, XMM0); | 2753 __ pxor(value, XMM0); |
| 2730 } | 2754 } |
| 2731 | 2755 |
| 2732 | 2756 |
| 2733 } // namespace dart | 2757 } // namespace dart |
| 2734 | 2758 |
| 2735 #undef __ | 2759 #undef __ |
| 2736 | 2760 |
| 2737 #endif // defined TARGET_ARCH_X64 | 2761 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |