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

Unified Diff: runtime/vm/intermediate_language.h

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/flow_graph_type_propagator.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 594355fb32308505e78e7f0ecb451e5c327276b0..a7f522d53e370fed2149c6fc911e95fe43533582 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -514,7 +514,7 @@ class EmbeddedArray<T, 0> {
M(CheckArrayBound) \
M(Constraint) \
M(StringToCharCode) \
- M(StringFromCharCode) \
+ M(OneByteStringFromCharCode) \
M(StringInterpolate) \
M(InvokeMathCFunction) \
M(MergedMath) \
@@ -3929,17 +3929,14 @@ class LoadCodeUnitsInstr : public TemplateDefinition<2, NoThrow> {
};
-class StringFromCharCodeInstr : public TemplateDefinition<1, NoThrow, Pure> {
+class OneByteStringFromCharCodeInstr
+ : public TemplateDefinition<1, NoThrow, Pure> {
public:
- StringFromCharCodeInstr(Value* char_code, intptr_t cid) : cid_(cid) {
- ASSERT(char_code != NULL);
- ASSERT(char_code->definition()->IsLoadIndexed());
- ASSERT(char_code->definition()->AsLoadIndexed()->class_id() ==
- kOneByteStringCid);
+ explicit OneByteStringFromCharCodeInstr(Value* char_code) {
SetInputAt(0, char_code);
}
- DECLARE_INSTRUCTION(StringFromCharCode)
+ DECLARE_INSTRUCTION(OneByteStringFromCharCode)
virtual CompileType ComputeType() const;
Value* char_code() const { return inputs_[0]; }
@@ -3947,13 +3944,11 @@ class StringFromCharCodeInstr : public TemplateDefinition<1, NoThrow, Pure> {
virtual bool CanDeoptimize() const { return false; }
virtual bool AttributesEqual(Instruction* other) const {
- return other->AsStringFromCharCode()->cid_ == cid_;
+ return true;
}
private:
- const intptr_t cid_;
-
- DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr);
+ DISALLOW_COPY_AND_ASSIGN(OneByteStringFromCharCodeInstr);
};
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698