Index: src/ast.h |
diff --git a/src/ast.h b/src/ast.h |
index 6dcc6c8874666cc83d6135cec3cb2215662d6634..59ed61790cfb9320c5b97ae5e8dbe78de0a5468c 100644 |
--- a/src/ast.h |
+++ b/src/ast.h |
@@ -210,7 +210,7 @@ class Expression: public AstNode { |
kTest |
}; |
- Expression() : id_(GetNextId()) {} |
+ Expression() : id_(GetNextId()), test_id_(GetNextId()) {} |
virtual int position() const { |
UNREACHABLE(); |
@@ -262,9 +262,11 @@ class Expression: public AstNode { |
} |
unsigned id() const { return id_; } |
+ unsigned test_id() const { return test_id_; } |
private: |
unsigned id_; |
+ unsigned test_id_; |
}; |
@@ -1030,7 +1032,16 @@ class VariableProxy: public Expression { |
DECLARE_NODE_TYPE(VariableProxy) |
// Type testing & conversion |
- Variable* AsVariable() { return (this == NULL) ? NULL : var_; } |
+ virtual Property* AsProperty() { |
+ return var_ == NULL ? NULL : var_->AsProperty(); |
+ } |
+ |
+ Variable* AsVariable() { |
+ if (this == NULL || var_ == NULL) return NULL; |
+ Expression* rewrite = var_->rewrite(); |
+ if (rewrite == NULL || rewrite->AsSlot() != NULL) return var_; |
+ return NULL; |
+ } |
virtual bool IsValidLeftHandSide() { |
return var_ == NULL ? true : var_->IsValidLeftHandSide(); |
@@ -1159,7 +1170,8 @@ class Property: public Expression { |
is_array_length_(false), |
is_string_length_(false), |
is_string_access_(false), |
- is_function_prototype_(false) { } |
+ is_function_prototype_(false), |
+ is_arguments_access_(false) { } |
DECLARE_NODE_TYPE(Property) |
@@ -1175,6 +1187,13 @@ class Property: public Expression { |
bool IsStringAccess() const { return is_string_access_; } |
bool IsFunctionPrototype() const { return is_function_prototype_; } |
+ // Marks that this is actually an argument rewritten to a keyed property |
+ // accessing the argument through the arguments shadow object. |
+ void set_is_arguments_access(bool is_arguments_access) { |
+ is_arguments_access_ = is_arguments_access; |
+ } |
+ bool is_arguments_access() const { return is_arguments_access_; } |
+ |
// Type feedback information. |
void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
virtual bool IsMonomorphic() { return is_monomorphic_; } |
@@ -1196,6 +1215,7 @@ class Property: public Expression { |
bool is_string_length_ : 1; |
bool is_string_access_ : 1; |
bool is_function_prototype_ : 1; |
+ bool is_arguments_access_ : 1; |
Handle<Map> monomorphic_receiver_type_; |
}; |
@@ -1628,8 +1648,7 @@ class FunctionLiteral: public Expression { |
int num_parameters, |
int start_position, |
int end_position, |
- bool is_expression, |
- bool has_duplicate_parameters) |
+ bool is_expression) |
: name_(name), |
scope_(scope), |
body_(body), |
@@ -1641,12 +1660,10 @@ class FunctionLiteral: public Expression { |
num_parameters_(num_parameters), |
start_position_(start_position), |
end_position_(end_position), |
+ is_expression_(is_expression), |
function_token_position_(RelocInfo::kNoPosition), |
inferred_name_(HEAP->empty_string()), |
- is_expression_(is_expression), |
- pretenure_(false), |
- has_duplicate_parameters_(has_duplicate_parameters) { |
- } |
+ pretenure_(false) { } |
DECLARE_NODE_TYPE(FunctionLiteral) |
@@ -1686,8 +1703,6 @@ class FunctionLiteral: public Expression { |
void set_pretenure(bool value) { pretenure_ = value; } |
virtual bool IsInlineable() const; |
- bool has_duplicate_parameters() { return has_duplicate_parameters_; } |
- |
private: |
Handle<String> name_; |
Scope* scope_; |
@@ -1699,11 +1714,10 @@ class FunctionLiteral: public Expression { |
int num_parameters_; |
int start_position_; |
int end_position_; |
+ bool is_expression_; |
int function_token_position_; |
Handle<String> inferred_name_; |
- bool is_expression_; |
bool pretenure_; |
- bool has_duplicate_parameters_; |
}; |