| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 231 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
| 232 deopt_id_after, | 232 deopt_id_after, |
| 233 token_pos()); | 233 token_pos()); |
| 234 } | 234 } |
| 235 __ Drop(argument_count); | 235 __ Drop(argument_count); |
| 236 } | 236 } |
| 237 | 237 |
| 238 | 238 |
| 239 LocationSummary* LoadLocalInstr::MakeLocationSummary(Isolate* isolate, | 239 LocationSummary* LoadLocalInstr::MakeLocationSummary(Isolate* isolate, |
| 240 bool opt) const { | 240 bool opt) const { |
| 241 return LocationSummary::Make(0, | 241 return LocationSummary::Make(isolate, |
| 242 0, |
| 242 Location::RequiresRegister(), | 243 Location::RequiresRegister(), |
| 243 LocationSummary::kNoCall); | 244 LocationSummary::kNoCall); |
| 244 } | 245 } |
| 245 | 246 |
| 246 | 247 |
| 247 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 248 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 248 const Register result = locs()->out(0).reg(); | 249 const Register result = locs()->out(0).reg(); |
| 249 __ LoadFromOffset(result, FP, local().index() * kWordSize, PP); | 250 __ LoadFromOffset(result, FP, local().index() * kWordSize, PP); |
| 250 } | 251 } |
| 251 | 252 |
| 252 | 253 |
| 253 LocationSummary* StoreLocalInstr::MakeLocationSummary(Isolate* isolate, | 254 LocationSummary* StoreLocalInstr::MakeLocationSummary(Isolate* isolate, |
| 254 bool opt) const { | 255 bool opt) const { |
| 255 return LocationSummary::Make(1, | 256 return LocationSummary::Make(isolate, |
| 257 1, |
| 256 Location::SameAsFirstInput(), | 258 Location::SameAsFirstInput(), |
| 257 LocationSummary::kNoCall); | 259 LocationSummary::kNoCall); |
| 258 } | 260 } |
| 259 | 261 |
| 260 | 262 |
| 261 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 263 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 262 const Register value = locs()->in(0).reg(); | 264 const Register value = locs()->in(0).reg(); |
| 263 const Register result = locs()->out(0).reg(); | 265 const Register result = locs()->out(0).reg(); |
| 264 ASSERT(result == value); // Assert that register assignment is correct. | 266 ASSERT(result == value); // Assert that register assignment is correct. |
| 265 __ StoreToOffset(value, FP, local().index() * kWordSize, PP); | 267 __ StoreToOffset(value, FP, local().index() * kWordSize, PP); |
| 266 } | 268 } |
| 267 | 269 |
| 268 | 270 |
| 269 LocationSummary* ConstantInstr::MakeLocationSummary(Isolate* isolate, | 271 LocationSummary* ConstantInstr::MakeLocationSummary(Isolate* isolate, |
| 270 bool opt) const { | 272 bool opt) const { |
| 271 return LocationSummary::Make(0, | 273 return LocationSummary::Make(isolate, |
| 274 0, |
| 272 Location::RequiresRegister(), | 275 Location::RequiresRegister(), |
| 273 LocationSummary::kNoCall); | 276 LocationSummary::kNoCall); |
| 274 } | 277 } |
| 275 | 278 |
| 276 | 279 |
| 277 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 280 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 278 // The register allocator drops constant definitions that have no uses. | 281 // The register allocator drops constant definitions that have no uses. |
| 279 if (!locs()->out(0).IsInvalid()) { | 282 if (!locs()->out(0).IsInvalid()) { |
| 280 const Register result = locs()->out(0).reg(); | 283 const Register result = locs()->out(0).reg(); |
| 281 __ LoadObject(result, value(), PP); | 284 __ LoadObject(result, value(), PP); |
| 282 } | 285 } |
| 283 } | 286 } |
| 284 | 287 |
| 285 | 288 |
| 286 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Isolate* isolate, | 289 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Isolate* isolate, |
| 287 bool opt) const { | 290 bool opt) const { |
| 288 const intptr_t kNumInputs = 0; | 291 const intptr_t kNumInputs = 0; |
| 289 return LocationSummary::Make(kNumInputs, | 292 return LocationSummary::Make(isolate, |
| 293 kNumInputs, |
| 290 Location::RequiresFpuRegister(), | 294 Location::RequiresFpuRegister(), |
| 291 LocationSummary::kNoCall); | 295 LocationSummary::kNoCall); |
| 292 } | 296 } |
| 293 | 297 |
| 294 | 298 |
| 295 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 299 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 296 if (!locs()->out(0).IsInvalid()) { | 300 if (!locs()->out(0).IsInvalid()) { |
| 297 const VRegister dst = locs()->out(0).fpu_reg(); | 301 const VRegister dst = locs()->out(0).fpu_reg(); |
| 298 __ LoadDImmediate(dst, Double::Cast(value()).value(), PP); | 302 __ LoadDImmediate(dst, Double::Cast(value()).value(), PP); |
| 299 } | 303 } |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 PcDescriptors::kOther, | 798 PcDescriptors::kOther, |
| 795 locs()); | 799 locs()); |
| 796 __ Pop(result); | 800 __ Pop(result); |
| 797 } | 801 } |
| 798 | 802 |
| 799 | 803 |
| 800 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate, | 804 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate, |
| 801 bool opt) const { | 805 bool opt) const { |
| 802 const intptr_t kNumInputs = 1; | 806 const intptr_t kNumInputs = 1; |
| 803 // TODO(fschneider): Allow immediate operands for the char code. | 807 // TODO(fschneider): Allow immediate operands for the char code. |
| 804 return LocationSummary::Make(kNumInputs, | 808 return LocationSummary::Make(isolate, |
| 809 kNumInputs, |
| 805 Location::RequiresRegister(), | 810 Location::RequiresRegister(), |
| 806 LocationSummary::kNoCall); | 811 LocationSummary::kNoCall); |
| 807 } | 812 } |
| 808 | 813 |
| 809 | 814 |
| 810 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 815 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 811 const Register char_code = locs()->in(0).reg(); | 816 const Register char_code = locs()->in(0).reg(); |
| 812 const Register result = locs()->out(0).reg(); | 817 const Register result = locs()->out(0).reg(); |
| 813 __ LoadImmediate( | 818 __ LoadImmediate( |
| 814 result, reinterpret_cast<uword>(Symbols::PredefinedAddress()), PP); | 819 result, reinterpret_cast<uword>(Symbols::PredefinedAddress()), PP); |
| 815 __ AddImmediate( | 820 __ AddImmediate( |
| 816 result, result, Symbols::kNullCharCodeSymbolOffset * kWordSize, PP); | 821 result, result, Symbols::kNullCharCodeSymbolOffset * kWordSize, PP); |
| 817 __ Asr(TMP, char_code, kSmiTagShift); // Untag to use scaled adress mode. | 822 __ Asr(TMP, char_code, kSmiTagShift); // Untag to use scaled adress mode. |
| 818 __ ldr(result, Address(result, TMP, UXTX, Address::Scaled)); | 823 __ ldr(result, Address(result, TMP, UXTX, Address::Scaled)); |
| 819 } | 824 } |
| 820 | 825 |
| 821 | 826 |
| 822 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Isolate* isolate, | 827 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Isolate* isolate, |
| 823 bool opt) const { | 828 bool opt) const { |
| 824 const intptr_t kNumInputs = 1; | 829 const intptr_t kNumInputs = 1; |
| 825 return LocationSummary::Make(kNumInputs, | 830 return LocationSummary::Make(isolate, |
| 831 kNumInputs, |
| 826 Location::RequiresRegister(), | 832 Location::RequiresRegister(), |
| 827 LocationSummary::kNoCall); | 833 LocationSummary::kNoCall); |
| 828 } | 834 } |
| 829 | 835 |
| 830 | 836 |
| 831 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 837 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 832 ASSERT(cid_ == kOneByteStringCid); | 838 ASSERT(cid_ == kOneByteStringCid); |
| 833 const Register str = locs()->in(0).reg(); | 839 const Register str = locs()->in(0).reg(); |
| 834 const Register result = locs()->out(0).reg(); | 840 const Register result = locs()->out(0).reg(); |
| 835 __ LoadFieldFromOffset(result, str, String::length_offset(), PP); | 841 __ LoadFieldFromOffset(result, str, String::length_offset(), PP); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 864 kNumberOfArguments, | 870 kNumberOfArguments, |
| 865 kNoArgumentNames, | 871 kNoArgumentNames, |
| 866 locs()); | 872 locs()); |
| 867 ASSERT(locs()->out(0).reg() == R0); | 873 ASSERT(locs()->out(0).reg() == R0); |
| 868 } | 874 } |
| 869 | 875 |
| 870 | 876 |
| 871 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, | 877 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, |
| 872 bool opt) const { | 878 bool opt) const { |
| 873 const intptr_t kNumInputs = 1; | 879 const intptr_t kNumInputs = 1; |
| 874 return LocationSummary::Make(kNumInputs, | 880 return LocationSummary::Make(isolate, |
| 881 kNumInputs, |
| 875 Location::RequiresRegister(), | 882 Location::RequiresRegister(), |
| 876 LocationSummary::kNoCall); | 883 LocationSummary::kNoCall); |
| 877 } | 884 } |
| 878 | 885 |
| 879 | 886 |
| 880 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 887 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 881 const Register object = locs()->in(0).reg(); | 888 const Register object = locs()->in(0).reg(); |
| 882 const Register result = locs()->out(0).reg(); | 889 const Register result = locs()->out(0).reg(); |
| 883 __ LoadFieldFromOffset(result, object, offset(), PP); | 890 __ LoadFieldFromOffset(result, object, offset(), PP); |
| 884 } | 891 } |
| 885 | 892 |
| 886 | 893 |
| 887 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, | 894 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, |
| 888 bool opt) const { | 895 bool opt) const { |
| 889 const intptr_t kNumInputs = 1; | 896 const intptr_t kNumInputs = 1; |
| 890 return LocationSummary::Make(kNumInputs, | 897 return LocationSummary::Make(isolate, |
| 898 kNumInputs, |
| 891 Location::RequiresRegister(), | 899 Location::RequiresRegister(), |
| 892 LocationSummary::kNoCall); | 900 LocationSummary::kNoCall); |
| 893 } | 901 } |
| 894 | 902 |
| 895 | 903 |
| 896 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 904 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 897 const Register object = locs()->in(0).reg(); | 905 const Register object = locs()->in(0).reg(); |
| 898 const Register result = locs()->out(0).reg(); | 906 const Register result = locs()->out(0).reg(); |
| 899 Label load, done; | 907 Label load, done; |
| 900 __ tsti(object, kSmiTagMask); | 908 __ tsti(object, kSmiTagMask); |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1683 StoreInstanceFieldSlowPath(StoreInstanceFieldInstr* instruction, | 1691 StoreInstanceFieldSlowPath(StoreInstanceFieldInstr* instruction, |
| 1684 const Class& cls) | 1692 const Class& cls) |
| 1685 : instruction_(instruction), cls_(cls) { } | 1693 : instruction_(instruction), cls_(cls) { } |
| 1686 | 1694 |
| 1687 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 1695 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1688 __ Comment("StoreInstanceFieldSlowPath"); | 1696 __ Comment("StoreInstanceFieldSlowPath"); |
| 1689 __ Bind(entry_label()); | 1697 __ Bind(entry_label()); |
| 1690 | 1698 |
| 1691 const Code& stub = | 1699 const Code& stub = |
| 1692 Code::Handle(StubCode::GetAllocationStubForClass(cls_)); | 1700 Code::Handle(StubCode::GetAllocationStubForClass(cls_)); |
| 1693 const ExternalLabel label(cls_.ToCString(), stub.EntryPoint()); | 1701 const ExternalLabel label(stub.EntryPoint()); |
| 1694 | 1702 |
| 1695 LocationSummary* locs = instruction_->locs(); | 1703 LocationSummary* locs = instruction_->locs(); |
| 1696 locs->live_registers()->Remove(locs->out(0)); | 1704 locs->live_registers()->Remove(locs->out(0)); |
| 1697 | 1705 |
| 1698 compiler->SaveLiveRegisters(locs); | 1706 compiler->SaveLiveRegisters(locs); |
| 1699 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 1707 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 1700 &label, | 1708 &label, |
| 1701 PcDescriptors::kOther, | 1709 PcDescriptors::kOther, |
| 1702 locs); | 1710 locs); |
| 1703 __ mov(locs->temp(0).reg(), R0); | 1711 __ mov(locs->temp(0).reg(), R0); |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2051 public: | 2059 public: |
| 2052 explicit BoxDoubleSlowPath(Instruction* instruction) | 2060 explicit BoxDoubleSlowPath(Instruction* instruction) |
| 2053 : instruction_(instruction) { } | 2061 : instruction_(instruction) { } |
| 2054 | 2062 |
| 2055 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2063 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2056 __ Comment("BoxDoubleSlowPath"); | 2064 __ Comment("BoxDoubleSlowPath"); |
| 2057 __ Bind(entry_label()); | 2065 __ Bind(entry_label()); |
| 2058 const Class& double_class = compiler->double_class(); | 2066 const Class& double_class = compiler->double_class(); |
| 2059 const Code& stub = | 2067 const Code& stub = |
| 2060 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); | 2068 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); |
| 2061 const ExternalLabel label(double_class.ToCString(), stub.EntryPoint()); | 2069 const ExternalLabel label(stub.EntryPoint()); |
| 2062 | 2070 |
| 2063 LocationSummary* locs = instruction_->locs(); | 2071 LocationSummary* locs = instruction_->locs(); |
| 2064 locs->live_registers()->Remove(locs->out(0)); | 2072 locs->live_registers()->Remove(locs->out(0)); |
| 2065 | 2073 |
| 2066 compiler->SaveLiveRegisters(locs); | 2074 compiler->SaveLiveRegisters(locs); |
| 2067 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 2075 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 2068 &label, | 2076 &label, |
| 2069 PcDescriptors::kOther, | 2077 PcDescriptors::kOther, |
| 2070 locs); | 2078 locs); |
| 2071 __ mov(locs->out(0).reg(), R0); | 2079 __ mov(locs->out(0).reg(), R0); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2083 public: | 2091 public: |
| 2084 explicit BoxFloat32x4SlowPath(Instruction* instruction) | 2092 explicit BoxFloat32x4SlowPath(Instruction* instruction) |
| 2085 : instruction_(instruction) { } | 2093 : instruction_(instruction) { } |
| 2086 | 2094 |
| 2087 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2095 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2088 __ Comment("BoxFloat32x4SlowPath"); | 2096 __ Comment("BoxFloat32x4SlowPath"); |
| 2089 __ Bind(entry_label()); | 2097 __ Bind(entry_label()); |
| 2090 const Class& float32x4_class = compiler->float32x4_class(); | 2098 const Class& float32x4_class = compiler->float32x4_class(); |
| 2091 const Code& stub = | 2099 const Code& stub = |
| 2092 Code::Handle(StubCode::GetAllocationStubForClass(float32x4_class)); | 2100 Code::Handle(StubCode::GetAllocationStubForClass(float32x4_class)); |
| 2093 const ExternalLabel label(float32x4_class.ToCString(), stub.EntryPoint()); | 2101 const ExternalLabel label(stub.EntryPoint()); |
| 2094 | 2102 |
| 2095 LocationSummary* locs = instruction_->locs(); | 2103 LocationSummary* locs = instruction_->locs(); |
| 2096 locs->live_registers()->Remove(locs->out(0)); | 2104 locs->live_registers()->Remove(locs->out(0)); |
| 2097 | 2105 |
| 2098 compiler->SaveLiveRegisters(locs); | 2106 compiler->SaveLiveRegisters(locs); |
| 2099 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 2107 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 2100 &label, | 2108 &label, |
| 2101 PcDescriptors::kOther, | 2109 PcDescriptors::kOther, |
| 2102 locs); | 2110 locs); |
| 2103 __ mov(locs->out(0).reg(), R0); | 2111 __ mov(locs->out(0).reg(), R0); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2115 public: | 2123 public: |
| 2116 explicit BoxFloat64x2SlowPath(Instruction* instruction) | 2124 explicit BoxFloat64x2SlowPath(Instruction* instruction) |
| 2117 : instruction_(instruction) { } | 2125 : instruction_(instruction) { } |
| 2118 | 2126 |
| 2119 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2127 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2120 __ Comment("BoxFloat64x2SlowPath"); | 2128 __ Comment("BoxFloat64x2SlowPath"); |
| 2121 __ Bind(entry_label()); | 2129 __ Bind(entry_label()); |
| 2122 const Class& float64x2_class = compiler->float64x2_class(); | 2130 const Class& float64x2_class = compiler->float64x2_class(); |
| 2123 const Code& stub = | 2131 const Code& stub = |
| 2124 Code::Handle(StubCode::GetAllocationStubForClass(float64x2_class)); | 2132 Code::Handle(StubCode::GetAllocationStubForClass(float64x2_class)); |
| 2125 const ExternalLabel label(float64x2_class.ToCString(), stub.EntryPoint()); | 2133 const ExternalLabel label(stub.EntryPoint()); |
| 2126 | 2134 |
| 2127 LocationSummary* locs = instruction_->locs(); | 2135 LocationSummary* locs = instruction_->locs(); |
| 2128 locs->live_registers()->Remove(locs->out(0)); | 2136 locs->live_registers()->Remove(locs->out(0)); |
| 2129 | 2137 |
| 2130 compiler->SaveLiveRegisters(locs); | 2138 compiler->SaveLiveRegisters(locs); |
| 2131 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 2139 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 2132 &label, | 2140 &label, |
| 2133 PcDescriptors::kOther, | 2141 PcDescriptors::kOther, |
| 2134 locs); | 2142 locs); |
| 2135 __ mov(locs->out(0).reg(), R0); | 2143 __ mov(locs->out(0).reg(), R0); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2393 locs->set_out(0, Location::RegisterLocation(R0)); | 2401 locs->set_out(0, Location::RegisterLocation(R0)); |
| 2394 return locs; | 2402 return locs; |
| 2395 } | 2403 } |
| 2396 | 2404 |
| 2397 | 2405 |
| 2398 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2406 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2399 ASSERT(locs()->temp(0).reg() == R1); | 2407 ASSERT(locs()->temp(0).reg() == R1); |
| 2400 ASSERT(locs()->out(0).reg() == R0); | 2408 ASSERT(locs()->out(0).reg() == R0); |
| 2401 | 2409 |
| 2402 __ LoadImmediate(R1, num_context_variables(), PP); | 2410 __ LoadImmediate(R1, num_context_variables(), PP); |
| 2403 const ExternalLabel label("alloc_context", | 2411 const ExternalLabel label(StubCode::AllocateContextEntryPoint()); |
| 2404 StubCode::AllocateContextEntryPoint()); | |
| 2405 compiler->GenerateCall(token_pos(), | 2412 compiler->GenerateCall(token_pos(), |
| 2406 &label, | 2413 &label, |
| 2407 PcDescriptors::kOther, | 2414 PcDescriptors::kOther, |
| 2408 locs()); | 2415 locs()); |
| 2409 } | 2416 } |
| 2410 | 2417 |
| 2411 | 2418 |
| 2412 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, | 2419 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, |
| 2413 bool opt) const { | 2420 bool opt) const { |
| 2414 const intptr_t kNumInputs = 1; | 2421 const intptr_t kNumInputs = 1; |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3267 public: | 3274 public: |
| 3268 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) | 3275 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) |
| 3269 : instruction_(instruction) { } | 3276 : instruction_(instruction) { } |
| 3270 | 3277 |
| 3271 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 3278 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3272 __ Comment("BoxInt32x4SlowPath"); | 3279 __ Comment("BoxInt32x4SlowPath"); |
| 3273 __ Bind(entry_label()); | 3280 __ Bind(entry_label()); |
| 3274 const Class& int32x4_class = compiler->int32x4_class(); | 3281 const Class& int32x4_class = compiler->int32x4_class(); |
| 3275 const Code& stub = | 3282 const Code& stub = |
| 3276 Code::Handle(StubCode::GetAllocationStubForClass(int32x4_class)); | 3283 Code::Handle(StubCode::GetAllocationStubForClass(int32x4_class)); |
| 3277 const ExternalLabel label(int32x4_class.ToCString(), stub.EntryPoint()); | 3284 const ExternalLabel label(stub.EntryPoint()); |
| 3278 | 3285 |
| 3279 LocationSummary* locs = instruction_->locs(); | 3286 LocationSummary* locs = instruction_->locs(); |
| 3280 locs->live_registers()->Remove(locs->out(0)); | 3287 locs->live_registers()->Remove(locs->out(0)); |
| 3281 | 3288 |
| 3282 compiler->SaveLiveRegisters(locs); | 3289 compiler->SaveLiveRegisters(locs); |
| 3283 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 3290 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 3284 &label, | 3291 &label, |
| 3285 PcDescriptors::kOther, | 3292 PcDescriptors::kOther, |
| 3286 locs); | 3293 locs); |
| 3287 __ mov(locs->out(0).reg(), R0); | 3294 __ mov(locs->out(0).reg(), R0); |
| (...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5147 // We can fall through if the successor is the next block in the list. | 5154 // We can fall through if the successor is the next block in the list. |
| 5148 // Otherwise, we need a jump. | 5155 // Otherwise, we need a jump. |
| 5149 if (!compiler->CanFallThroughTo(successor())) { | 5156 if (!compiler->CanFallThroughTo(successor())) { |
| 5150 __ b(compiler->GetJumpLabel(successor())); | 5157 __ b(compiler->GetJumpLabel(successor())); |
| 5151 } | 5158 } |
| 5152 } | 5159 } |
| 5153 | 5160 |
| 5154 | 5161 |
| 5155 LocationSummary* CurrentContextInstr::MakeLocationSummary(Isolate* isolate, | 5162 LocationSummary* CurrentContextInstr::MakeLocationSummary(Isolate* isolate, |
| 5156 bool opt) const { | 5163 bool opt) const { |
| 5157 return LocationSummary::Make(0, | 5164 return LocationSummary::Make(isolate, |
| 5165 0, |
| 5158 Location::RequiresRegister(), | 5166 Location::RequiresRegister(), |
| 5159 LocationSummary::kNoCall); | 5167 LocationSummary::kNoCall); |
| 5160 } | 5168 } |
| 5161 | 5169 |
| 5162 | 5170 |
| 5163 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5171 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5164 __ mov(locs()->out(0).reg(), CTX); | 5172 __ mov(locs()->out(0).reg(), CTX); |
| 5165 } | 5173 } |
| 5166 | 5174 |
| 5167 | 5175 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5241 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); | 5249 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); |
| 5242 | 5250 |
| 5243 BranchLabels labels = compiler->CreateBranchLabels(branch); | 5251 BranchLabels labels = compiler->CreateBranchLabels(branch); |
| 5244 Condition true_condition = EmitComparisonCode(compiler, labels); | 5252 Condition true_condition = EmitComparisonCode(compiler, labels); |
| 5245 EmitBranchOnCondition(compiler, true_condition, labels); | 5253 EmitBranchOnCondition(compiler, true_condition, labels); |
| 5246 } | 5254 } |
| 5247 | 5255 |
| 5248 | 5256 |
| 5249 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate, | 5257 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate, |
| 5250 bool opt) const { | 5258 bool opt) const { |
| 5251 return LocationSummary::Make(1, | 5259 return LocationSummary::Make(isolate, |
| 5260 1, |
| 5252 Location::RequiresRegister(), | 5261 Location::RequiresRegister(), |
| 5253 LocationSummary::kNoCall); | 5262 LocationSummary::kNoCall); |
| 5254 } | 5263 } |
| 5255 | 5264 |
| 5256 | 5265 |
| 5257 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5266 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5258 const Register value = locs()->in(0).reg(); | 5267 const Register value = locs()->in(0).reg(); |
| 5259 const Register result = locs()->out(0).reg(); | 5268 const Register result = locs()->out(0).reg(); |
| 5260 | 5269 |
| 5261 __ LoadObject(result, Bool::True(), PP); | 5270 __ LoadObject(result, Bool::True(), PP); |
| 5262 __ LoadObject(TMP, Bool::False(), PP); | 5271 __ LoadObject(TMP, Bool::False(), PP); |
| 5263 __ CompareRegisters(result, value); | 5272 __ CompareRegisters(result, value); |
| 5264 __ csel(result, TMP, result, EQ); | 5273 __ csel(result, TMP, result, EQ); |
| 5265 } | 5274 } |
| 5266 | 5275 |
| 5267 | 5276 |
| 5268 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Isolate* isolate, | 5277 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Isolate* isolate, |
| 5269 bool opt) const { | 5278 bool opt) const { |
| 5270 return MakeCallSummary(); | 5279 return MakeCallSummary(); |
| 5271 } | 5280 } |
| 5272 | 5281 |
| 5273 | 5282 |
| 5274 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5283 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5275 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); | 5284 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); |
| 5276 const ExternalLabel label(cls().ToCString(), stub.EntryPoint()); | 5285 const ExternalLabel label(stub.EntryPoint()); |
| 5277 compiler->GenerateCall(token_pos(), | 5286 compiler->GenerateCall(token_pos(), |
| 5278 &label, | 5287 &label, |
| 5279 PcDescriptors::kOther, | 5288 PcDescriptors::kOther, |
| 5280 locs()); | 5289 locs()); |
| 5281 __ Drop(ArgumentCount()); // Discard arguments. | 5290 __ Drop(ArgumentCount()); // Discard arguments. |
| 5282 } | 5291 } |
| 5283 | 5292 |
| 5284 } // namespace dart | 5293 } // namespace dart |
| 5285 | 5294 |
| 5286 #endif // defined TARGET_ARCH_ARM64 | 5295 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |