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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // R4: Arguments descriptor. | 212 // R4: Arguments descriptor. |
213 // R0: Function. | 213 // R0: Function. |
214 ASSERT(locs()->in(0).reg() == R0); | 214 ASSERT(locs()->in(0).reg() == R0); |
215 __ ldr(R2, FieldAddress(R0, Function::instructions_offset())); | 215 __ ldr(R2, FieldAddress(R0, Function::instructions_offset())); |
216 | 216 |
217 // R2: instructions. | 217 // R2: instructions. |
218 // R5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). | 218 // R5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). |
219 __ LoadImmediate(R5, 0); | 219 __ LoadImmediate(R5, 0); |
220 __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag); | 220 __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag); |
221 __ blx(R2); | 221 __ blx(R2); |
222 compiler->AddCurrentDescriptor(PcDescriptors::kClosureCall, | 222 compiler->AddCurrentDescriptor(RawPcDescriptors::kClosureCall, |
223 deopt_id(), | 223 deopt_id(), |
224 token_pos()); | 224 token_pos()); |
225 compiler->RecordSafepoint(locs()); | 225 compiler->RecordSafepoint(locs()); |
226 // Marks either the continuation point in unoptimized code or the | 226 // Marks either the continuation point in unoptimized code or the |
227 // deoptimization point in optimized code, after call. | 227 // deoptimization point in optimized code, after call. |
228 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id()); | 228 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id()); |
229 if (compiler->is_optimizing()) { | 229 if (compiler->is_optimizing()) { |
230 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos()); | 230 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos()); |
231 } else { | 231 } else { |
232 // Add deoptimization continuation point after the call and before the | 232 // Add deoptimization continuation point after the call and before the |
233 // arguments are removed. | 233 // arguments are removed. |
234 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 234 compiler->AddCurrentDescriptor(RawPcDescriptors::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(isolate, | 244 return LocationSummary::Make(isolate, |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 if (!function().IsNativeAutoSetupScope()) { | 944 if (!function().IsNativeAutoSetupScope()) { |
945 entry = Simulator::RedirectExternalReference( | 945 entry = Simulator::RedirectExternalReference( |
946 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); | 946 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); |
947 } | 947 } |
948 #endif | 948 #endif |
949 } | 949 } |
950 __ LoadImmediate(R5, entry); | 950 __ LoadImmediate(R5, entry); |
951 __ LoadImmediate(R1, argc_tag); | 951 __ LoadImmediate(R1, argc_tag); |
952 compiler->GenerateCall(token_pos(), | 952 compiler->GenerateCall(token_pos(), |
953 stub_entry, | 953 stub_entry, |
954 PcDescriptors::kOther, | 954 RawPcDescriptors::kOther, |
955 locs()); | 955 locs()); |
956 __ Pop(result); | 956 __ Pop(result); |
957 } | 957 } |
958 | 958 |
959 | 959 |
960 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate, | 960 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate, |
961 bool opt) const { | 961 bool opt) const { |
962 const intptr_t kNumInputs = 1; | 962 const intptr_t kNumInputs = 1; |
963 // TODO(fschneider): Allow immediate operands for the char code. | 963 // TODO(fschneider): Allow immediate operands for the char code. |
964 return LocationSummary::Make(isolate, | 964 return LocationSummary::Make(isolate, |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1924 const Code& stub = | 1924 const Code& stub = |
1925 Code::Handle(StubCode::GetAllocationStubForClass(cls_)); | 1925 Code::Handle(StubCode::GetAllocationStubForClass(cls_)); |
1926 const ExternalLabel label(stub.EntryPoint()); | 1926 const ExternalLabel label(stub.EntryPoint()); |
1927 | 1927 |
1928 LocationSummary* locs = instruction_->locs(); | 1928 LocationSummary* locs = instruction_->locs(); |
1929 locs->live_registers()->Remove(locs->out(0)); | 1929 locs->live_registers()->Remove(locs->out(0)); |
1930 | 1930 |
1931 compiler->SaveLiveRegisters(locs); | 1931 compiler->SaveLiveRegisters(locs); |
1932 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 1932 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
1933 &label, | 1933 &label, |
1934 PcDescriptors::kOther, | 1934 RawPcDescriptors::kOther, |
1935 locs); | 1935 locs); |
1936 __ MoveRegister(locs->temp(0).reg(), R0); | 1936 __ MoveRegister(locs->temp(0).reg(), R0); |
1937 compiler->RestoreLiveRegisters(locs); | 1937 compiler->RestoreLiveRegisters(locs); |
1938 | 1938 |
1939 __ b(exit_label()); | 1939 __ b(exit_label()); |
1940 } | 1940 } |
1941 | 1941 |
1942 private: | 1942 private: |
1943 StoreInstanceFieldInstr* instruction_; | 1943 StoreInstanceFieldInstr* instruction_; |
1944 const Class& cls_; | 1944 const Class& cls_; |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2373 locs()); | 2373 locs()); |
2374 __ Drop(2); | 2374 __ Drop(2); |
2375 __ Pop(kResultReg); | 2375 __ Pop(kResultReg); |
2376 __ Bind(&done); | 2376 __ Bind(&done); |
2377 return; | 2377 return; |
2378 } | 2378 } |
2379 } | 2379 } |
2380 | 2380 |
2381 compiler->GenerateCall(token_pos(), | 2381 compiler->GenerateCall(token_pos(), |
2382 &StubCode::AllocateArrayLabel(), | 2382 &StubCode::AllocateArrayLabel(), |
2383 PcDescriptors::kOther, | 2383 RawPcDescriptors::kOther, |
2384 locs()); | 2384 locs()); |
2385 ASSERT(locs()->out(0).reg() == kResultReg); | 2385 ASSERT(locs()->out(0).reg() == kResultReg); |
2386 } | 2386 } |
2387 | 2387 |
2388 | 2388 |
2389 class BoxDoubleSlowPath : public SlowPathCode { | 2389 class BoxDoubleSlowPath : public SlowPathCode { |
2390 public: | 2390 public: |
2391 explicit BoxDoubleSlowPath(Instruction* instruction) | 2391 explicit BoxDoubleSlowPath(Instruction* instruction) |
2392 : instruction_(instruction) { } | 2392 : instruction_(instruction) { } |
2393 | 2393 |
2394 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2394 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
2395 __ Comment("BoxDoubleSlowPath"); | 2395 __ Comment("BoxDoubleSlowPath"); |
2396 __ Bind(entry_label()); | 2396 __ Bind(entry_label()); |
2397 const Class& double_class = compiler->double_class(); | 2397 const Class& double_class = compiler->double_class(); |
2398 const Code& stub = | 2398 const Code& stub = |
2399 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); | 2399 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); |
2400 const ExternalLabel label(stub.EntryPoint()); | 2400 const ExternalLabel label(stub.EntryPoint()); |
2401 | 2401 |
2402 LocationSummary* locs = instruction_->locs(); | 2402 LocationSummary* locs = instruction_->locs(); |
2403 locs->live_registers()->Remove(locs->out(0)); | 2403 locs->live_registers()->Remove(locs->out(0)); |
2404 | 2404 |
2405 compiler->SaveLiveRegisters(locs); | 2405 compiler->SaveLiveRegisters(locs); |
2406 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 2406 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
2407 &label, | 2407 &label, |
2408 PcDescriptors::kOther, | 2408 RawPcDescriptors::kOther, |
2409 locs); | 2409 locs); |
2410 __ MoveRegister(locs->out(0).reg(), R0); | 2410 __ MoveRegister(locs->out(0).reg(), R0); |
2411 compiler->RestoreLiveRegisters(locs); | 2411 compiler->RestoreLiveRegisters(locs); |
2412 | 2412 |
2413 __ b(exit_label()); | 2413 __ b(exit_label()); |
2414 } | 2414 } |
2415 | 2415 |
2416 private: | 2416 private: |
2417 Instruction* instruction_; | 2417 Instruction* instruction_; |
2418 }; | 2418 }; |
(...skipping 11 matching lines...) Expand all Loading... |
2430 const Code& stub = | 2430 const Code& stub = |
2431 Code::Handle(StubCode::GetAllocationStubForClass(float32x4_class)); | 2431 Code::Handle(StubCode::GetAllocationStubForClass(float32x4_class)); |
2432 const ExternalLabel label(stub.EntryPoint()); | 2432 const ExternalLabel label(stub.EntryPoint()); |
2433 | 2433 |
2434 LocationSummary* locs = instruction_->locs(); | 2434 LocationSummary* locs = instruction_->locs(); |
2435 locs->live_registers()->Remove(locs->out(0)); | 2435 locs->live_registers()->Remove(locs->out(0)); |
2436 | 2436 |
2437 compiler->SaveLiveRegisters(locs); | 2437 compiler->SaveLiveRegisters(locs); |
2438 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 2438 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
2439 &label, | 2439 &label, |
2440 PcDescriptors::kOther, | 2440 RawPcDescriptors::kOther, |
2441 locs); | 2441 locs); |
2442 __ mov(locs->out(0).reg(), Operand(R0)); | 2442 __ mov(locs->out(0).reg(), Operand(R0)); |
2443 compiler->RestoreLiveRegisters(locs); | 2443 compiler->RestoreLiveRegisters(locs); |
2444 | 2444 |
2445 __ b(exit_label()); | 2445 __ b(exit_label()); |
2446 } | 2446 } |
2447 | 2447 |
2448 private: | 2448 private: |
2449 Instruction* instruction_; | 2449 Instruction* instruction_; |
2450 }; | 2450 }; |
(...skipping 11 matching lines...) Expand all Loading... |
2462 const Code& stub = | 2462 const Code& stub = |
2463 Code::Handle(StubCode::GetAllocationStubForClass(float64x2_class)); | 2463 Code::Handle(StubCode::GetAllocationStubForClass(float64x2_class)); |
2464 const ExternalLabel label(stub.EntryPoint()); | 2464 const ExternalLabel label(stub.EntryPoint()); |
2465 | 2465 |
2466 LocationSummary* locs = instruction_->locs(); | 2466 LocationSummary* locs = instruction_->locs(); |
2467 locs->live_registers()->Remove(locs->out(0)); | 2467 locs->live_registers()->Remove(locs->out(0)); |
2468 | 2468 |
2469 compiler->SaveLiveRegisters(locs); | 2469 compiler->SaveLiveRegisters(locs); |
2470 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 2470 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
2471 &label, | 2471 &label, |
2472 PcDescriptors::kOther, | 2472 RawPcDescriptors::kOther, |
2473 locs); | 2473 locs); |
2474 __ mov(locs->out(0).reg(), Operand(R0)); | 2474 __ mov(locs->out(0).reg(), Operand(R0)); |
2475 compiler->RestoreLiveRegisters(locs); | 2475 compiler->RestoreLiveRegisters(locs); |
2476 | 2476 |
2477 __ b(exit_label()); | 2477 __ b(exit_label()); |
2478 } | 2478 } |
2479 | 2479 |
2480 private: | 2480 private: |
2481 Instruction* instruction_; | 2481 Instruction* instruction_; |
2482 }; | 2482 }; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2747 | 2747 |
2748 | 2748 |
2749 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2749 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2750 ASSERT(locs()->temp(0).reg() == R1); | 2750 ASSERT(locs()->temp(0).reg() == R1); |
2751 ASSERT(locs()->out(0).reg() == R0); | 2751 ASSERT(locs()->out(0).reg() == R0); |
2752 | 2752 |
2753 __ LoadImmediate(R1, num_context_variables()); | 2753 __ LoadImmediate(R1, num_context_variables()); |
2754 const ExternalLabel label(StubCode::AllocateContextEntryPoint()); | 2754 const ExternalLabel label(StubCode::AllocateContextEntryPoint()); |
2755 compiler->GenerateCall(token_pos(), | 2755 compiler->GenerateCall(token_pos(), |
2756 &label, | 2756 &label, |
2757 PcDescriptors::kOther, | 2757 RawPcDescriptors::kOther, |
2758 locs()); | 2758 locs()); |
2759 } | 2759 } |
2760 | 2760 |
2761 | 2761 |
2762 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, | 2762 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, |
2763 bool opt) const { | 2763 bool opt) const { |
2764 const intptr_t kNumInputs = 1; | 2764 const intptr_t kNumInputs = 1; |
2765 const intptr_t kNumTemps = 0; | 2765 const intptr_t kNumTemps = 0; |
2766 LocationSummary* locs = new(isolate) LocationSummary( | 2766 LocationSummary* locs = new(isolate) LocationSummary( |
2767 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2767 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2862 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); | 2862 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); |
2863 compiler->pending_deoptimization_env_ = env; | 2863 compiler->pending_deoptimization_env_ = env; |
2864 compiler->GenerateRuntimeCall(instruction_->token_pos(), | 2864 compiler->GenerateRuntimeCall(instruction_->token_pos(), |
2865 instruction_->deopt_id(), | 2865 instruction_->deopt_id(), |
2866 kStackOverflowRuntimeEntry, | 2866 kStackOverflowRuntimeEntry, |
2867 0, | 2867 0, |
2868 instruction_->locs()); | 2868 instruction_->locs()); |
2869 | 2869 |
2870 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { | 2870 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { |
2871 // In unoptimized code, record loop stack checks as possible OSR entries. | 2871 // In unoptimized code, record loop stack checks as possible OSR entries. |
2872 compiler->AddCurrentDescriptor(PcDescriptors::kOsrEntry, | 2872 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, |
2873 instruction_->deopt_id(), | 2873 instruction_->deopt_id(), |
2874 0); // No token position. | 2874 0); // No token position. |
2875 } | 2875 } |
2876 compiler->pending_deoptimization_env_ = NULL; | 2876 compiler->pending_deoptimization_env_ = NULL; |
2877 compiler->RestoreLiveRegisters(instruction_->locs()); | 2877 compiler->RestoreLiveRegisters(instruction_->locs()); |
2878 __ b(exit_label()); | 2878 __ b(exit_label()); |
2879 } | 2879 } |
2880 | 2880 |
2881 Label* osr_entry_label() { | 2881 Label* osr_entry_label() { |
2882 ASSERT(FLAG_use_osr); | 2882 ASSERT(FLAG_use_osr); |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3698 const Code& stub = | 3698 const Code& stub = |
3699 Code::Handle(StubCode::GetAllocationStubForClass(int32x4_class)); | 3699 Code::Handle(StubCode::GetAllocationStubForClass(int32x4_class)); |
3700 const ExternalLabel label(stub.EntryPoint()); | 3700 const ExternalLabel label(stub.EntryPoint()); |
3701 | 3701 |
3702 LocationSummary* locs = instruction_->locs(); | 3702 LocationSummary* locs = instruction_->locs(); |
3703 locs->live_registers()->Remove(locs->out(0)); | 3703 locs->live_registers()->Remove(locs->out(0)); |
3704 | 3704 |
3705 compiler->SaveLiveRegisters(locs); | 3705 compiler->SaveLiveRegisters(locs); |
3706 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 3706 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
3707 &label, | 3707 &label, |
3708 PcDescriptors::kOther, | 3708 RawPcDescriptors::kOther, |
3709 locs); | 3709 locs); |
3710 __ mov(locs->out(0).reg(), Operand(R0)); | 3710 __ mov(locs->out(0).reg(), Operand(R0)); |
3711 compiler->RestoreLiveRegisters(locs); | 3711 compiler->RestoreLiveRegisters(locs); |
3712 | 3712 |
3713 __ b(exit_label()); | 3713 __ b(exit_label()); |
3714 } | 3714 } |
3715 | 3715 |
3716 private: | 3716 private: |
3717 BoxInt32x4Instr* instruction_; | 3717 BoxInt32x4Instr* instruction_; |
3718 }; | 3718 }; |
(...skipping 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5918 const Code& stub = | 5918 const Code& stub = |
5919 Code::Handle(StubCode::GetAllocationStubForClass(mint_class)); | 5919 Code::Handle(StubCode::GetAllocationStubForClass(mint_class)); |
5920 const ExternalLabel label(stub.EntryPoint()); | 5920 const ExternalLabel label(stub.EntryPoint()); |
5921 | 5921 |
5922 LocationSummary* locs = instruction_->locs(); | 5922 LocationSummary* locs = instruction_->locs(); |
5923 locs->live_registers()->Remove(locs->out(0)); | 5923 locs->live_registers()->Remove(locs->out(0)); |
5924 | 5924 |
5925 compiler->SaveLiveRegisters(locs); | 5925 compiler->SaveLiveRegisters(locs); |
5926 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 5926 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
5927 &label, | 5927 &label, |
5928 PcDescriptors::kOther, | 5928 RawPcDescriptors::kOther, |
5929 locs); | 5929 locs); |
5930 __ mov(locs->out(0).reg(), Operand(R0)); | 5930 __ mov(locs->out(0).reg(), Operand(R0)); |
5931 compiler->RestoreLiveRegisters(locs); | 5931 compiler->RestoreLiveRegisters(locs); |
5932 | 5932 |
5933 __ b(exit_label()); | 5933 __ b(exit_label()); |
5934 } | 5934 } |
5935 | 5935 |
5936 private: | 5936 private: |
5937 BoxIntegerInstr* instruction_; | 5937 BoxIntegerInstr* instruction_; |
5938 }; | 5938 }; |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6254 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6254 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6255 __ Bind(compiler->GetJumpLabel(this)); | 6255 __ Bind(compiler->GetJumpLabel(this)); |
6256 if (!compiler->is_optimizing()) { | 6256 if (!compiler->is_optimizing()) { |
6257 if (compiler->NeedsEdgeCounter(this)) { | 6257 if (compiler->NeedsEdgeCounter(this)) { |
6258 compiler->EmitEdgeCounter(); | 6258 compiler->EmitEdgeCounter(); |
6259 } | 6259 } |
6260 // Add an edge counter. | 6260 // Add an edge counter. |
6261 // On ARM the deoptimization descriptor points after the edge counter | 6261 // On ARM the deoptimization descriptor points after the edge counter |
6262 // code so that we can reuse the same pattern matching code as at call | 6262 // code so that we can reuse the same pattern matching code as at call |
6263 // sites, which matches backwards from the end of the pattern. | 6263 // sites, which matches backwards from the end of the pattern. |
6264 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 6264 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
6265 deopt_id_, | 6265 deopt_id_, |
6266 Scanner::kNoSourcePos); | 6266 Scanner::kNoSourcePos); |
6267 } | 6267 } |
6268 if (HasParallelMove()) { | 6268 if (HasParallelMove()) { |
6269 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 6269 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
6270 } | 6270 } |
6271 } | 6271 } |
6272 | 6272 |
6273 | 6273 |
6274 LocationSummary* GotoInstr::MakeLocationSummary(Isolate* isolate, | 6274 LocationSummary* GotoInstr::MakeLocationSummary(Isolate* isolate, |
6275 bool opt) const { | 6275 bool opt) const { |
6276 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kNoCall); | 6276 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kNoCall); |
6277 } | 6277 } |
6278 | 6278 |
6279 | 6279 |
6280 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6280 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6281 if (!compiler->is_optimizing()) { | 6281 if (!compiler->is_optimizing()) { |
6282 if (FLAG_emit_edge_counters) { | 6282 if (FLAG_emit_edge_counters) { |
6283 compiler->EmitEdgeCounter(); | 6283 compiler->EmitEdgeCounter(); |
6284 } | 6284 } |
6285 // Add a deoptimization descriptor for deoptimizing instructions that | 6285 // Add a deoptimization descriptor for deoptimizing instructions that |
6286 // may be inserted before this instruction. On ARM this descriptor | 6286 // may be inserted before this instruction. On ARM this descriptor |
6287 // points after the edge counter code so that we can reuse the same | 6287 // points after the edge counter code so that we can reuse the same |
6288 // pattern matching code as at call sites, which matches backwards from | 6288 // pattern matching code as at call sites, which matches backwards from |
6289 // the end of the pattern. | 6289 // the end of the pattern. |
6290 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 6290 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
6291 GetDeoptId(), | 6291 GetDeoptId(), |
6292 Scanner::kNoSourcePos); | 6292 Scanner::kNoSourcePos); |
6293 } | 6293 } |
6294 if (HasParallelMove()) { | 6294 if (HasParallelMove()) { |
6295 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 6295 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
6296 } | 6296 } |
6297 | 6297 |
6298 // We can fall through if the successor is the next block in the list. | 6298 // We can fall through if the successor is the next block in the list. |
6299 // Otherwise, we need a jump. | 6299 // Otherwise, we need a jump. |
6300 if (!compiler->CanFallThroughTo(successor())) { | 6300 if (!compiler->CanFallThroughTo(successor())) { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6414 bool opt) const { | 6414 bool opt) const { |
6415 return MakeCallSummary(); | 6415 return MakeCallSummary(); |
6416 } | 6416 } |
6417 | 6417 |
6418 | 6418 |
6419 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6419 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6420 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); | 6420 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); |
6421 const ExternalLabel label(stub.EntryPoint()); | 6421 const ExternalLabel label(stub.EntryPoint()); |
6422 compiler->GenerateCall(token_pos(), | 6422 compiler->GenerateCall(token_pos(), |
6423 &label, | 6423 &label, |
6424 PcDescriptors::kOther, | 6424 RawPcDescriptors::kOther, |
6425 locs()); | 6425 locs()); |
6426 __ Drop(ArgumentCount()); // Discard arguments. | 6426 __ Drop(ArgumentCount()); // Discard arguments. |
6427 } | 6427 } |
6428 | 6428 |
6429 | 6429 |
6430 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6430 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6431 ASSERT(!compiler->is_optimizing()); | 6431 ASSERT(!compiler->is_optimizing()); |
6432 const ExternalLabel label(StubCode::DebugStepCheckEntryPoint()); | 6432 const ExternalLabel label(StubCode::DebugStepCheckEntryPoint()); |
6433 __ LoadImmediate(R4, 0); | 6433 __ LoadImmediate(R4, 0); |
6434 __ LoadImmediate(R5, 0); | 6434 __ LoadImmediate(R5, 0); |
6435 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 6435 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
6436 #if defined(DEBUG) | 6436 #if defined(DEBUG) |
6437 __ LoadImmediate(R4, kInvalidObjectPointer); | 6437 __ LoadImmediate(R4, kInvalidObjectPointer); |
6438 __ LoadImmediate(R5, kInvalidObjectPointer); | 6438 __ LoadImmediate(R5, kInvalidObjectPointer); |
6439 #endif | 6439 #endif |
6440 } | 6440 } |
6441 | 6441 |
6442 } // namespace dart | 6442 } // namespace dart |
6443 | 6443 |
6444 #endif // defined TARGET_ARCH_ARM | 6444 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |