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

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
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 TokenDescriptor 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 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1827 __ Bind(entry_label()); 1827 __ Bind(entry_label());
1828 const Code& stub = Code::ZoneHandle( 1828 const Code& stub = Code::ZoneHandle(
1829 compiler->zone(), StubCode::GetAllocationStubForClass(cls_)); 1829 compiler->zone(), StubCode::GetAllocationStubForClass(cls_));
1830 const StubEntry stub_entry(stub); 1830 const StubEntry stub_entry(stub);
1831 1831
1832 LocationSummary* locs = instruction_->locs(); 1832 LocationSummary* locs = instruction_->locs();
1833 1833
1834 locs->live_registers()->Remove(Location::RegisterLocation(result_)); 1834 locs->live_registers()->Remove(Location::RegisterLocation(result_));
1835 1835
1836 compiler->SaveLiveRegisters(locs); 1836 compiler->SaveLiveRegisters(locs);
1837 compiler->GenerateCall(Token::kNoSourcePos, // No token position. 1837 compiler->GenerateCall(TokenDescriptor::kNoSource, // No token position.
1838 stub_entry, 1838 stub_entry,
1839 RawPcDescriptors::kOther, 1839 RawPcDescriptors::kOther,
1840 locs); 1840 locs);
1841 compiler->AddStubCallTarget(stub); 1841 compiler->AddStubCallTarget(stub);
1842 __ MoveRegister(result_, R0); 1842 __ MoveRegister(result_, R0);
1843 compiler->RestoreLiveRegisters(locs); 1843 compiler->RestoreLiveRegisters(locs);
1844 __ b(exit_label()); 1844 __ b(exit_label());
1845 } 1845 }
1846 1846
1847 static void Allocate(FlowGraphCompiler* compiler, 1847 static void Allocate(FlowGraphCompiler* compiler,
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
2898 compiler->GenerateRuntimeCall(instruction_->token_pos(), 2898 compiler->GenerateRuntimeCall(instruction_->token_pos(),
2899 instruction_->deopt_id(), 2899 instruction_->deopt_id(),
2900 kStackOverflowRuntimeEntry, 2900 kStackOverflowRuntimeEntry,
2901 0, 2901 0,
2902 instruction_->locs()); 2902 instruction_->locs());
2903 2903
2904 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { 2904 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) {
2905 // In unoptimized code, record loop stack checks as possible OSR entries. 2905 // In unoptimized code, record loop stack checks as possible OSR entries.
2906 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, 2906 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry,
2907 instruction_->deopt_id(), 2907 instruction_->deopt_id(),
2908 0); // No token position. 2908 TokenDescriptor::kNoSource);
2909 } 2909 }
2910 compiler->pending_deoptimization_env_ = NULL; 2910 compiler->pending_deoptimization_env_ = NULL;
2911 compiler->RestoreLiveRegisters(instruction_->locs()); 2911 compiler->RestoreLiveRegisters(instruction_->locs());
2912 __ b(exit_label()); 2912 __ b(exit_label());
2913 } 2913 }
2914 2914
2915 Label* osr_entry_label() { 2915 Label* osr_entry_label() {
2916 ASSERT(FLAG_use_osr); 2916 ASSERT(FLAG_use_osr);
2917 return &osr_entry_label_; 2917 return &osr_entry_label_;
2918 } 2918 }
(...skipping 3725 matching lines...) Expand 10 before | Expand all | Expand 10 after
6644 6644
6645 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 6645 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
6646 if (!compiler->is_optimizing()) { 6646 if (!compiler->is_optimizing()) {
6647 if (FLAG_emit_edge_counters) { 6647 if (FLAG_emit_edge_counters) {
6648 compiler->EmitEdgeCounter(block()->preorder_number()); 6648 compiler->EmitEdgeCounter(block()->preorder_number());
6649 } 6649 }
6650 // Add a deoptimization descriptor for deoptimizing instructions that 6650 // Add a deoptimization descriptor for deoptimizing instructions that
6651 // may be inserted before this instruction. 6651 // may be inserted before this instruction.
6652 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, 6652 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
6653 GetDeoptId(), 6653 GetDeoptId(),
6654 Token::kNoSourcePos); 6654 TokenDescriptor::kNoSource);
6655 } 6655 }
6656 if (HasParallelMove()) { 6656 if (HasParallelMove()) {
6657 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); 6657 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
6658 } 6658 }
6659 6659
6660 // We can fall through if the successor is the next block in the list. 6660 // We can fall through if the successor is the next block in the list.
6661 // Otherwise, we need a jump. 6661 // Otherwise, we need a jump.
6662 if (!compiler->CanFallThroughTo(successor())) { 6662 if (!compiler->CanFallThroughTo(successor())) {
6663 __ b(compiler->GetJumpLabel(successor())); 6663 __ b(compiler->GetJumpLabel(successor()));
6664 } 6664 }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
6847 locs->set_out(0, Location::RegisterLocation(R0)); 6847 locs->set_out(0, Location::RegisterLocation(R0));
6848 return locs; 6848 return locs;
6849 } 6849 }
6850 6850
6851 6851
6852 void GrowRegExpStackInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 6852 void GrowRegExpStackInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
6853 const Register typed_data = locs()->in(0).reg(); 6853 const Register typed_data = locs()->in(0).reg();
6854 const Register result = locs()->out(0).reg(); 6854 const Register result = locs()->out(0).reg();
6855 __ PushObject(Object::null_object()); 6855 __ PushObject(Object::null_object());
6856 __ Push(typed_data); 6856 __ Push(typed_data);
6857 compiler->GenerateRuntimeCall(Token::kNoSourcePos, // No token position. 6857 compiler->GenerateRuntimeCall(TokenDescriptor::kNoSource,
6858 deopt_id(), 6858 deopt_id(),
6859 kGrowRegExpStackRuntimeEntry, 6859 kGrowRegExpStackRuntimeEntry,
6860 1, 6860 1,
6861 locs()); 6861 locs());
6862 __ Drop(1); 6862 __ Drop(1);
6863 __ Pop(result); 6863 __ Pop(result);
6864 } 6864 }
6865 6865
6866 6866
6867 } // namespace dart 6867 } // namespace dart
6868 6868
6869 #endif // defined TARGET_ARCH_ARM 6869 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698