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

Unified Diff: runtime/vm/opt_code_generator_ia32.cc

Issue 8526005: Intrinsify StringBase.isEmpty and inline StringBase.get:length. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 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/intrinsifier_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/opt_code_generator_ia32.cc
===================================================================
--- runtime/vm/opt_code_generator_ia32.cc (revision 1406)
+++ runtime/vm/opt_code_generator_ia32.cc (working copy)
@@ -147,11 +147,12 @@
DISALLOW_COPY_AND_ASSIGN(DeoptimizationBlob);
};
-// TODO(srdjan): Add String_get:length, String_charCodeAt, String_hashCode.
+// TODO(srdjan): Add String_charCodeAt, String_hashCode.
#define RECOGNIZED_LIST(V) \
V(ObjectArray, get:length, ObjectArrayLength) \
V(GrowableObjectArray, get:length, GrowableArrayLength) \
+ V(StringBase, get:length, StringBaseLength) \
V(IntegerImplementation, toDouble, IntegerToDouble) \
V(Double, toDouble, DoubleToDouble) \
V(Math, sqrt, MathSqrt) \
@@ -168,6 +169,7 @@
#undef DEFINE_ENUM_LIST
};
+ // TODO(srdjan): Check that the library is the coreimpl one.
static Kind RecognizeKind(const Function& function) {
const String& recognize_name = String::Handle(function.name());
const String& recognize_class =
@@ -1334,6 +1336,11 @@
__ movl(EAX, FieldAddress(EBX, field_offset));
return;
}
+ case Recognizer::kStringBaseLength: {
+ TraceOpt(node, "Inlines StringBase.length");
+ __ movl(EAX, FieldAddress(EBX, String::length_offset()));
+ return;
+ }
default:
UNIMPLEMENTED();
}
@@ -1347,7 +1354,8 @@
}
Recognizer::Kind recognized = Recognizer::RecognizeKind(function);
if ((recognized == Recognizer::kObjectArrayLength) ||
- (recognized == Recognizer::kGrowableArrayLength)) {
+ (recognized == Recognizer::kGrowableArrayLength) ||
+ (recognized == Recognizer::kStringBaseLength)) {
return true;
}
return false;
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698