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

Unified Diff: runtime/vm/intermediate_language_dbc.cc

Issue 2104093003: DBC: Implement OneByteStringFromCharCode and StringToCharCode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 years, 6 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/constants_dbc.h ('k') | runtime/vm/simulator_dbc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_dbc.cc
diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc
index aef3bb86e2d5b435a6026baa361edf76f6a67611..c1719d4dbfaafc931d594146bc7f1347b5864163 100644
--- a/runtime/vm/intermediate_language_dbc.cc
+++ b/runtime/vm/intermediate_language_dbc.cc
@@ -55,8 +55,6 @@ DECLARE_FLAG(int, optimization_counter_threshold);
M(BinaryMintOp) \
M(ShiftMintOp) \
M(UnaryMintOp) \
- M(StringToCharCode) \
- M(OneByteStringFromCharCode) \
M(InvokeMathCFunction) \
M(MergedMath) \
M(GuardFieldClass) \
@@ -599,6 +597,27 @@ EMIT_NATIVE_CODE(NativeCall,
}
+EMIT_NATIVE_CODE(OneByteStringFromCharCode,
+ 1, Location::RequiresRegister(),
+ LocationSummary::kNoCall) {
+ ASSERT(compiler->is_optimizing());
+ const Register char_code = locs()->in(0).reg(); // Char code is a smi.
+ const Register result = locs()->out(0).reg();
+ __ OneByteStringFromCharCode(result, char_code);
+}
+
+
+EMIT_NATIVE_CODE(StringToCharCode,
+ 1, Location::RequiresRegister(),
+ LocationSummary::kNoCall) {
+ ASSERT(cid_ == kOneByteStringCid);
+ const Register str = locs()->in(0).reg();
+ const Register result = locs()->out(0).reg(); // Result char code is a smi.
+ __ StringToCharCode(result, str);
+}
+
+
+
EMIT_NATIVE_CODE(AllocateObject,
0, Location::RequiresRegister(),
LocationSummary::kCall) {
« no previous file with comments | « runtime/vm/constants_dbc.h ('k') | runtime/vm/simulator_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698