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

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

Issue 1332923005: Remove remaining uses of null's absolute address from non-IA32. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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_arm64.cc ('k') | runtime/vm/intermediate_language_x64.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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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"
11 #include "vm/flow_graph.h" 11 #include "vm/flow_graph.h"
12 #include "vm/flow_graph_compiler.h" 12 #include "vm/flow_graph_compiler.h"
13 #include "vm/flow_graph_range_analysis.h" 13 #include "vm/flow_graph_range_analysis.h"
14 #include "vm/locations.h" 14 #include "vm/locations.h"
15 #include "vm/object_store.h" 15 #include "vm/object_store.h"
16 #include "vm/parser.h" 16 #include "vm/parser.h"
17 #include "vm/simulator.h" 17 #include "vm/simulator.h"
18 #include "vm/stack_frame.h" 18 #include "vm/stack_frame.h"
19 #include "vm/stub_code.h" 19 #include "vm/stub_code.h"
20 #include "vm/symbols.h" 20 #include "vm/symbols.h"
21 21
22 #define __ compiler->assembler()-> 22 #define __ compiler->assembler()->
23 23
24 namespace dart { 24 namespace dart {
25 25
26 DECLARE_FLAG(bool, allow_absolute_addresses);
26 DECLARE_FLAG(bool, emit_edge_counters); 27 DECLARE_FLAG(bool, emit_edge_counters);
27 DECLARE_FLAG(int, optimization_counter_threshold); 28 DECLARE_FLAG(int, optimization_counter_threshold);
28 DECLARE_FLAG(bool, use_osr); 29 DECLARE_FLAG(bool, use_osr);
29 30
30 // Generic summary for call instructions that have all arguments pushed 31 // Generic summary for call instructions that have all arguments pushed
31 // on the stack and return the result in a fixed register V0. 32 // on the stack and return the result in a fixed register V0.
32 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { 33 LocationSummary* Instruction::MakeCallSummary(Zone* zone) {
33 LocationSummary* result = new(zone) LocationSummary( 34 LocationSummary* result = new(zone) LocationSummary(
34 zone, 0, 0, LocationSummary::kCall); 35 zone, 0, 0, LocationSummary::kCall);
35 result->set_out(0, Location::RegisterLocation(V0)); 36 result->set_out(0, Location::RegisterLocation(V0));
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 __ LoadImmediate(TMP, field_cid); 1731 __ LoadImmediate(TMP, field_cid);
1731 __ subu(CMPRES1, value_cid_reg, TMP); 1732 __ subu(CMPRES1, value_cid_reg, TMP);
1732 } 1733 }
1733 1734
1734 if (field().is_nullable() && (field_cid != kNullCid)) { 1735 if (field().is_nullable() && (field_cid != kNullCid)) {
1735 __ beq(CMPRES1, ZR, &ok); 1736 __ beq(CMPRES1, ZR, &ok);
1736 if (field_cid != kSmiCid) { 1737 if (field_cid != kSmiCid) {
1737 __ LoadImmediate(TMP, kNullCid); 1738 __ LoadImmediate(TMP, kNullCid);
1738 __ subu(CMPRES1, value_cid_reg, TMP); 1739 __ subu(CMPRES1, value_cid_reg, TMP);
1739 } else { 1740 } else {
1740 __ LoadImmediate(TMP, reinterpret_cast<int32_t>(Object::null())); 1741 __ LoadObject(TMP, Object::null_object());
1741 __ subu(CMPRES1, value_reg, TMP); 1742 __ subu(CMPRES1, value_reg, TMP);
1742 } 1743 }
1743 } 1744 }
1744 1745
1745 __ bne(CMPRES1, ZR, fail); 1746 __ bne(CMPRES1, ZR, fail);
1746 } else { 1747 } else {
1747 // Both value's and field's class id is known. 1748 // Both value's and field's class id is known.
1748 ASSERT((value_cid != field_cid) && (value_cid != nullability)); 1749 ASSERT((value_cid != field_cid) && (value_cid != nullability));
1749 __ b(fail); 1750 __ b(fail);
1750 } 1751 }
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2197 kLengthReg); 2198 kLengthReg);
2198 2199
2199 // Initialize all array elements to raw_null. 2200 // Initialize all array elements to raw_null.
2200 // V0: new object start as a tagged pointer. 2201 // V0: new object start as a tagged pointer.
2201 // T1: new object end address. 2202 // T1: new object end address.
2202 // T2: iterator which initially points to the start of the variable 2203 // T2: iterator which initially points to the start of the variable
2203 // data area to be initialized. 2204 // data area to be initialized.
2204 // T7: null. 2205 // T7: null.
2205 if (num_elements > 0) { 2206 if (num_elements > 0) {
2206 const intptr_t array_size = instance_size - sizeof(RawArray); 2207 const intptr_t array_size = instance_size - sizeof(RawArray);
2207 __ LoadImmediate(T7, reinterpret_cast<int32_t>(Object::null())); 2208 __ LoadObject(T7, Object::null_object());
2208 __ AddImmediate(T2, V0, sizeof(RawArray) - kHeapObjectTag); 2209 __ AddImmediate(T2, V0, sizeof(RawArray) - kHeapObjectTag);
2209 if (array_size < (kInlineArraySize * kWordSize)) { 2210 if (array_size < (kInlineArraySize * kWordSize)) {
2210 intptr_t current_offset = 0; 2211 intptr_t current_offset = 0;
2211 while (current_offset < array_size) { 2212 while (current_offset < array_size) {
2212 __ sw(T7, Address(T2, current_offset)); 2213 __ sw(T7, Address(T2, current_offset));
2213 current_offset += kWordSize; 2214 current_offset += kWordSize;
2214 } 2215 }
2215 } else { 2216 } else {
2216 Label init_loop; 2217 Label init_loop;
2217 __ Bind(&init_loop); 2218 __ Bind(&init_loop);
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
2708 public: 2709 public:
2709 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) 2710 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
2710 : instruction_(instruction) { } 2711 : instruction_(instruction) { }
2711 2712
2712 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { 2713 virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
2713 if (FLAG_use_osr && osr_entry_label()->IsLinked()) { 2714 if (FLAG_use_osr && osr_entry_label()->IsLinked()) {
2714 uword flags_address = Isolate::Current()->stack_overflow_flags_address(); 2715 uword flags_address = Isolate::Current()->stack_overflow_flags_address();
2715 Register value = instruction_->locs()->temp(0).reg(); 2716 Register value = instruction_->locs()->temp(0).reg();
2716 __ Comment("CheckStackOverflowSlowPathOsr"); 2717 __ Comment("CheckStackOverflowSlowPathOsr");
2717 __ Bind(osr_entry_label()); 2718 __ Bind(osr_entry_label());
2719 ASSERT(FLAG_allow_absolute_addresses);
2718 __ LoadImmediate(TMP, flags_address); 2720 __ LoadImmediate(TMP, flags_address);
2719 __ LoadImmediate(value, Isolate::kOsrRequest); 2721 __ LoadImmediate(value, Isolate::kOsrRequest);
2720 __ sw(value, Address(TMP)); 2722 __ sw(value, Address(TMP));
2721 } 2723 }
2722 __ Comment("CheckStackOverflowSlowPath"); 2724 __ Comment("CheckStackOverflowSlowPath");
2723 __ Bind(entry_label()); 2725 __ Bind(entry_label());
2724 compiler->SaveLiveRegisters(instruction_->locs()); 2726 compiler->SaveLiveRegisters(instruction_->locs());
2725 // pending_deoptimization_env_ is needed to generate a runtime call that 2727 // pending_deoptimization_env_ is needed to generate a runtime call that
2726 // may throw an exception. 2728 // may throw an exception.
2727 ASSERT(compiler->pending_deoptimization_env_ == NULL); 2729 ASSERT(compiler->pending_deoptimization_env_ == NULL);
(...skipping 25 matching lines...) Expand all
2753 CheckStackOverflowInstr* instruction_; 2755 CheckStackOverflowInstr* instruction_;
2754 Label osr_entry_label_; 2756 Label osr_entry_label_;
2755 }; 2757 };
2756 2758
2757 2759
2758 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2760 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2759 __ Comment("CheckStackOverflowInstr"); 2761 __ Comment("CheckStackOverflowInstr");
2760 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this); 2762 CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this);
2761 compiler->AddSlowPathCode(slow_path); 2763 compiler->AddSlowPathCode(slow_path);
2762 2764
2763 if (compiler->is_optimizing()) { 2765 if (compiler->is_optimizing() && FLAG_allow_absolute_addresses) {
2764 __ LoadImmediate(TMP, Isolate::Current()->stack_limit_address()); 2766 __ LoadImmediate(TMP, Isolate::Current()->stack_limit_address());
2765 __ lw(CMPRES1, Address(TMP)); 2767 __ lw(CMPRES1, Address(TMP));
2766 } else { 2768 } else {
2767 __ LoadIsolate(TMP); 2769 __ LoadIsolate(TMP);
2768 __ lw(CMPRES1, Address(TMP, Isolate::stack_limit_offset())); 2770 __ lw(CMPRES1, Address(TMP, Isolate::stack_limit_offset()));
2769 } 2771 }
2770 __ BranchUnsignedLessEqual(SP, CMPRES1, slow_path->entry_label()); 2772 __ BranchUnsignedLessEqual(SP, CMPRES1, slow_path->entry_label());
2771 if (compiler->CanOSRFunction() && in_loop()) { 2773 if (compiler->CanOSRFunction() && in_loop()) {
2772 Register temp = locs()->temp(0).reg(); 2774 Register temp = locs()->temp(0).reg();
2773 // In unoptimized code check the usage counter to trigger OSR at loop 2775 // In unoptimized code check the usage counter to trigger OSR at loop
(...skipping 2827 matching lines...) Expand 10 before | Expand all | Expand 10 after
5601 1, 5603 1,
5602 locs()); 5604 locs());
5603 __ lw(result, Address(SP, 1 * kWordSize)); 5605 __ lw(result, Address(SP, 1 * kWordSize));
5604 __ addiu(SP, SP, Immediate(2 * kWordSize)); 5606 __ addiu(SP, SP, Immediate(2 * kWordSize));
5605 } 5607 }
5606 5608
5607 5609
5608 } // namespace dart 5610 } // namespace dart
5609 5611
5610 #endif // defined TARGET_ARCH_MIPS 5612 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698