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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10542167: Inline Math.sqrt in new compilers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 8700)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -13,6 +13,34 @@
namespace dart {
+// TODO(srdjan): Add _ByteArrayBase, get:length.
+
+#define RECOGNIZED_LIST(V) \
+ V(ObjectArray, get:length, ObjectArrayLength) \
+ V(ImmutableArray, get:length, ImmutableArrayLength) \
+ V(GrowableObjectArray, get:length, GrowableArrayLength) \
+ V(StringBase, get:length, StringBaseLength) \
+ V(IntegerImplementation, toDouble, IntegerToDouble) \
+ V(Double, toDouble, DoubleToDouble) \
+ V(Math, sqrt, MathSqrt) \
+
+// Class that recognizes the name and owner of a function and returns the
+// corresponding enum. See RECOGNIZED_LIST above for list of recognizable
+// functions.
+class MethodRecognizer : public AllStatic {
+ public:
+ enum Kind {
+ kUnknown,
+#define DEFINE_ENUM_LIST(class_name, function_name, enum_name) k##enum_name,
+RECOGNIZED_LIST(DEFINE_ENUM_LIST)
+#undef DEFINE_ENUM_LIST
+ };
+
+ static Kind RecognizeKind(const Function& function);
+ static const char* KindToCString(Kind kind);
+};
+
+
class BitVector;
class FlowGraphCompiler;
class FlowGraphVisitor;
@@ -704,7 +732,8 @@
try_index_(try_index),
function_(function),
argument_names_(argument_names),
- arguments_(arguments) {
+ arguments_(arguments),
+ recognized_(MethodRecognizer::kUnknown) {
ASSERT(function.IsZoneHandle());
ASSERT(argument_names.IsZoneHandle());
}
@@ -720,6 +749,9 @@
intptr_t ArgumentCount() const { return arguments_->length(); }
Value* ArgumentAt(intptr_t index) const { return (*arguments_)[index]; }
+ MethodRecognizer::Kind recognized() const { return recognized_; }
+ void set_recognized(MethodRecognizer::Kind kind) { recognized_ = kind; }
+
virtual intptr_t InputCount() const;
virtual Value* InputAt(intptr_t i) const { return ArgumentAt(i); }
@@ -731,6 +763,7 @@
const Function& function_;
const Array& argument_names_;
ZoneGrowableArray<Value*>* arguments_;
+ MethodRecognizer::Kind recognized_;
DISALLOW_COPY_AND_ASSIGN(StaticCallComp);
};
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698