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

Unified Diff: runtime/vm/intermediate_language_mips.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_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_mips.cc
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index 1257aed0d757a0f6f3f6ee2cbe1edabf10ec3c26..cd1bb6d1ff9ae551d483dabe61d4a637d31922d8 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -1022,9 +1022,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();
- __ LoadFromOffset(result, object, offset() - kHeapObjectTag);
+ if (object()->definition()->representation() == kUntagged) {
+ __ LoadFromOffset(result, obj, offset());
+ } else {
+ ASSERT(object()->definition()->representation() == kTagged);
+ __ LoadFieldFromOffset(result, obj, offset());
+ }
}
@@ -1259,17 +1264,19 @@ 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 = __ ElementAddressForRegIndex(
- true, IsExternal(), class_id(), index_scale(), array, index.reg());
+ true, IsExternal(), class_id(), index_scale(), str, index.reg());
// Warning: element_address may use register TMP as base.
ASSERT(representation() == kTagged);
Register result = locs()->out(0).reg();
switch (class_id()) {
case kOneByteStringCid:
+ case kExternalOneByteStringCid:
switch (element_count()) {
case 1: __ lbu(result, element_address); break;
case 2: __ lhu(result, element_address); break;
@@ -1279,6 +1286,7 @@ void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ SmiTag(result);
break;
case kTwoByteStringCid:
+ case kExternalTwoByteStringCid:
switch (element_count()) {
case 1: __ lhu(result, element_address); break;
case 2: // Loading multiple code units is disabled on MIPS.
@@ -2241,8 +2249,7 @@ void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ Bind(&load_pointer);
}
- __ LoadFromOffset(
- result_reg, instance_reg, offset_in_bytes() - kHeapObjectTag);
+ __ LoadFieldFromOffset(result_reg, instance_reg, offset_in_bytes());
__ Bind(&done);
}
@@ -3321,13 +3328,11 @@ static void LoadInt32FromMint(FlowGraphCompiler* compiler,
Register mint,
Register result,
Label* deopt) {
- __ LoadFromOffset(result,
- mint,
- Mint::value_offset() - kHeapObjectTag);
+ __ LoadFieldFromOffset(result, mint, Mint::value_offset());
if (deopt != NULL) {
- __ LoadFromOffset(CMPRES1,
- mint,
- Mint::value_offset() - kHeapObjectTag + kWordSize);
+ __ LoadFieldFromOffset(CMPRES1,
+ mint,
+ Mint::value_offset() + kWordSize);
__ sra(CMPRES2, result, kBitsPerWord - 1);
__ BranchNotEqual(CMPRES1, CMPRES2, deopt);
}
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698