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

Unified Diff: runtime/vm/intermediate_language_x64.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index e45d1501eb485b9950231be87e7d7b6caabf0a89..94baf54c53b4848bfb74da1f58d5582143948ba4 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -889,9 +889,14 @@ LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate,
void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- Register object = locs()->in(0).reg();
+ Register obj = locs()->in(0).reg();
Register result = locs()->out(0).reg();
- __ movq(result, FieldAddress(object, offset()));
+ if (object()->definition()->representation() == kUntagged) {
+ __ movq(result, Address(obj, offset()));
+ } else {
+ ASSERT(object()->definition()->representation() == kTagged);
+ __ movq(result, FieldAddress(obj, offset()));
+ }
}
@@ -1148,11 +1153,12 @@ LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Isolate* isolate,
void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- const Register array = locs()->in(0).reg();
+ // The string register points to the backing store for external strings.
+ const Register str = locs()->in(0).reg();
const Location index = locs()->in(1);
Address element_address = Assembler::ElementAddressForRegIndex(
- IsExternal(), class_id(), index_scale(), array, index.reg());
+ IsExternal(), class_id(), index_scale(), str, index.reg());
if ((index_scale() == 1)) {
__ SmiUntag(index.reg());
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698