Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: runtime/vm/intermediate_language_arm.cc

Issue 1644793002: Replace intptr_t with TokenDescriptor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 const intptr_t kNumTemps = 0; 362 const intptr_t kNumTemps = 0;
363 LocationSummary* locs = new(zone) LocationSummary( 363 LocationSummary* locs = new(zone) LocationSummary(
364 zone, kNumInputs, kNumTemps, LocationSummary::kCall); 364 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
365 locs->set_in(0, Location::RegisterLocation(R0)); 365 locs->set_in(0, Location::RegisterLocation(R0));
366 locs->set_out(0, Location::RegisterLocation(R0)); 366 locs->set_out(0, Location::RegisterLocation(R0));
367 return locs; 367 return locs;
368 } 368 }
369 369
370 370
371 static void EmitAssertBoolean(Register reg, 371 static void EmitAssertBoolean(Register reg,
372 intptr_t token_pos, 372 TokenPosition token_pos,
373 intptr_t deopt_id, 373 intptr_t deopt_id,
374 LocationSummary* locs, 374 LocationSummary* locs,
375 FlowGraphCompiler* compiler) { 375 FlowGraphCompiler* compiler) {
376 // Check that the type of the value is allowed in conditional context. 376 // Check that the type of the value is allowed in conditional context.
377 // Call the runtime if the object is not bool::true or bool::false. 377 // Call the runtime if the object is not bool::true or bool::false.
378 ASSERT(locs->always_calls()); 378 ASSERT(locs->always_calls());
379 Label done; 379 Label done;
380 380
381 if (Isolate::Current()->flags().type_checks()) { 381 if (Isolate::Current()->flags().type_checks()) {
382 __ CompareObject(reg, Bool::True()); 382 __ CompareObject(reg, Bool::True());
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
1819 __ Bind(entry_label()); 1819 __ Bind(entry_label());
1820 const Code& stub = Code::ZoneHandle( 1820 const Code& stub = Code::ZoneHandle(
1821 compiler->zone(), StubCode::GetAllocationStubForClass(cls_)); 1821 compiler->zone(), StubCode::GetAllocationStubForClass(cls_));
1822 const StubEntry stub_entry(stub); 1822 const StubEntry stub_entry(stub);
1823 1823
1824 LocationSummary* locs = instruction_->locs(); 1824 LocationSummary* locs = instruction_->locs();
1825 1825
1826 locs->live_registers()->Remove(Location::RegisterLocation(result_)); 1826 locs->live_registers()->Remove(Location::RegisterLocation(result_));
1827 1827
1828 compiler->SaveLiveRegisters(locs); 1828 compiler->SaveLiveRegisters(locs);
1829 compiler->GenerateCall(Token::kNoSourcePos, // No token position. 1829 compiler->GenerateCall(TokenPosition::kNoSource, // No token position.
1830 stub_entry, 1830 stub_entry,
1831 RawPcDescriptors::kOther, 1831 RawPcDescriptors::kOther,
1832 locs); 1832 locs);
1833 compiler->AddStubCallTarget(stub); 1833 compiler->AddStubCallTarget(stub);
1834 __ MoveRegister(result_, R0); 1834 __ MoveRegister(result_, R0);
1835 compiler->RestoreLiveRegisters(locs); 1835 compiler->RestoreLiveRegisters(locs);
1836 __ b(exit_label()); 1836 __ b(exit_label());
1837 } 1837 }
1838 1838
1839 static void Allocate(FlowGraphCompiler* compiler, 1839 static void Allocate(FlowGraphCompiler* compiler,
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
2890 compiler->GenerateRuntimeCall(instruction_->token_pos(), 2890 compiler->GenerateRuntimeCall(instruction_->token_pos(),
2891 instruction_->deopt_id(), 2891 instruction_->deopt_id(),
2892 kStackOverflowRuntimeEntry, 2892 kStackOverflowRuntimeEntry,
2893 0, 2893 0,
2894 instruction_->locs()); 2894 instruction_->locs());
2895 2895
2896 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { 2896 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) {
2897 // In unoptimized code, record loop stack checks as possible OSR entries. 2897 // In unoptimized code, record loop stack checks as possible OSR entries.
2898 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, 2898 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry,
2899 instruction_->deopt_id(), 2899 instruction_->deopt_id(),
2900 0); // No token position. 2900 TokenPosition::kNoSource);
2901 } 2901 }
2902 compiler->pending_deoptimization_env_ = NULL; 2902 compiler->pending_deoptimization_env_ = NULL;
2903 compiler->RestoreLiveRegisters(instruction_->locs()); 2903 compiler->RestoreLiveRegisters(instruction_->locs());
2904 __ b(exit_label()); 2904 __ b(exit_label());
2905 } 2905 }
2906 2906
2907 Label* osr_entry_label() { 2907 Label* osr_entry_label() {
2908 ASSERT(FLAG_use_osr); 2908 ASSERT(FLAG_use_osr);
2909 return &osr_entry_label_; 2909 return &osr_entry_label_;
2910 } 2910 }
(...skipping 3725 matching lines...) Expand 10 before | Expand all | Expand 10 after
6636 6636
6637 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 6637 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
6638 if (!compiler->is_optimizing()) { 6638 if (!compiler->is_optimizing()) {
6639 if (FLAG_emit_edge_counters) { 6639 if (FLAG_emit_edge_counters) {
6640 compiler->EmitEdgeCounter(block()->preorder_number()); 6640 compiler->EmitEdgeCounter(block()->preorder_number());
6641 } 6641 }
6642 // Add a deoptimization descriptor for deoptimizing instructions that 6642 // Add a deoptimization descriptor for deoptimizing instructions that
6643 // may be inserted before this instruction. 6643 // may be inserted before this instruction.
6644 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, 6644 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
6645 GetDeoptId(), 6645 GetDeoptId(),
6646 Token::kNoSourcePos); 6646 TokenPosition::kNoSource);
6647 } 6647 }
6648 if (HasParallelMove()) { 6648 if (HasParallelMove()) {
6649 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); 6649 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
6650 } 6650 }
6651 6651
6652 // We can fall through if the successor is the next block in the list. 6652 // We can fall through if the successor is the next block in the list.
6653 // Otherwise, we need a jump. 6653 // Otherwise, we need a jump.
6654 if (!compiler->CanFallThroughTo(successor())) { 6654 if (!compiler->CanFallThroughTo(successor())) {
6655 __ b(compiler->GetJumpLabel(successor())); 6655 __ b(compiler->GetJumpLabel(successor()));
6656 } 6656 }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
6839 locs->set_out(0, Location::RegisterLocation(R0)); 6839 locs->set_out(0, Location::RegisterLocation(R0));
6840 return locs; 6840 return locs;
6841 } 6841 }
6842 6842
6843 6843
6844 void GrowRegExpStackInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 6844 void GrowRegExpStackInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
6845 const Register typed_data = locs()->in(0).reg(); 6845 const Register typed_data = locs()->in(0).reg();
6846 const Register result = locs()->out(0).reg(); 6846 const Register result = locs()->out(0).reg();
6847 __ PushObject(Object::null_object()); 6847 __ PushObject(Object::null_object());
6848 __ Push(typed_data); 6848 __ Push(typed_data);
6849 compiler->GenerateRuntimeCall(Token::kNoSourcePos, // No token position. 6849 compiler->GenerateRuntimeCall(TokenPosition::kNoSource,
6850 deopt_id(), 6850 deopt_id(),
6851 kGrowRegExpStackRuntimeEntry, 6851 kGrowRegExpStackRuntimeEntry,
6852 1, 6852 1,
6853 locs()); 6853 locs());
6854 __ Drop(1); 6854 __ Drop(1);
6855 __ Pop(result); 6855 __ Pop(result);
6856 } 6856 }
6857 6857
6858 6858
6859 } // namespace dart 6859 } // namespace dart
6860 6860
6861 #endif // defined TARGET_ARCH_ARM 6861 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698