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

Unified Diff: src/ast.h

Issue 8883011: Implement ICs for constructor calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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
« no previous file with comments | « no previous file | src/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 805526af5e37425dead36dc6a8e7ccdc11ffcf5e..df7881b946692532c36cab98931bccdf339440a7 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -1227,22 +1227,18 @@ class Property: public Expression {
};
-class Call: public Expression {
+// Base class for normal calls and constructor calls.
+class CallBase: public Expression {
public:
- Call(Isolate* isolate,
- Expression* expression,
- ZoneList<Expression*>* arguments,
- int pos)
+ CallBase(Isolate* isolate,
+ Expression* expression,
+ ZoneList<Expression*>* arguments,
+ int pos)
: Expression(isolate),
expression_(expression),
arguments_(arguments),
pos_(pos),
- is_monomorphic_(false),
- check_type_(RECEIVER_MAP_CHECK),
- return_id_(GetNextId(isolate)) {
- }
-
- DECLARE_NODE_TYPE(Call)
+ return_id_(GetNextId(isolate)) {}
virtual bool IsInlineable() const;
@@ -1250,18 +1246,6 @@ class Call: public Expression {
ZoneList<Expression*>* arguments() const { return arguments_; }
virtual int position() const { return pos_; }
- void RecordTypeFeedback(TypeFeedbackOracle* oracle,
- CallKind call_kind);
- virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; }
- virtual bool IsMonomorphic() { return is_monomorphic_; }
- CheckType check_type() const { return check_type_; }
- Handle<JSFunction> target() { return target_; }
- Handle<JSObject> holder() { return holder_; }
- Handle<JSGlobalPropertyCell> cell() { return cell_; }
-
- bool ComputeTarget(Handle<Map> type, Handle<String> name);
- bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupResult* lookup);
-
// Bailout support.
int ReturnId() const { return return_id_; }
@@ -1274,41 +1258,53 @@ class Call: public Expression {
Expression* expression_;
ZoneList<Expression*>* arguments_;
int pos_;
+ int return_id_;
+};
+
+
+class Call: public CallBase {
+ public:
+ Call(Isolate* isolate,
+ Expression* expression,
+ ZoneList<Expression*>* arguments,
+ int pos)
+ : CallBase(isolate, expression, arguments, pos),
+ is_monomorphic_(false),
+ check_type_(RECEIVER_MAP_CHECK) {}
+ DECLARE_NODE_TYPE(Call)
+
+ void RecordTypeFeedback(TypeFeedbackOracle* oracle,
+ CallKind call_kind);
+ virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; }
+ virtual bool IsMonomorphic() { return is_monomorphic_; }
+ CheckType check_type() const { return check_type_; }
+ Handle<JSFunction> target() { return target_; }
+ Handle<JSObject> holder() { return holder_; }
+ Handle<JSGlobalPropertyCell> cell() { return cell_; }
+
+ bool ComputeTarget(Handle<Map> type, Handle<String> name);
+ bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupResult* lookup);
+
+ private:
bool is_monomorphic_;
CheckType check_type_;
SmallMapList receiver_types_;
Handle<JSFunction> target_;
Handle<JSObject> holder_;
Handle<JSGlobalPropertyCell> cell_;
-
- int return_id_;
};
-class CallNew: public Expression {
+class CallNew: public CallBase {
public:
CallNew(Isolate* isolate,
Expression* expression,
ZoneList<Expression*>* arguments,
int pos)
- : Expression(isolate),
- expression_(expression),
- arguments_(arguments),
- pos_(pos) { }
+ : CallBase(isolate, expression, arguments, pos) {}
DECLARE_NODE_TYPE(CallNew)
-
- virtual bool IsInlineable() const;
-
- Expression* expression() const { return expression_; }
- ZoneList<Expression*>* arguments() const { return arguments_; }
- virtual int position() const { return pos_; }
-
- private:
- Expression* expression_;
- ZoneList<Expression*>* arguments_;
- int pos_;
};
« no previous file with comments | « no previous file | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698