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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 11628011: Inline ByteArrayBase.length in the flow graph optimizer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | 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 16262)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -229,17 +229,21 @@
}
+static bool IsRecognizedLibrary(const Library& library) {
+ // List of libraries where methods can be recognized.
+ return (library.raw() == Library::CoreLibrary())
+ || (library.raw() == Library::MathLibrary())
+ || (library.raw() == Library::ScalarlistLibrary());
+}
+
MethodRecognizer::Kind MethodRecognizer::RecognizeKind(
const Function& function) {
- // Only core and math library methods can be recognized.
- const Library& core_lib = Library::Handle(Library::CoreLibrary());
- const Library& math_lib = Library::Handle(Library::MathLibrary());
const Class& function_class = Class::Handle(function.Owner());
- if ((function_class.library() != core_lib.raw()) &&
- (function_class.library() != math_lib.raw())) {
+ const Library& lib = Library::Handle(function_class.library());
+ if (!IsRecognizedLibrary(lib)) {
return kUnknown;
}
- const Library& lib = Library::Handle(function_class.library());
+
const String& function_name = String::Handle(function.name());
const String& class_name = String::Handle(function_class.Name());
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698