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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 11416129: Inline [] operator on one-byte strings. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: removed unnecessary change Created 8 years, 1 month 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
Index: runtime/vm/intermediate_language_x64.cc
===================================================================
--- runtime/vm/intermediate_language_x64.cc (revision 15197)
+++ runtime/vm/intermediate_language_x64.cc (working copy)
@@ -992,6 +992,30 @@
}
+LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* locs =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ // TODO(fschneider): Allow immediate operands for the char code.
+ locs->set_in(0, Location::RequiresRegister());
+ locs->set_out(Location::RequiresRegister());
+ return locs;
+}
+
+
+void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ Register char_code = locs()->in(0).reg();
+ Register result = locs()->out().reg();
+ __ movq(result,
+ Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress())));
+ __ movq(result, Address(result,
+ char_code,
+ TIMES_HALF_WORD_SIZE, // Char code is a smi.
+ Symbols::kNullCharId * kWordSize));
+}
+
+
LocationSummary* LoadIndexedInstr::MakeLocationSummary() const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;

Powered by Google App Engine
This is Rietveld 408576698