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.cc

Issue 11360033: Inline native String.charCodeAt in optimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments 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
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 14406)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -153,6 +153,13 @@
}
+bool StringCharCodeAtInstr::AttributesEqual(Instruction* other) const {
+ StringCharCodeAtInstr* other_load = other->AsStringCharCodeAt();
+ ASSERT(other_load != NULL);
+ return class_id() == other_load->class_id();
+}
+
+
bool LoadIndexedInstr::AttributesEqual(Instruction* other) const {
LoadIndexedInstr* other_load = other->AsLoadIndexed();
ASSERT(other_load != NULL);
@@ -1113,6 +1120,16 @@
}
+RawAbstractType* StringCharCodeAtInstr::CompileType() const {
+ return Type::IntType();
+}
+
+
+intptr_t StringCharCodeAtInstr::ResultCid() const {
+ return kSmiCid;
+}
+
+
RawAbstractType* LoadIndexedInstr::CompileType() const {
switch (class_id_) {
case kArrayCid:
@@ -2605,6 +2622,26 @@
}
+intptr_t CheckArrayBoundInstr::LengthOffsetFor(intptr_t class_id) {
+ switch (class_id) {
+ case kGrowableObjectArrayCid:
+ return GrowableObjectArray::length_offset();
+ case kFloat64ArrayCid:
+ return Float64Array::length_offset();
+ case kFloat32ArrayCid:
+ return Float32Array::length_offset();
+ case kOneByteStringCid:
+ case kTwoByteStringCid:
+ return String::length_offset();
+ case kArrayCid:
+ case kImmutableArrayCid:
+ return Array::length_offset();
+ default:
+ UNREACHABLE();
+ return -1;
+ }
+}
+
#undef __
} // namespace dart
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698