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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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" |
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
932 bool opt) const { | 932 bool opt) const { |
933 const intptr_t kNumInputs = 1; | 933 const intptr_t kNumInputs = 1; |
934 return LocationSummary::Make(isolate, | 934 return LocationSummary::Make(isolate, |
935 kNumInputs, | 935 kNumInputs, |
936 Location::SameAsFirstInput(), | 936 Location::SameAsFirstInput(), |
937 LocationSummary::kNoCall); | 937 LocationSummary::kNoCall); |
938 } | 938 } |
939 | 939 |
940 | 940 |
941 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 941 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
942 Register object = locs()->in(0).reg(); | 942 Register obj = locs()->in(0).reg(); |
943 Register result = locs()->out(0).reg(); | 943 Register result = locs()->out(0).reg(); |
944 __ movl(result, FieldAddress(object, offset())); | 944 if (object()->definition()->representation() == kUntagged) { |
945 __ movl(result, Address(obj, offset())); | |
946 } else { | |
947 __ movl(result, FieldAddress(obj, offset())); | |
Vyacheslav Egorov (Google)
2014/11/27 14:27:43
ASSERT(representation == kTagged)
| |
948 } | |
945 } | 949 } |
946 | 950 |
947 | 951 |
948 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, | 952 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, |
949 bool opt) const { | 953 bool opt) const { |
950 const intptr_t kNumInputs = 1; | 954 const intptr_t kNumInputs = 1; |
951 return LocationSummary::Make(isolate, | 955 return LocationSummary::Make(isolate, |
952 kNumInputs, | 956 kNumInputs, |
953 Location::RequiresRegister(), | 957 Location::RequiresRegister(), |
954 LocationSummary::kNoCall); | 958 LocationSummary::kNoCall); |
(...skipping 2763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3718 } else { | 3722 } else { |
3719 ASSERT(representation() == kTagged); | 3723 ASSERT(representation() == kTagged); |
3720 summary->set_out(0, Location::RequiresRegister()); | 3724 summary->set_out(0, Location::RequiresRegister()); |
3721 } | 3725 } |
3722 | 3726 |
3723 return summary; | 3727 return summary; |
3724 } | 3728 } |
3725 | 3729 |
3726 | 3730 |
3727 void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3731 void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3732 // The array register points to the backing store for external arrays. | |
3728 const Register array = locs()->in(0).reg(); | 3733 const Register array = locs()->in(0).reg(); |
3729 const Location index = locs()->in(1); | 3734 const Location index = locs()->in(1); |
3730 | 3735 |
3731 Address element_address = Assembler::ElementAddressForRegIndex( | 3736 Address element_address = Assembler::ElementAddressForRegIndex( |
3732 IsExternal(), class_id(), index_scale(), array, index.reg()); | 3737 IsExternal(), class_id(), index_scale(), array, index.reg()); |
3733 | 3738 |
3734 if ((index_scale() == 1)) { | 3739 if ((index_scale() == 1)) { |
3735 __ SmiUntag(index.reg()); | 3740 __ SmiUntag(index.reg()); |
3736 } | 3741 } |
3737 | 3742 |
(...skipping 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6800 #if defined(DEBUG) | 6805 #if defined(DEBUG) |
6801 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6806 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
6802 #endif | 6807 #endif |
6803 } | 6808 } |
6804 | 6809 |
6805 } // namespace dart | 6810 } // namespace dart |
6806 | 6811 |
6807 #undef __ | 6812 #undef __ |
6808 | 6813 |
6809 #endif // defined TARGET_ARCH_IA32 | 6814 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |