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

Unified Diff: src/ast.h

Issue 398053002: Introduce FLAG_vector_ics. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 5 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 | « src/arm64/lithium-codegen-arm64.cc ('k') | 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 b4aab4ec98d85c5c3f16c9e289f9ba5ee9384619..5a4a5ac6679e636a5dbed86fa5df852a210e45f3 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -1625,7 +1625,7 @@ class ArrayLiteral V8_FINAL : public MaterializedLiteral {
};
-class VariableProxy V8_FINAL : public Expression {
+class VariableProxy V8_FINAL : public Expression, public FeedbackSlotInterface {
public:
DECLARE_NODE_TYPE(VariableProxy)
@@ -1647,6 +1647,13 @@ class VariableProxy V8_FINAL : public Expression {
// Bind this proxy to the variable var. Interfaces must match.
void BindTo(Variable* var);
+ virtual int ComputeFeedbackSlotCount() { return FLAG_vector_ics ? 1 : 0; }
+ virtual void SetFirstFeedbackSlot(int slot) {
+ variable_feedback_slot_ = slot;
+ }
+
+ int VariableFeedbackSlot() { return variable_feedback_slot_; }
+
protected:
VariableProxy(Zone* zone, Variable* var, int position);
@@ -1661,10 +1668,11 @@ class VariableProxy V8_FINAL : public Expression {
bool is_this_;
bool is_assigned_;
Interface* interface_;
+ int variable_feedback_slot_;
};
-class Property V8_FINAL : public Expression {
+class Property V8_FINAL : public Expression, public FeedbackSlotInterface {
public:
DECLARE_NODE_TYPE(Property)
@@ -1700,6 +1708,13 @@ class Property V8_FINAL : public Expression {
TypeFeedbackId PropertyFeedbackId() { return reuse(id()); }
+ virtual int ComputeFeedbackSlotCount() { return FLAG_vector_ics ? 1 : 0; }
+ virtual void SetFirstFeedbackSlot(int slot) {
+ property_feedback_slot_ = slot;
+ }
+
+ int PropertyFeedbackSlot() const { return property_feedback_slot_; }
+
protected:
Property(Zone* zone,
Expression* obj,
@@ -1709,6 +1724,7 @@ class Property V8_FINAL : public Expression {
obj_(obj),
key_(key),
load_id_(GetNextId(zone)),
+ property_feedback_slot_(kInvalidFeedbackSlot),
is_for_call_(false),
is_uninitialized_(false),
is_string_access_(false),
@@ -1718,6 +1734,7 @@ class Property V8_FINAL : public Expression {
Expression* obj_;
Expression* key_;
const BailoutId load_id_;
+ int property_feedback_slot_;
SmallMapList receiver_types_;
bool is_for_call_ : 1;
@@ -1895,7 +1912,7 @@ class CallNew V8_FINAL : public Expression, public FeedbackSlotInterface {
// language construct. Instead it is used to call a C or JS function
// with a set of arguments. This is used from the builtins that are
// implemented in JavaScript (see "v8natives.js").
-class CallRuntime V8_FINAL : public Expression {
+class CallRuntime V8_FINAL : public Expression, public FeedbackSlotInterface {
public:
DECLARE_NODE_TYPE(CallRuntime)
@@ -1905,6 +1922,20 @@ class CallRuntime V8_FINAL : public Expression {
ZoneList<Expression*>* arguments() const { return arguments_; }
bool is_jsruntime() const { return function_ == NULL; }
+ // Type feedback information.
+ virtual int ComputeFeedbackSlotCount() {
+ return (FLAG_vector_ics && is_jsruntime()) ? 1 : 0;
+ }
+ virtual void SetFirstFeedbackSlot(int slot) {
+ callruntime_feedback_slot_ = slot;
+ }
+
+ int CallRuntimeFeedbackSlot() {
+ ASSERT(!is_jsruntime() ||
+ callruntime_feedback_slot_ != kInvalidFeedbackSlot);
+ return callruntime_feedback_slot_;
+ }
+
TypeFeedbackId CallRuntimeFeedbackId() const { return reuse(id()); }
protected:
@@ -1922,6 +1953,7 @@ class CallRuntime V8_FINAL : public Expression {
const AstRawString* raw_name_;
const Runtime::Function* function_;
ZoneList<Expression*>* arguments_;
+ int callruntime_feedback_slot_;
};
@@ -2215,7 +2247,7 @@ class Assignment V8_FINAL : public Expression {
};
-class Yield V8_FINAL : public Expression {
+class Yield V8_FINAL : public Expression, public FeedbackSlotInterface {
public:
DECLARE_NODE_TYPE(Yield)
@@ -2242,6 +2274,29 @@ class Yield V8_FINAL : public Expression {
index_ = index;
}
+ // Type feedback information.
+ virtual int ComputeFeedbackSlotCount() {
+ return (FLAG_vector_ics && yield_kind() == DELEGATING) ? 3 : 0;
+ }
+ virtual void SetFirstFeedbackSlot(int slot) {
+ yield_first_feedback_slot_ = slot;
+ }
+
+ int KeyedLoadFeedbackSlot() {
+ ASSERT(yield_first_feedback_slot_ != kInvalidFeedbackSlot);
+ return yield_first_feedback_slot_;
+ }
+
+ int DoneFeedbackSlot() {
+ ASSERT(yield_first_feedback_slot_ != kInvalidFeedbackSlot);
+ return yield_first_feedback_slot_ + 1;
+ }
+
+ int ValueFeedbackSlot() {
+ ASSERT(yield_first_feedback_slot_ != kInvalidFeedbackSlot);
+ return yield_first_feedback_slot_ + 2;
+ }
+
protected:
Yield(Zone* zone,
Expression* generator_object,
@@ -2252,13 +2307,15 @@ class Yield V8_FINAL : public Expression {
generator_object_(generator_object),
expression_(expression),
yield_kind_(yield_kind),
- index_(-1) { }
+ index_(-1),
+ yield_first_feedback_slot_(kInvalidFeedbackSlot) { }
private:
Expression* generator_object_;
Expression* expression_;
Kind yield_kind_;
int index_;
+ int yield_first_feedback_slot_;
};
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698