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

Unified Diff: runtime/vm/intermediate_language_mips.cc

Issue 1961393002: VM: Optimized code for all of [External]{One|Two}ByteString::codeUnitAt. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comment Created 4 years, 7 months 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 7bbfb552f7563eb588d89a8ba90245d71e9cb535..b1b078fe991af39f8067f7353af9214aa33abdbc 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -1019,8 +1019,8 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Zone* zone,
- bool opt) const {
+LocationSummary* OneByteStringFromCharCodeInstr::MakeLocationSummary(
+ Zone* zone, bool opt) const {
const intptr_t kNumInputs = 1;
// TODO(fschneider): Allow immediate operands for the char code.
return LocationSummary::Make(zone,
@@ -1030,13 +1030,12 @@ LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Zone* zone,
}
-void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void OneByteStringFromCharCodeInstr::EmitNativeCode(
+ FlowGraphCompiler* compiler) {
ASSERT(compiler->is_optimizing());
Register char_code = locs()->in(0).reg();
Register result = locs()->out(0).reg();
- __ Comment("StringFromCharCodeInstr");
-
__ lw(result, Address(THR, Thread::predefined_symbols_address_offset()));
__ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize);
__ sll(TMP, char_code, 1); // Char code is a smi.
@@ -1169,6 +1168,8 @@ CompileType LoadIndexedInstr::ComputeType() const {
case kTypedDataUint16ArrayCid:
case kOneByteStringCid:
case kTwoByteStringCid:
+ case kExternalOneByteStringCid:
+ case kExternalTwoByteStringCid:
return CompileType::FromCid(kSmiCid);
case kTypedDataInt32ArrayCid:
@@ -1195,6 +1196,8 @@ Representation LoadIndexedInstr::representation() const {
case kTypedDataUint16ArrayCid:
case kOneByteStringCid:
case kTwoByteStringCid:
+ case kExternalOneByteStringCid:
+ case kExternalTwoByteStringCid:
return kTagged;
case kTypedDataInt32ArrayCid:
return kUnboxedInt32;
@@ -1321,6 +1324,7 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
case kExternalTypedDataUint8ArrayCid:
case kExternalTypedDataUint8ClampedArrayCid:
case kOneByteStringCid:
+ case kExternalOneByteStringCid:
ASSERT(index_scale() == 1);
__ lbu(result, element_address);
__ SmiTag(result);
@@ -1331,6 +1335,7 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
break;
case kTypedDataUint16ArrayCid:
case kTwoByteStringCid:
+ case kExternalTwoByteStringCid:
__ lhu(result, element_address);
__ SmiTag(result);
break;
« 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