| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/flow_graph_builder.h" | 8 #include "vm/flow_graph_builder.h" |
| 9 #include "vm/flow_graph_compiler.h" | 9 #include "vm/flow_graph_compiler.h" |
| 10 #include "vm/locations.h" | 10 #include "vm/locations.h" |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 __ Bind(compiler->GetBlockLabel(this)); | 886 __ Bind(compiler->GetBlockLabel(this)); |
| 887 if (HasTryIndex()) { | 887 if (HasTryIndex()) { |
| 888 compiler->AddExceptionHandler(try_index(), | 888 compiler->AddExceptionHandler(try_index(), |
| 889 compiler->assembler()->CodeSize()); | 889 compiler->assembler()->CodeSize()); |
| 890 } | 890 } |
| 891 } | 891 } |
| 892 | 892 |
| 893 | 893 |
| 894 LocationSummary* StoreInstanceFieldComp::MakeLocationSummary() const { | 894 LocationSummary* StoreInstanceFieldComp::MakeLocationSummary() const { |
| 895 const intptr_t kNumInputs = 2; | 895 const intptr_t kNumInputs = 2; |
| 896 intptr_t num_temps = (class_ids() == NULL) ? 0 : 1; | 896 const intptr_t num_temps = HasICData() ? 1 : 0; |
| 897 LocationSummary* summary = new LocationSummary(kNumInputs, num_temps); | 897 LocationSummary* summary = new LocationSummary(kNumInputs, num_temps); |
| 898 summary->set_in(0, Location::RequiresRegister()); | 898 summary->set_in(0, Location::RequiresRegister()); |
| 899 summary->set_in(1, Location::RequiresRegister()); | 899 summary->set_in(1, Location::RequiresRegister()); |
| 900 if (class_ids() != NULL) { | 900 if (HasICData()) { |
| 901 summary->set_temp(0, Location::RequiresRegister()); | 901 summary->set_temp(0, Location::RequiresRegister()); |
| 902 } | 902 } |
| 903 return summary; | 903 return summary; |
| 904 } | 904 } |
| 905 | 905 |
| 906 | 906 |
| 907 void StoreInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 907 void StoreInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 908 ASSERT(VerifyValues(instance(), value())); | 908 ASSERT(VerifyValues(instance(), value())); |
| 909 Register instance = locs()->in(0).reg(); | 909 Register instance_reg = locs()->in(0).reg(); |
| 910 Register value = locs()->in(1).reg(); | 910 Register value_reg = locs()->in(1).reg(); |
| 911 | 911 |
| 912 if (class_ids() != NULL) { | 912 if (HasICData()) { |
| 913 ASSERT(original() != NULL); | 913 ASSERT(original() != NULL); |
| 914 Label* deopt = compiler->AddDeoptStub(original()->cid(), | 914 Label* deopt = compiler->AddDeoptStub(original()->cid(), |
| 915 original()->token_index(), | 915 original()->token_index(), |
| 916 original()->try_index(), | 916 original()->try_index(), |
| 917 kDeoptInstanceGetterSameTarget, | 917 kDeoptInstanceGetterSameTarget, |
| 918 instance, | 918 instance_reg, |
| 919 value); | 919 value_reg); |
| 920 // Smis do not have instance fields (Smi class is always first). | 920 // Smis do not have instance fields (Smi class is always first). |
| 921 Register temp = locs()->temp(0).reg(); | 921 Register temp_reg = locs()->temp(0).reg(); |
| 922 ASSERT(temp != instance); | 922 ASSERT(temp_reg != instance_reg); |
| 923 ASSERT(temp != value); | 923 ASSERT(temp_reg != value_reg); |
| 924 compiler->EmitClassChecksNoSmi(*class_ids(), instance, temp, deopt); | 924 ASSERT(ic_data() != NULL); |
| 925 compiler->EmitClassChecksNoSmi(*ic_data(), instance_reg, temp_reg, deopt); |
| 925 } | 926 } |
| 926 __ StoreIntoObject(instance, FieldAddress(instance, field().Offset()), | 927 __ StoreIntoObject(instance_reg, FieldAddress(instance_reg, field().Offset()), |
| 927 value); | 928 value_reg); |
| 928 } | 929 } |
| 929 | 930 |
| 930 | 931 |
| 931 LocationSummary* ThrowInstr::MakeLocationSummary() const { | 932 LocationSummary* ThrowInstr::MakeLocationSummary() const { |
| 932 const int kNumInputs = 0; | 933 const int kNumInputs = 0; |
| 933 const int kNumTemps = 0; | 934 const int kNumTemps = 0; |
| 934 return new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 935 return new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
| 935 } | 936 } |
| 936 | 937 |
| 937 | 938 |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1278 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); | 1279 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); |
| 1279 compiler->GenerateCall(token_index(), try_index(), &label, | 1280 compiler->GenerateCall(token_index(), try_index(), &label, |
| 1280 PcDescriptors::kOther); | 1281 PcDescriptors::kOther); |
| 1281 __ Drop(2); // Discard type arguments and receiver. | 1282 __ Drop(2); // Discard type arguments and receiver. |
| 1282 } | 1283 } |
| 1283 | 1284 |
| 1284 | 1285 |
| 1285 #undef __ | 1286 #undef __ |
| 1286 | 1287 |
| 1287 } // namespace dart | 1288 } // namespace dart |
| OLD | NEW |