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

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

Issue 765743003: Support use of external strings as inputs to LoadCodeUnitsInstr. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: safety Created 6 years 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_mips.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_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
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 ASSERT(object()->definition()->representation() == kTagged);
948 __ movl(result, FieldAddress(obj, offset()));
949 }
945 } 950 }
946 951
947 952
948 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, 953 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate,
949 bool opt) const { 954 bool opt) const {
950 const intptr_t kNumInputs = 1; 955 const intptr_t kNumInputs = 1;
951 return LocationSummary::Make(isolate, 956 return LocationSummary::Make(isolate,
952 kNumInputs, 957 kNumInputs,
953 Location::RequiresRegister(), 958 Location::RequiresRegister(),
954 LocationSummary::kNoCall); 959 LocationSummary::kNoCall);
(...skipping 2763 matching lines...) Expand 10 before | Expand all | Expand 10 after
3718 } else { 3723 } else {
3719 ASSERT(representation() == kTagged); 3724 ASSERT(representation() == kTagged);
3720 summary->set_out(0, Location::RequiresRegister()); 3725 summary->set_out(0, Location::RequiresRegister());
3721 } 3726 }
3722 3727
3723 return summary; 3728 return summary;
3724 } 3729 }
3725 3730
3726 3731
3727 void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3732 void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3728 const Register array = locs()->in(0).reg(); 3733 // The string register points to the backing store for external strings.
3734 const Register str = locs()->in(0).reg();
3729 const Location index = locs()->in(1); 3735 const Location index = locs()->in(1);
3730 3736
3731 Address element_address = Assembler::ElementAddressForRegIndex( 3737 Address element_address = Assembler::ElementAddressForRegIndex(
3732 IsExternal(), class_id(), index_scale(), array, index.reg()); 3738 IsExternal(), class_id(), index_scale(), str, index.reg());
3733 3739
3734 if ((index_scale() == 1)) { 3740 if ((index_scale() == 1)) {
3735 __ SmiUntag(index.reg()); 3741 __ SmiUntag(index.reg());
3736 } 3742 }
3737 3743
3738 if (representation() == kUnboxedMint) { 3744 if (representation() == kUnboxedMint) {
3739 ASSERT(compiler->is_optimizing()); 3745 ASSERT(compiler->is_optimizing());
3740 ASSERT(locs()->out(0).IsPairLocation()); 3746 ASSERT(locs()->out(0).IsPairLocation());
3741 PairLocation* result_pair = locs()->out(0).AsPairLocation(); 3747 PairLocation* result_pair = locs()->out(0).AsPairLocation();
3742 Register result1 = result_pair->At(0).reg(); 3748 Register result1 = result_pair->At(0).reg();
(...skipping 3057 matching lines...) Expand 10 before | Expand all | Expand 10 after
6800 #if defined(DEBUG) 6806 #if defined(DEBUG)
6801 __ movl(EDX, Immediate(kInvalidObjectPointer)); 6807 __ movl(EDX, Immediate(kInvalidObjectPointer));
6802 #endif 6808 #endif
6803 } 6809 }
6804 6810
6805 } // namespace dart 6811 } // namespace dart
6806 6812
6807 #undef __ 6813 #undef __
6808 6814
6809 #endif // defined TARGET_ARCH_IA32 6815 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698