| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 234 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
| 235 deopt_id_after, | 235 deopt_id_after, |
| 236 token_pos()); | 236 token_pos()); |
| 237 } | 237 } |
| 238 __ Drop(argument_count); | 238 __ Drop(argument_count); |
| 239 } | 239 } |
| 240 | 240 |
| 241 | 241 |
| 242 LocationSummary* LoadLocalInstr::MakeLocationSummary(Isolate* isolate, | 242 LocationSummary* LoadLocalInstr::MakeLocationSummary(Isolate* isolate, |
| 243 bool opt) const { | 243 bool opt) const { |
| 244 return LocationSummary::Make(0, | 244 return LocationSummary::Make(isolate, |
| 245 0, |
| 245 Location::RequiresRegister(), | 246 Location::RequiresRegister(), |
| 246 LocationSummary::kNoCall); | 247 LocationSummary::kNoCall); |
| 247 } | 248 } |
| 248 | 249 |
| 249 | 250 |
| 250 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 251 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 251 const Register result = locs()->out(0).reg(); | 252 const Register result = locs()->out(0).reg(); |
| 252 __ LoadFromOffset(kWord, result, FP, local().index() * kWordSize); | 253 __ LoadFromOffset(kWord, result, FP, local().index() * kWordSize); |
| 253 } | 254 } |
| 254 | 255 |
| 255 | 256 |
| 256 LocationSummary* StoreLocalInstr::MakeLocationSummary(Isolate* isolate, | 257 LocationSummary* StoreLocalInstr::MakeLocationSummary(Isolate* isolate, |
| 257 bool opt) const { | 258 bool opt) const { |
| 258 return LocationSummary::Make(1, | 259 return LocationSummary::Make(isolate, |
| 260 1, |
| 259 Location::SameAsFirstInput(), | 261 Location::SameAsFirstInput(), |
| 260 LocationSummary::kNoCall); | 262 LocationSummary::kNoCall); |
| 261 } | 263 } |
| 262 | 264 |
| 263 | 265 |
| 264 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 266 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 265 const Register value = locs()->in(0).reg(); | 267 const Register value = locs()->in(0).reg(); |
| 266 const Register result = locs()->out(0).reg(); | 268 const Register result = locs()->out(0).reg(); |
| 267 ASSERT(result == value); // Assert that register assignment is correct. | 269 ASSERT(result == value); // Assert that register assignment is correct. |
| 268 __ str(value, Address(FP, local().index() * kWordSize)); | 270 __ str(value, Address(FP, local().index() * kWordSize)); |
| 269 } | 271 } |
| 270 | 272 |
| 271 | 273 |
| 272 LocationSummary* ConstantInstr::MakeLocationSummary(Isolate* isolate, | 274 LocationSummary* ConstantInstr::MakeLocationSummary(Isolate* isolate, |
| 273 bool opt) const { | 275 bool opt) const { |
| 274 return LocationSummary::Make(0, | 276 return LocationSummary::Make(isolate, |
| 277 0, |
| 275 Location::RequiresRegister(), | 278 Location::RequiresRegister(), |
| 276 LocationSummary::kNoCall); | 279 LocationSummary::kNoCall); |
| 277 } | 280 } |
| 278 | 281 |
| 279 | 282 |
| 280 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 283 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 281 // The register allocator drops constant definitions that have no uses. | 284 // The register allocator drops constant definitions that have no uses. |
| 282 if (!locs()->out(0).IsInvalid()) { | 285 if (!locs()->out(0).IsInvalid()) { |
| 283 const Register result = locs()->out(0).reg(); | 286 const Register result = locs()->out(0).reg(); |
| 284 __ LoadObject(result, value()); | 287 __ LoadObject(result, value()); |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 PcDescriptors::kOther, | 953 PcDescriptors::kOther, |
| 951 locs()); | 954 locs()); |
| 952 __ Pop(result); | 955 __ Pop(result); |
| 953 } | 956 } |
| 954 | 957 |
| 955 | 958 |
| 956 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate, | 959 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate, |
| 957 bool opt) const { | 960 bool opt) const { |
| 958 const intptr_t kNumInputs = 1; | 961 const intptr_t kNumInputs = 1; |
| 959 // TODO(fschneider): Allow immediate operands for the char code. | 962 // TODO(fschneider): Allow immediate operands for the char code. |
| 960 return LocationSummary::Make(kNumInputs, | 963 return LocationSummary::Make(isolate, |
| 964 kNumInputs, |
| 961 Location::RequiresRegister(), | 965 Location::RequiresRegister(), |
| 962 LocationSummary::kNoCall); | 966 LocationSummary::kNoCall); |
| 963 } | 967 } |
| 964 | 968 |
| 965 | 969 |
| 966 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 970 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 967 const Register char_code = locs()->in(0).reg(); | 971 const Register char_code = locs()->in(0).reg(); |
| 968 const Register result = locs()->out(0).reg(); | 972 const Register result = locs()->out(0).reg(); |
| 969 __ LoadImmediate(result, | 973 __ LoadImmediate(result, |
| 970 reinterpret_cast<uword>(Symbols::PredefinedAddress())); | 974 reinterpret_cast<uword>(Symbols::PredefinedAddress())); |
| 971 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize); | 975 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize); |
| 972 __ ldr(result, Address(result, char_code, LSL, 1)); // Char code is a smi. | 976 __ ldr(result, Address(result, char_code, LSL, 1)); // Char code is a smi. |
| 973 } | 977 } |
| 974 | 978 |
| 975 | 979 |
| 976 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Isolate* isolate, | 980 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Isolate* isolate, |
| 977 bool opt) const { | 981 bool opt) const { |
| 978 const intptr_t kNumInputs = 1; | 982 const intptr_t kNumInputs = 1; |
| 979 return LocationSummary::Make(kNumInputs, | 983 return LocationSummary::Make(isolate, |
| 984 kNumInputs, |
| 980 Location::RequiresRegister(), | 985 Location::RequiresRegister(), |
| 981 LocationSummary::kNoCall); | 986 LocationSummary::kNoCall); |
| 982 } | 987 } |
| 983 | 988 |
| 984 | 989 |
| 985 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 990 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 986 ASSERT(cid_ == kOneByteStringCid); | 991 ASSERT(cid_ == kOneByteStringCid); |
| 987 const Register str = locs()->in(0).reg(); | 992 const Register str = locs()->in(0).reg(); |
| 988 const Register result = locs()->out(0).reg(); | 993 const Register result = locs()->out(0).reg(); |
| 989 __ ldr(result, FieldAddress(str, String::length_offset())); | 994 __ ldr(result, FieldAddress(str, String::length_offset())); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1017 kNumberOfArguments, | 1022 kNumberOfArguments, |
| 1018 kNoArgumentNames, | 1023 kNoArgumentNames, |
| 1019 locs()); | 1024 locs()); |
| 1020 ASSERT(locs()->out(0).reg() == R0); | 1025 ASSERT(locs()->out(0).reg() == R0); |
| 1021 } | 1026 } |
| 1022 | 1027 |
| 1023 | 1028 |
| 1024 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, | 1029 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, |
| 1025 bool opt) const { | 1030 bool opt) const { |
| 1026 const intptr_t kNumInputs = 1; | 1031 const intptr_t kNumInputs = 1; |
| 1027 return LocationSummary::Make(kNumInputs, | 1032 return LocationSummary::Make(isolate, |
| 1033 kNumInputs, |
| 1028 Location::RequiresRegister(), | 1034 Location::RequiresRegister(), |
| 1029 LocationSummary::kNoCall); | 1035 LocationSummary::kNoCall); |
| 1030 } | 1036 } |
| 1031 | 1037 |
| 1032 | 1038 |
| 1033 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1039 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1034 const Register object = locs()->in(0).reg(); | 1040 const Register object = locs()->in(0).reg(); |
| 1035 const Register result = locs()->out(0).reg(); | 1041 const Register result = locs()->out(0).reg(); |
| 1036 __ LoadFromOffset(kWord, result, object, offset() - kHeapObjectTag); | 1042 __ LoadFromOffset(kWord, result, object, offset() - kHeapObjectTag); |
| 1037 } | 1043 } |
| 1038 | 1044 |
| 1039 | 1045 |
| 1040 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, | 1046 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, |
| 1041 bool opt) const { | 1047 bool opt) const { |
| 1042 const intptr_t kNumInputs = 1; | 1048 const intptr_t kNumInputs = 1; |
| 1043 return LocationSummary::Make(kNumInputs, | 1049 return LocationSummary::Make(isolate, |
| 1050 kNumInputs, |
| 1044 Location::RequiresRegister(), | 1051 Location::RequiresRegister(), |
| 1045 LocationSummary::kNoCall); | 1052 LocationSummary::kNoCall); |
| 1046 } | 1053 } |
| 1047 | 1054 |
| 1048 | 1055 |
| 1049 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1056 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1050 const Register object = locs()->in(0).reg(); | 1057 const Register object = locs()->in(0).reg(); |
| 1051 const Register result = locs()->out(0).reg(); | 1058 const Register result = locs()->out(0).reg(); |
| 1052 Label load, done; | 1059 Label load, done; |
| 1053 __ tst(object, ShifterOperand(kSmiTagMask)); | 1060 __ tst(object, ShifterOperand(kSmiTagMask)); |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1918 StoreInstanceFieldSlowPath(StoreInstanceFieldInstr* instruction, | 1925 StoreInstanceFieldSlowPath(StoreInstanceFieldInstr* instruction, |
| 1919 const Class& cls) | 1926 const Class& cls) |
| 1920 : instruction_(instruction), cls_(cls) { } | 1927 : instruction_(instruction), cls_(cls) { } |
| 1921 | 1928 |
| 1922 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 1929 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1923 __ Comment("StoreInstanceFieldSlowPath"); | 1930 __ Comment("StoreInstanceFieldSlowPath"); |
| 1924 __ Bind(entry_label()); | 1931 __ Bind(entry_label()); |
| 1925 | 1932 |
| 1926 const Code& stub = | 1933 const Code& stub = |
| 1927 Code::Handle(StubCode::GetAllocationStubForClass(cls_)); | 1934 Code::Handle(StubCode::GetAllocationStubForClass(cls_)); |
| 1928 const ExternalLabel label(cls_.ToCString(), stub.EntryPoint()); | 1935 const ExternalLabel label(stub.EntryPoint()); |
| 1929 | 1936 |
| 1930 LocationSummary* locs = instruction_->locs(); | 1937 LocationSummary* locs = instruction_->locs(); |
| 1931 locs->live_registers()->Remove(locs->out(0)); | 1938 locs->live_registers()->Remove(locs->out(0)); |
| 1932 | 1939 |
| 1933 compiler->SaveLiveRegisters(locs); | 1940 compiler->SaveLiveRegisters(locs); |
| 1934 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 1941 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 1935 &label, | 1942 &label, |
| 1936 PcDescriptors::kOther, | 1943 PcDescriptors::kOther, |
| 1937 locs); | 1944 locs); |
| 1938 __ MoveRegister(locs->temp(0).reg(), R0); | 1945 __ MoveRegister(locs->temp(0).reg(), R0); |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2397 public: | 2404 public: |
| 2398 explicit BoxDoubleSlowPath(Instruction* instruction) | 2405 explicit BoxDoubleSlowPath(Instruction* instruction) |
| 2399 : instruction_(instruction) { } | 2406 : instruction_(instruction) { } |
| 2400 | 2407 |
| 2401 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2408 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2402 __ Comment("BoxDoubleSlowPath"); | 2409 __ Comment("BoxDoubleSlowPath"); |
| 2403 __ Bind(entry_label()); | 2410 __ Bind(entry_label()); |
| 2404 const Class& double_class = compiler->double_class(); | 2411 const Class& double_class = compiler->double_class(); |
| 2405 const Code& stub = | 2412 const Code& stub = |
| 2406 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); | 2413 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); |
| 2407 const ExternalLabel label(double_class.ToCString(), stub.EntryPoint()); | 2414 const ExternalLabel label(stub.EntryPoint()); |
| 2408 | 2415 |
| 2409 LocationSummary* locs = instruction_->locs(); | 2416 LocationSummary* locs = instruction_->locs(); |
| 2410 locs->live_registers()->Remove(locs->out(0)); | 2417 locs->live_registers()->Remove(locs->out(0)); |
| 2411 | 2418 |
| 2412 compiler->SaveLiveRegisters(locs); | 2419 compiler->SaveLiveRegisters(locs); |
| 2413 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 2420 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 2414 &label, | 2421 &label, |
| 2415 PcDescriptors::kOther, | 2422 PcDescriptors::kOther, |
| 2416 locs); | 2423 locs); |
| 2417 __ MoveRegister(locs->out(0).reg(), R0); | 2424 __ MoveRegister(locs->out(0).reg(), R0); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2429 public: | 2436 public: |
| 2430 explicit BoxFloat32x4SlowPath(Instruction* instruction) | 2437 explicit BoxFloat32x4SlowPath(Instruction* instruction) |
| 2431 : instruction_(instruction) { } | 2438 : instruction_(instruction) { } |
| 2432 | 2439 |
| 2433 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2440 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2434 __ Comment("BoxFloat32x4SlowPath"); | 2441 __ Comment("BoxFloat32x4SlowPath"); |
| 2435 __ Bind(entry_label()); | 2442 __ Bind(entry_label()); |
| 2436 const Class& float32x4_class = compiler->float32x4_class(); | 2443 const Class& float32x4_class = compiler->float32x4_class(); |
| 2437 const Code& stub = | 2444 const Code& stub = |
| 2438 Code::Handle(StubCode::GetAllocationStubForClass(float32x4_class)); | 2445 Code::Handle(StubCode::GetAllocationStubForClass(float32x4_class)); |
| 2439 const ExternalLabel label(float32x4_class.ToCString(), stub.EntryPoint()); | 2446 const ExternalLabel label(stub.EntryPoint()); |
| 2440 | 2447 |
| 2441 LocationSummary* locs = instruction_->locs(); | 2448 LocationSummary* locs = instruction_->locs(); |
| 2442 locs->live_registers()->Remove(locs->out(0)); | 2449 locs->live_registers()->Remove(locs->out(0)); |
| 2443 | 2450 |
| 2444 compiler->SaveLiveRegisters(locs); | 2451 compiler->SaveLiveRegisters(locs); |
| 2445 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 2452 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 2446 &label, | 2453 &label, |
| 2447 PcDescriptors::kOther, | 2454 PcDescriptors::kOther, |
| 2448 locs); | 2455 locs); |
| 2449 __ mov(locs->out(0).reg(), ShifterOperand(R0)); | 2456 __ mov(locs->out(0).reg(), ShifterOperand(R0)); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2461 public: | 2468 public: |
| 2462 explicit BoxFloat64x2SlowPath(Instruction* instruction) | 2469 explicit BoxFloat64x2SlowPath(Instruction* instruction) |
| 2463 : instruction_(instruction) { } | 2470 : instruction_(instruction) { } |
| 2464 | 2471 |
| 2465 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2472 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2466 __ Comment("BoxFloat64x2SlowPath"); | 2473 __ Comment("BoxFloat64x2SlowPath"); |
| 2467 __ Bind(entry_label()); | 2474 __ Bind(entry_label()); |
| 2468 const Class& float64x2_class = compiler->float64x2_class(); | 2475 const Class& float64x2_class = compiler->float64x2_class(); |
| 2469 const Code& stub = | 2476 const Code& stub = |
| 2470 Code::Handle(StubCode::GetAllocationStubForClass(float64x2_class)); | 2477 Code::Handle(StubCode::GetAllocationStubForClass(float64x2_class)); |
| 2471 const ExternalLabel label(float64x2_class.ToCString(), stub.EntryPoint()); | 2478 const ExternalLabel label(stub.EntryPoint()); |
| 2472 | 2479 |
| 2473 LocationSummary* locs = instruction_->locs(); | 2480 LocationSummary* locs = instruction_->locs(); |
| 2474 locs->live_registers()->Remove(locs->out(0)); | 2481 locs->live_registers()->Remove(locs->out(0)); |
| 2475 | 2482 |
| 2476 compiler->SaveLiveRegisters(locs); | 2483 compiler->SaveLiveRegisters(locs); |
| 2477 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 2484 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 2478 &label, | 2485 &label, |
| 2479 PcDescriptors::kOther, | 2486 PcDescriptors::kOther, |
| 2480 locs); | 2487 locs); |
| 2481 __ mov(locs->out(0).reg(), ShifterOperand(R0)); | 2488 __ mov(locs->out(0).reg(), ShifterOperand(R0)); |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2748 locs->set_out(0, Location::RegisterLocation(R0)); | 2755 locs->set_out(0, Location::RegisterLocation(R0)); |
| 2749 return locs; | 2756 return locs; |
| 2750 } | 2757 } |
| 2751 | 2758 |
| 2752 | 2759 |
| 2753 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2760 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2754 ASSERT(locs()->temp(0).reg() == R1); | 2761 ASSERT(locs()->temp(0).reg() == R1); |
| 2755 ASSERT(locs()->out(0).reg() == R0); | 2762 ASSERT(locs()->out(0).reg() == R0); |
| 2756 | 2763 |
| 2757 __ LoadImmediate(R1, num_context_variables()); | 2764 __ LoadImmediate(R1, num_context_variables()); |
| 2758 const ExternalLabel label("alloc_context", | 2765 const ExternalLabel label(StubCode::AllocateContextEntryPoint()); |
| 2759 StubCode::AllocateContextEntryPoint()); | |
| 2760 compiler->GenerateCall(token_pos(), | 2766 compiler->GenerateCall(token_pos(), |
| 2761 &label, | 2767 &label, |
| 2762 PcDescriptors::kOther, | 2768 PcDescriptors::kOther, |
| 2763 locs()); | 2769 locs()); |
| 2764 } | 2770 } |
| 2765 | 2771 |
| 2766 | 2772 |
| 2767 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, | 2773 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, |
| 2768 bool opt) const { | 2774 bool opt) const { |
| 2769 const intptr_t kNumInputs = 1; | 2775 const intptr_t kNumInputs = 1; |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3688 public: | 3694 public: |
| 3689 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) | 3695 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) |
| 3690 : instruction_(instruction) { } | 3696 : instruction_(instruction) { } |
| 3691 | 3697 |
| 3692 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 3698 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3693 __ Comment("BoxInt32x4SlowPath"); | 3699 __ Comment("BoxInt32x4SlowPath"); |
| 3694 __ Bind(entry_label()); | 3700 __ Bind(entry_label()); |
| 3695 const Class& int32x4_class = compiler->int32x4_class(); | 3701 const Class& int32x4_class = compiler->int32x4_class(); |
| 3696 const Code& stub = | 3702 const Code& stub = |
| 3697 Code::Handle(StubCode::GetAllocationStubForClass(int32x4_class)); | 3703 Code::Handle(StubCode::GetAllocationStubForClass(int32x4_class)); |
| 3698 const ExternalLabel label(int32x4_class.ToCString(), stub.EntryPoint()); | 3704 const ExternalLabel label(stub.EntryPoint()); |
| 3699 | 3705 |
| 3700 LocationSummary* locs = instruction_->locs(); | 3706 LocationSummary* locs = instruction_->locs(); |
| 3701 locs->live_registers()->Remove(locs->out(0)); | 3707 locs->live_registers()->Remove(locs->out(0)); |
| 3702 | 3708 |
| 3703 compiler->SaveLiveRegisters(locs); | 3709 compiler->SaveLiveRegisters(locs); |
| 3704 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 3710 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 3705 &label, | 3711 &label, |
| 3706 PcDescriptors::kOther, | 3712 PcDescriptors::kOther, |
| 3707 locs); | 3713 locs); |
| 3708 __ mov(locs->out(0).reg(), ShifterOperand(R0)); | 3714 __ mov(locs->out(0).reg(), ShifterOperand(R0)); |
| (...skipping 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5901 explicit BoxIntegerSlowPath(BoxIntegerInstr* instruction) | 5907 explicit BoxIntegerSlowPath(BoxIntegerInstr* instruction) |
| 5902 : instruction_(instruction) { } | 5908 : instruction_(instruction) { } |
| 5903 | 5909 |
| 5904 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 5910 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5905 __ Comment("BoxIntegerSlowPath"); | 5911 __ Comment("BoxIntegerSlowPath"); |
| 5906 __ Bind(entry_label()); | 5912 __ Bind(entry_label()); |
| 5907 const Class& mint_class = | 5913 const Class& mint_class = |
| 5908 Class::ZoneHandle(Isolate::Current()->object_store()->mint_class()); | 5914 Class::ZoneHandle(Isolate::Current()->object_store()->mint_class()); |
| 5909 const Code& stub = | 5915 const Code& stub = |
| 5910 Code::Handle(StubCode::GetAllocationStubForClass(mint_class)); | 5916 Code::Handle(StubCode::GetAllocationStubForClass(mint_class)); |
| 5911 const ExternalLabel label(mint_class.ToCString(), stub.EntryPoint()); | 5917 const ExternalLabel label(stub.EntryPoint()); |
| 5912 | 5918 |
| 5913 LocationSummary* locs = instruction_->locs(); | 5919 LocationSummary* locs = instruction_->locs(); |
| 5914 locs->live_registers()->Remove(locs->out(0)); | 5920 locs->live_registers()->Remove(locs->out(0)); |
| 5915 | 5921 |
| 5916 compiler->SaveLiveRegisters(locs); | 5922 compiler->SaveLiveRegisters(locs); |
| 5917 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 5923 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 5918 &label, | 5924 &label, |
| 5919 PcDescriptors::kOther, | 5925 PcDescriptors::kOther, |
| 5920 locs); | 5926 locs); |
| 5921 __ mov(locs->out(0).reg(), ShifterOperand(R0)); | 5927 __ mov(locs->out(0).reg(), ShifterOperand(R0)); |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6277 // We can fall through if the successor is the next block in the list. | 6283 // We can fall through if the successor is the next block in the list. |
| 6278 // Otherwise, we need a jump. | 6284 // Otherwise, we need a jump. |
| 6279 if (!compiler->CanFallThroughTo(successor())) { | 6285 if (!compiler->CanFallThroughTo(successor())) { |
| 6280 __ b(compiler->GetJumpLabel(successor())); | 6286 __ b(compiler->GetJumpLabel(successor())); |
| 6281 } | 6287 } |
| 6282 } | 6288 } |
| 6283 | 6289 |
| 6284 | 6290 |
| 6285 LocationSummary* CurrentContextInstr::MakeLocationSummary(Isolate* isolate, | 6291 LocationSummary* CurrentContextInstr::MakeLocationSummary(Isolate* isolate, |
| 6286 bool opt) const { | 6292 bool opt) const { |
| 6287 return LocationSummary::Make(0, | 6293 return LocationSummary::Make(isolate, |
| 6294 0, |
| 6288 Location::RequiresRegister(), | 6295 Location::RequiresRegister(), |
| 6289 LocationSummary::kNoCall); | 6296 LocationSummary::kNoCall); |
| 6290 } | 6297 } |
| 6291 | 6298 |
| 6292 | 6299 |
| 6293 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6300 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6294 __ mov(locs()->out(0).reg(), ShifterOperand(CTX)); | 6301 __ mov(locs()->out(0).reg(), ShifterOperand(CTX)); |
| 6295 } | 6302 } |
| 6296 | 6303 |
| 6297 | 6304 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6364 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); | 6371 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); |
| 6365 | 6372 |
| 6366 BranchLabels labels = compiler->CreateBranchLabels(branch); | 6373 BranchLabels labels = compiler->CreateBranchLabels(branch); |
| 6367 Condition true_condition = EmitComparisonCode(compiler, labels); | 6374 Condition true_condition = EmitComparisonCode(compiler, labels); |
| 6368 EmitBranchOnCondition(compiler, true_condition, labels); | 6375 EmitBranchOnCondition(compiler, true_condition, labels); |
| 6369 } | 6376 } |
| 6370 | 6377 |
| 6371 | 6378 |
| 6372 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate, | 6379 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate, |
| 6373 bool opt) const { | 6380 bool opt) const { |
| 6374 return LocationSummary::Make(1, | 6381 return LocationSummary::Make(isolate, |
| 6382 1, |
| 6375 Location::RequiresRegister(), | 6383 Location::RequiresRegister(), |
| 6376 LocationSummary::kNoCall); | 6384 LocationSummary::kNoCall); |
| 6377 } | 6385 } |
| 6378 | 6386 |
| 6379 | 6387 |
| 6380 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6388 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6381 const Register value = locs()->in(0).reg(); | 6389 const Register value = locs()->in(0).reg(); |
| 6382 const Register result = locs()->out(0).reg(); | 6390 const Register result = locs()->out(0).reg(); |
| 6383 | 6391 |
| 6384 __ LoadObject(result, Bool::True()); | 6392 __ LoadObject(result, Bool::True()); |
| 6385 __ cmp(result, ShifterOperand(value)); | 6393 __ cmp(result, ShifterOperand(value)); |
| 6386 __ LoadObject(result, Bool::False(), EQ); | 6394 __ LoadObject(result, Bool::False(), EQ); |
| 6387 } | 6395 } |
| 6388 | 6396 |
| 6389 | 6397 |
| 6390 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Isolate* isolate, | 6398 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Isolate* isolate, |
| 6391 bool opt) const { | 6399 bool opt) const { |
| 6392 return MakeCallSummary(); | 6400 return MakeCallSummary(); |
| 6393 } | 6401 } |
| 6394 | 6402 |
| 6395 | 6403 |
| 6396 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6404 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6397 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); | 6405 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); |
| 6398 const ExternalLabel label(cls().ToCString(), stub.EntryPoint()); | 6406 const ExternalLabel label(stub.EntryPoint()); |
| 6399 compiler->GenerateCall(token_pos(), | 6407 compiler->GenerateCall(token_pos(), |
| 6400 &label, | 6408 &label, |
| 6401 PcDescriptors::kOther, | 6409 PcDescriptors::kOther, |
| 6402 locs()); | 6410 locs()); |
| 6403 __ Drop(ArgumentCount()); // Discard arguments. | 6411 __ Drop(ArgumentCount()); // Discard arguments. |
| 6404 } | 6412 } |
| 6405 | 6413 |
| 6406 } // namespace dart | 6414 } // namespace dart |
| 6407 | 6415 |
| 6408 #endif // defined TARGET_ARCH_ARM | 6416 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |