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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 11970038: Remove StringCharCodeAtInstr and handle it as part of LoadIndexed. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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.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_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 17219)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -1066,54 +1066,6 @@
}
-LocationSummary* StringCharCodeAtInstr::MakeLocationSummary() const {
- const intptr_t kNumInputs = 2;
- const intptr_t kNumTemps = 0;
- LocationSummary* locs =
- new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
- locs->set_in(0, Location::RequiresRegister());
- // The smi index is either untagged and tagged again at the end of the
- // operation (element size == 1), or it is left smi tagged (for all element
- // sizes > 1).
- locs->set_in(1, CanBeImmediateIndex(index(), class_id())
- ? Location::RegisterOrSmiConstant(index())
- : Location::RequiresRegister());
- locs->set_out(Location::RequiresRegister());
- return locs;
-}
-
-
-void StringCharCodeAtInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- Register str = locs()->in(0).reg();
- Location index = locs()->in(1);
- Register result = locs()->out().reg();
-
- ASSERT((class_id() == kOneByteStringCid) ||
- (class_id() == kTwoByteStringCid));
-
- FieldAddress element_address = index.IsRegister() ?
- FlowGraphCompiler::ElementAddressForRegIndex(
- class_id(), str, index.reg()) :
- FlowGraphCompiler::ElementAddressForIntIndex(
- class_id(), str, Smi::Cast(index.constant()).Value());
-
- if (class_id() == kOneByteStringCid) {
- if (index.IsRegister()) {
- __ SmiUntag(index.reg());
- }
- __ movzxb(result, element_address);
- if (index.IsRegister()) {
- __ SmiTag(index.reg()); // Retag index.
- }
- __ SmiTag(result);
- } else {
- // Don't untag smi-index and use TIMES_1 for two byte strings.
- __ movzxw(result, element_address);
- __ SmiTag(result);
- }
-}
-
-
LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
@@ -1210,6 +1162,7 @@
case kInt8ArrayCid:
case kUint8ArrayCid:
case kUint8ClampedArrayCid:
+ case kOneByteStringCid:
if (index.IsRegister()) {
__ SmiUntag(index.reg());
}
@@ -1228,6 +1181,7 @@
__ SmiTag(result);
break;
case kUint16ArrayCid:
+ case kTwoByteStringCid:
__ movzxw(result, element_address);
__ SmiTag(result);
break;
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698