diff options
Diffstat (limited to 'chromium/v8/src/ast.h')
-rw-r--r-- | chromium/v8/src/ast.h | 790 |
1 files changed, 422 insertions, 368 deletions
diff --git a/chromium/v8/src/ast.h b/chromium/v8/src/ast.h index 4e413c5426e..3036fccbddb 100644 --- a/chromium/v8/src/ast.h +++ b/chromium/v8/src/ast.h @@ -1,50 +1,27 @@ // Copyright 2012 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #ifndef V8_AST_H_ #define V8_AST_H_ -#include "v8.h" - -#include "assembler.h" -#include "factory.h" -#include "isolate.h" -#include "jsregexp.h" -#include "list-inl.h" -#include "runtime.h" -#include "small-pointer-list.h" -#include "smart-pointers.h" -#include "token.h" -#include "type-info.h" // TODO(rossberg): this should eventually be removed -#include "types.h" -#include "utils.h" -#include "variables.h" -#include "interface.h" -#include "zone-inl.h" +#include "src/v8.h" + +#include "src/assembler.h" +#include "src/factory.h" +#include "src/feedback-slots.h" +#include "src/isolate.h" +#include "src/jsregexp.h" +#include "src/list-inl.h" +#include "src/runtime.h" +#include "src/small-pointer-list.h" +#include "src/smart-pointers.h" +#include "src/token.h" +#include "src/types.h" +#include "src/utils.h" +#include "src/variables.h" +#include "src/interface.h" +#include "src/zone-inl.h" namespace v8 { namespace internal { @@ -115,17 +92,14 @@ namespace internal { V(CountOperation) \ V(BinaryOperation) \ V(CompareOperation) \ - V(ThisFunction) - -#define AUXILIARY_NODE_LIST(V) \ + V(ThisFunction) \ V(CaseClause) #define AST_NODE_LIST(V) \ DECLARATION_NODE_LIST(V) \ MODULE_NODE_LIST(V) \ STATEMENT_NODE_LIST(V) \ - EXPRESSION_NODE_LIST(V) \ - AUXILIARY_NODE_LIST(V) + EXPRESSION_NODE_LIST(V) // Forward declarations class AstConstructionVisitor; @@ -185,15 +159,21 @@ class AstProperties V8_FINAL BASE_EMBEDDED { public: class Flags : public EnumSet<AstPropertiesFlag, int> {}; - AstProperties() : node_count_(0) { } +AstProperties() : node_count_(0), feedback_slots_(0) {} Flags* flags() { return &flags_; } int node_count() { return node_count_; } void add_node_count(int count) { node_count_ += count; } + int feedback_slots() const { return feedback_slots_; } + void increase_feedback_slots(int count) { + feedback_slots_ += count; + } + private: Flags flags_; int node_count_; + int feedback_slots_; }; @@ -218,9 +198,14 @@ class AstNode: public ZoneObject { int position() const { return position_; } // Type testing & conversion functions overridden by concrete subclasses. -#define DECLARE_NODE_FUNCTIONS(type) \ - bool Is##type() { return node_type() == AstNode::k##type; } \ - type* As##type() { return Is##type() ? reinterpret_cast<type*>(this) : NULL; } +#define DECLARE_NODE_FUNCTIONS(type) \ + bool Is##type() const { return node_type() == AstNode::k##type; } \ + type* As##type() { \ + return Is##type() ? reinterpret_cast<type*>(this) : NULL; \ + } \ + const type* As##type() const { \ + return Is##type() ? reinterpret_cast<const type*>(this) : NULL; \ + } AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) #undef DECLARE_NODE_FUNCTIONS @@ -230,13 +215,13 @@ class AstNode: public ZoneObject { virtual MaterializedLiteral* AsMaterializedLiteral() { return NULL; } protected: - static int GetNextId(Isolate* isolate) { - return ReserveIdRange(isolate, 1); + static int GetNextId(Zone* zone) { + return ReserveIdRange(zone, 1); } - static int ReserveIdRange(Isolate* isolate, int n) { - int tmp = isolate->ast_node_id(); - isolate->set_ast_node_id(tmp + n); + static int ReserveIdRange(Zone* zone, int n) { + int tmp = zone->isolate()->ast_node_id(); + zone->isolate()->set_ast_node_id(tmp + n); return tmp; } @@ -259,7 +244,7 @@ class AstNode: public ZoneObject { class Statement : public AstNode { public: - explicit Statement(int position) : AstNode(position) {} + explicit Statement(Zone* zone, int position) : AstNode(position) {} bool IsEmpty() { return AsEmptyStatement() != NULL; } virtual bool IsJump() const { return false; } @@ -279,8 +264,7 @@ class SmallMapList V8_FINAL { int length() const { return list_.length(); } void AddMapIfMissing(Handle<Map> map, Zone* zone) { - map = Map::CurrentMapForDeprecated(map); - if (map.is_null()) return; + if (!Map::CurrentMapForDeprecated(map).ToHandle(&map)) return; for (int i = 0; i < length(); ++i) { if (at(i).is_identical_to(map)) return; } @@ -328,35 +312,35 @@ class Expression : public AstNode { kTest }; - virtual bool IsValidLeftHandSide() { return false; } + virtual bool IsValidReferenceExpression() const { return false; } // Helpers for ToBoolean conversion. - virtual bool ToBooleanIsTrue() { return false; } - virtual bool ToBooleanIsFalse() { return false; } + virtual bool ToBooleanIsTrue() const { return false; } + virtual bool ToBooleanIsFalse() const { return false; } // Symbols that cannot be parsed as array indices are considered property // names. We do not treat symbols that can be array indexes as property // names because [] for string objects is handled only by keyed ICs. - virtual bool IsPropertyName() { return false; } + virtual bool IsPropertyName() const { return false; } // True iff the result can be safely overwritten (to avoid allocation). // False for operations that can return one of their operands. - virtual bool ResultOverwriteAllowed() { return false; } + virtual bool ResultOverwriteAllowed() const { return false; } // True iff the expression is a literal represented as a smi. - bool IsSmiLiteral(); + bool IsSmiLiteral() const; // True iff the expression is a string literal. - bool IsStringLiteral(); + bool IsStringLiteral() const; // True iff the expression is the null literal. - bool IsNullLiteral(); + bool IsNullLiteral() const; // True if we can prove that the expression is the undefined literal. - bool IsUndefinedLiteral(Isolate* isolate); + bool IsUndefinedLiteral(Isolate* isolate) const; // Expression type bounds - Bounds bounds() { return bounds_; } + Bounds bounds() const { return bounds_; } void set_bounds(Bounds bounds) { bounds_ = bounds; } // Type feedback information for assignments and properties. @@ -381,11 +365,11 @@ class Expression : public AstNode { TypeFeedbackId test_id() const { return test_id_; } protected: - Expression(Isolate* isolate, int pos) + Expression(Zone* zone, int pos) : AstNode(pos), - bounds_(Bounds::Unbounded(isolate)), - id_(GetNextId(isolate)), - test_id_(GetNextId(isolate)) {} + bounds_(Bounds::Unbounded(zone)), + id_(GetNextId(zone)), + test_id_(GetNextId(zone)) {} void set_to_boolean_types(byte types) { to_boolean_types_ = types; } private: @@ -426,13 +410,13 @@ class BreakableStatement : public Statement { protected: BreakableStatement( - Isolate* isolate, ZoneStringList* labels, + Zone* zone, ZoneStringList* labels, BreakableType breakable_type, int position) - : Statement(position), + : Statement(zone, position), labels_(labels), breakable_type_(breakable_type), - entry_id_(GetNextId(isolate)), - exit_id_(GetNextId(isolate)) { + entry_id_(GetNextId(zone)), + exit_id_(GetNextId(zone)) { ASSERT(labels == NULL || labels->length() > 0); } @@ -457,6 +441,8 @@ class Block V8_FINAL : public BreakableStatement { ZoneList<Statement*>* statements() { return &statements_; } bool is_initializer_block() const { return is_initializer_block_; } + BailoutId DeclsId() const { return decls_id_; } + virtual bool IsJump() const V8_OVERRIDE { return !statements_.is_empty() && statements_.last()->IsJump() && labels() == NULL; // Good enough as an approximation... @@ -466,21 +452,22 @@ class Block V8_FINAL : public BreakableStatement { void set_scope(Scope* scope) { scope_ = scope; } protected: - Block(Isolate* isolate, + Block(Zone* zone, ZoneStringList* labels, int capacity, bool is_initializer_block, - int pos, - Zone* zone) - : BreakableStatement(isolate, labels, TARGET_FOR_NAMED_ONLY, pos), + int pos) + : BreakableStatement(zone, labels, TARGET_FOR_NAMED_ONLY, pos), statements_(capacity, zone), is_initializer_block_(is_initializer_block), + decls_id_(GetNextId(zone)), scope_(NULL) { } private: ZoneList<Statement*> statements_; bool is_initializer_block_; + const BailoutId decls_id_; Scope* scope_; }; @@ -494,7 +481,8 @@ class Declaration : public AstNode { virtual bool IsInlineable() const; protected: - Declaration(VariableProxy* proxy, + Declaration(Zone* zone, + VariableProxy* proxy, VariableMode mode, Scope* scope, int pos) @@ -523,11 +511,12 @@ class VariableDeclaration V8_FINAL : public Declaration { } protected: - VariableDeclaration(VariableProxy* proxy, + VariableDeclaration(Zone* zone, + VariableProxy* proxy, VariableMode mode, Scope* scope, int pos) - : Declaration(proxy, mode, scope, pos) { + : Declaration(zone, proxy, mode, scope, pos) { } }; @@ -543,12 +532,13 @@ class FunctionDeclaration V8_FINAL : public Declaration { virtual bool IsInlineable() const V8_OVERRIDE; protected: - FunctionDeclaration(VariableProxy* proxy, + FunctionDeclaration(Zone* zone, + VariableProxy* proxy, VariableMode mode, FunctionLiteral* fun, Scope* scope, int pos) - : Declaration(proxy, mode, scope, pos), + : Declaration(zone, proxy, mode, scope, pos), fun_(fun) { // At the moment there are no "const functions" in JavaScript... ASSERT(mode == VAR || mode == LET); @@ -570,11 +560,12 @@ class ModuleDeclaration V8_FINAL : public Declaration { } protected: - ModuleDeclaration(VariableProxy* proxy, + ModuleDeclaration(Zone* zone, + VariableProxy* proxy, Module* module, Scope* scope, int pos) - : Declaration(proxy, MODULE, scope, pos), + : Declaration(zone, proxy, MODULE, scope, pos), module_(module) { } @@ -593,11 +584,12 @@ class ImportDeclaration V8_FINAL : public Declaration { } protected: - ImportDeclaration(VariableProxy* proxy, + ImportDeclaration(Zone* zone, + VariableProxy* proxy, Module* module, Scope* scope, int pos) - : Declaration(proxy, LET, scope, pos), + : Declaration(zone, proxy, LET, scope, pos), module_(module) { } @@ -615,8 +607,8 @@ class ExportDeclaration V8_FINAL : public Declaration { } protected: - ExportDeclaration(VariableProxy* proxy, Scope* scope, int pos) - : Declaration(proxy, LET, scope, pos) {} + ExportDeclaration(Zone* zone, VariableProxy* proxy, Scope* scope, int pos) + : Declaration(zone, proxy, LET, scope, pos) {} }; @@ -630,7 +622,7 @@ class Module : public AstNode { : AstNode(pos), interface_(Interface::NewModule(zone)), body_(NULL) {} - Module(Interface* interface, int pos, Block* body = NULL) + Module(Zone* zone, Interface* interface, int pos, Block* body = NULL) : AstNode(pos), interface_(interface), body_(body) {} @@ -646,8 +638,8 @@ class ModuleLiteral V8_FINAL : public Module { DECLARE_NODE_TYPE(ModuleLiteral) protected: - ModuleLiteral(Block* body, Interface* interface, int pos) - : Module(interface, pos, body) {} + ModuleLiteral(Zone* zone, Block* body, Interface* interface, int pos) + : Module(zone, interface, pos, body) {} }; @@ -658,7 +650,7 @@ class ModuleVariable V8_FINAL : public Module { VariableProxy* proxy() const { return proxy_; } protected: - inline ModuleVariable(VariableProxy* proxy, int pos); + inline ModuleVariable(Zone* zone, VariableProxy* proxy, int pos); private: VariableProxy* proxy_; @@ -673,7 +665,7 @@ class ModulePath V8_FINAL : public Module { Handle<String> name() const { return name_; } protected: - ModulePath(Module* module, Handle<String> name, Zone* zone, int pos) + ModulePath(Zone* zone, Module* module, Handle<String> name, int pos) : Module(zone, pos), module_(module), name_(name) { @@ -692,7 +684,7 @@ class ModuleUrl V8_FINAL : public Module { Handle<String> url() const { return url_; } protected: - ModuleUrl(Handle<String> url, Zone* zone, int pos) + ModuleUrl(Zone* zone, Handle<String> url, int pos) : Module(zone, pos), url_(url) { } @@ -709,8 +701,8 @@ class ModuleStatement V8_FINAL : public Statement { Block* body() const { return body_; } protected: - ModuleStatement(VariableProxy* proxy, Block* body, int pos) - : Statement(pos), + ModuleStatement(Zone* zone, VariableProxy* proxy, Block* body, int pos) + : Statement(zone, pos), proxy_(proxy), body_(body) { } @@ -738,10 +730,10 @@ class IterationStatement : public BreakableStatement { Label* continue_target() { return &continue_target_; } protected: - IterationStatement(Isolate* isolate, ZoneStringList* labels, int pos) - : BreakableStatement(isolate, labels, TARGET_FOR_ANONYMOUS, pos), + IterationStatement(Zone* zone, ZoneStringList* labels, int pos) + : BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos), body_(NULL), - osr_entry_id_(GetNextId(isolate)) { + osr_entry_id_(GetNextId(zone)) { } void Initialize(Statement* body) { @@ -772,11 +764,11 @@ class DoWhileStatement V8_FINAL : public IterationStatement { BailoutId BackEdgeId() const { return back_edge_id_; } protected: - DoWhileStatement(Isolate* isolate, ZoneStringList* labels, int pos) - : IterationStatement(isolate, labels, pos), + DoWhileStatement(Zone* zone, ZoneStringList* labels, int pos) + : IterationStatement(zone, labels, pos), cond_(NULL), - continue_id_(GetNextId(isolate)), - back_edge_id_(GetNextId(isolate)) { + continue_id_(GetNextId(zone)), + back_edge_id_(GetNextId(zone)) { } private: @@ -809,11 +801,11 @@ class WhileStatement V8_FINAL : public IterationStatement { BailoutId BodyId() const { return body_id_; } protected: - WhileStatement(Isolate* isolate, ZoneStringList* labels, int pos) - : IterationStatement(isolate, labels, pos), + WhileStatement(Zone* zone, ZoneStringList* labels, int pos) + : IterationStatement(zone, labels, pos), cond_(NULL), may_have_function_literal_(true), - body_id_(GetNextId(isolate)) { + body_id_(GetNextId(zone)) { } private: @@ -860,15 +852,15 @@ class ForStatement V8_FINAL : public IterationStatement { void set_loop_variable(Variable* var) { loop_variable_ = var; } protected: - ForStatement(Isolate* isolate, ZoneStringList* labels, int pos) - : IterationStatement(isolate, labels, pos), + ForStatement(Zone* zone, ZoneStringList* labels, int pos) + : IterationStatement(zone, labels, pos), init_(NULL), cond_(NULL), next_(NULL), may_have_function_literal_(true), loop_variable_(NULL), - continue_id_(GetNextId(isolate)), - body_id_(GetNextId(isolate)) { + continue_id_(GetNextId(zone)), + body_id_(GetNextId(zone)) { } private: @@ -902,8 +894,8 @@ class ForEachStatement : public IterationStatement { Expression* subject() const { return subject_; } protected: - ForEachStatement(Isolate* isolate, ZoneStringList* labels, int pos) - : IterationStatement(isolate, labels, pos), + ForEachStatement(Zone* zone, ZoneStringList* labels, int pos) + : IterationStatement(zone, labels, pos), each_(NULL), subject_(NULL) { } @@ -914,7 +906,8 @@ class ForEachStatement : public IterationStatement { }; -class ForInStatement V8_FINAL : public ForEachStatement { +class ForInStatement V8_FINAL : public ForEachStatement, + public FeedbackSlotInterface { public: DECLARE_NODE_TYPE(ForInStatement) @@ -922,7 +915,15 @@ class ForInStatement V8_FINAL : public ForEachStatement { return subject(); } - TypeFeedbackId ForInFeedbackId() const { return reuse(PrepareId()); } + // Type feedback information. + virtual int ComputeFeedbackSlotCount() { return 1; } + virtual void SetFirstFeedbackSlot(int slot) { for_in_feedback_slot_ = slot; } + + int ForInFeedbackSlot() { + ASSERT(for_in_feedback_slot_ != kInvalidFeedbackSlot); + return for_in_feedback_slot_; + } + enum ForInType { FAST_FOR_IN, SLOW_FOR_IN }; ForInType for_in_type() const { return for_in_type_; } void set_for_in_type(ForInType type) { for_in_type_ = type; } @@ -933,14 +934,16 @@ class ForInStatement V8_FINAL : public ForEachStatement { virtual BailoutId StackCheckId() const V8_OVERRIDE { return body_id_; } protected: - ForInStatement(Isolate* isolate, ZoneStringList* labels, int pos) - : ForEachStatement(isolate, labels, pos), + ForInStatement(Zone* zone, ZoneStringList* labels, int pos) + : ForEachStatement(zone, labels, pos), for_in_type_(SLOW_FOR_IN), - body_id_(GetNextId(isolate)), - prepare_id_(GetNextId(isolate)) { + for_in_feedback_slot_(kInvalidFeedbackSlot), + body_id_(GetNextId(zone)), + prepare_id_(GetNextId(zone)) { } ForInType for_in_type_; + int for_in_feedback_slot_; const BailoutId body_id_; const BailoutId prepare_id_; }; @@ -953,11 +956,13 @@ class ForOfStatement V8_FINAL : public ForEachStatement { void Initialize(Expression* each, Expression* subject, Statement* body, + Expression* assign_iterable, Expression* assign_iterator, Expression* next_result, Expression* result_done, Expression* assign_each) { ForEachStatement::Initialize(each, subject, body); + assign_iterable_ = assign_iterable; assign_iterator_ = assign_iterator; next_result_ = next_result; result_done_ = result_done; @@ -968,7 +973,12 @@ class ForOfStatement V8_FINAL : public ForEachStatement { return subject(); } - // var iterator = iterable; + // var iterable = subject; + Expression* assign_iterable() const { + return assign_iterable_; + } + + // var iterator = iterable[Symbol.iterator](); Expression* assign_iterator() const { return assign_iterator_; } @@ -994,15 +1004,16 @@ class ForOfStatement V8_FINAL : public ForEachStatement { BailoutId BackEdgeId() const { return back_edge_id_; } protected: - ForOfStatement(Isolate* isolate, ZoneStringList* labels, int pos) - : ForEachStatement(isolate, labels, pos), + ForOfStatement(Zone* zone, ZoneStringList* labels, int pos) + : ForEachStatement(zone, labels, pos), assign_iterator_(NULL), next_result_(NULL), result_done_(NULL), assign_each_(NULL), - back_edge_id_(GetNextId(isolate)) { + back_edge_id_(GetNextId(zone)) { } + Expression* assign_iterable_; Expression* assign_iterator_; Expression* next_result_; Expression* result_done_; @@ -1020,8 +1031,8 @@ class ExpressionStatement V8_FINAL : public Statement { virtual bool IsJump() const V8_OVERRIDE { return expression_->IsThrow(); } protected: - ExpressionStatement(Expression* expression, int pos) - : Statement(pos), expression_(expression) { } + ExpressionStatement(Zone* zone, Expression* expression, int pos) + : Statement(zone, pos), expression_(expression) { } private: Expression* expression_; @@ -1033,7 +1044,7 @@ class JumpStatement : public Statement { virtual bool IsJump() const V8_FINAL V8_OVERRIDE { return true; } protected: - explicit JumpStatement(int pos) : Statement(pos) {} + explicit JumpStatement(Zone* zone, int pos) : Statement(zone, pos) {} }; @@ -1044,8 +1055,8 @@ class ContinueStatement V8_FINAL : public JumpStatement { IterationStatement* target() const { return target_; } protected: - explicit ContinueStatement(IterationStatement* target, int pos) - : JumpStatement(pos), target_(target) { } + explicit ContinueStatement(Zone* zone, IterationStatement* target, int pos) + : JumpStatement(zone, pos), target_(target) { } private: IterationStatement* target_; @@ -1059,8 +1070,8 @@ class BreakStatement V8_FINAL : public JumpStatement { BreakableStatement* target() const { return target_; } protected: - explicit BreakStatement(BreakableStatement* target, int pos) - : JumpStatement(pos), target_(target) { } + explicit BreakStatement(Zone* zone, BreakableStatement* target, int pos) + : JumpStatement(zone, pos), target_(target) { } private: BreakableStatement* target_; @@ -1074,8 +1085,8 @@ class ReturnStatement V8_FINAL : public JumpStatement { Expression* expression() const { return expression_; } protected: - explicit ReturnStatement(Expression* expression, int pos) - : JumpStatement(pos), expression_(expression) { } + explicit ReturnStatement(Zone* zone, Expression* expression, int pos) + : JumpStatement(zone, pos), expression_(expression) { } private: Expression* expression_; @@ -1092,8 +1103,9 @@ class WithStatement V8_FINAL : public Statement { protected: WithStatement( - Scope* scope, Expression* expression, Statement* statement, int pos) - : Statement(pos), + Zone* zone, Scope* scope, + Expression* expression, Statement* statement, int pos) + : Statement(zone, pos), scope_(scope), expression_(expression), statement_(statement) { } @@ -1105,7 +1117,7 @@ class WithStatement V8_FINAL : public Statement { }; -class CaseClause V8_FINAL : public AstNode { +class CaseClause V8_FINAL : public Expression { public: DECLARE_NODE_TYPE(CaseClause) @@ -1121,11 +1133,11 @@ class CaseClause V8_FINAL : public AstNode { // Type feedback information. TypeFeedbackId CompareId() { return compare_id_; } - Handle<Type> compare_type() { return compare_type_; } - void set_compare_type(Handle<Type> type) { compare_type_ = type; } + Type* compare_type() { return compare_type_; } + void set_compare_type(Type* type) { compare_type_ = type; } private: - CaseClause(Isolate* isolate, + CaseClause(Zone* zone, Expression* label, ZoneList<Statement*>* statements, int pos); @@ -1133,7 +1145,7 @@ class CaseClause V8_FINAL : public AstNode { Expression* label_; Label body_target_; ZoneList<Statement*>* statements_; - Handle<Type> compare_type_; + Type* compare_type_; const TypeFeedbackId compare_id_; const BailoutId entry_id_; @@ -1147,26 +1159,20 @@ class SwitchStatement V8_FINAL : public BreakableStatement { void Initialize(Expression* tag, ZoneList<CaseClause*>* cases) { tag_ = tag; cases_ = cases; - switch_type_ = UNKNOWN_SWITCH; } Expression* tag() const { return tag_; } ZoneList<CaseClause*>* cases() const { return cases_; } - enum SwitchType { UNKNOWN_SWITCH, SMI_SWITCH, STRING_SWITCH, GENERIC_SWITCH }; - SwitchType switch_type() const { return switch_type_; } - void set_switch_type(SwitchType switch_type) { switch_type_ = switch_type; } - protected: - SwitchStatement(Isolate* isolate, ZoneStringList* labels, int pos) - : BreakableStatement(isolate, labels, TARGET_FOR_ANONYMOUS, pos), + SwitchStatement(Zone* zone, ZoneStringList* labels, int pos) + : BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos), tag_(NULL), cases_(NULL) { } private: Expression* tag_; ZoneList<CaseClause*>* cases_; - SwitchType switch_type_; }; @@ -1196,18 +1202,18 @@ class IfStatement V8_FINAL : public Statement { BailoutId ElseId() const { return else_id_; } protected: - IfStatement(Isolate* isolate, + IfStatement(Zone* zone, Expression* condition, Statement* then_statement, Statement* else_statement, int pos) - : Statement(pos), + : Statement(zone, pos), condition_(condition), then_statement_(then_statement), else_statement_(else_statement), - if_id_(GetNextId(isolate)), - then_id_(GetNextId(isolate)), - else_id_(GetNextId(isolate)) { + if_id_(GetNextId(zone)), + then_id_(GetNextId(zone)), + else_id_(GetNextId(zone)) { } private: @@ -1255,8 +1261,8 @@ class TryStatement : public Statement { ZoneList<Label*>* escaping_targets() const { return escaping_targets_; } protected: - TryStatement(int index, Block* try_block, int pos) - : Statement(pos), + TryStatement(Zone* zone, int index, Block* try_block, int pos) + : Statement(zone, pos), index_(index), try_block_(try_block), escaping_targets_(NULL) { } @@ -1279,13 +1285,14 @@ class TryCatchStatement V8_FINAL : public TryStatement { Block* catch_block() const { return catch_block_; } protected: - TryCatchStatement(int index, + TryCatchStatement(Zone* zone, + int index, Block* try_block, Scope* scope, Variable* variable, Block* catch_block, int pos) - : TryStatement(index, try_block, pos), + : TryStatement(zone, index, try_block, pos), scope_(scope), variable_(variable), catch_block_(catch_block) { @@ -1306,8 +1313,8 @@ class TryFinallyStatement V8_FINAL : public TryStatement { protected: TryFinallyStatement( - int index, Block* try_block, Block* finally_block, int pos) - : TryStatement(index, try_block, pos), + Zone* zone, int index, Block* try_block, Block* finally_block, int pos) + : TryStatement(zone, index, try_block, pos), finally_block_(finally_block) { } private: @@ -1320,7 +1327,7 @@ class DebuggerStatement V8_FINAL : public Statement { DECLARE_NODE_TYPE(DebuggerStatement) protected: - explicit DebuggerStatement(int pos): Statement(pos) {} + explicit DebuggerStatement(Zone* zone, int pos): Statement(zone, pos) {} }; @@ -1329,7 +1336,7 @@ class EmptyStatement V8_FINAL : public Statement { DECLARE_NODE_TYPE(EmptyStatement) protected: - explicit EmptyStatement(int pos): Statement(pos) {} + explicit EmptyStatement(Zone* zone, int pos): Statement(zone, pos) {} }; @@ -1337,7 +1344,7 @@ class Literal V8_FINAL : public Expression { public: DECLARE_NODE_TYPE(Literal) - virtual bool IsPropertyName() V8_OVERRIDE { + virtual bool IsPropertyName() const V8_OVERRIDE { if (value_->IsInternalizedString()) { uint32_t ignored; return !String::cast(*value_)->AsArrayIndex(&ignored); @@ -1350,27 +1357,13 @@ class Literal V8_FINAL : public Expression { return Handle<String>::cast(value_); } - virtual bool ToBooleanIsTrue() V8_OVERRIDE { + virtual bool ToBooleanIsTrue() const V8_OVERRIDE { return value_->BooleanValue(); } - virtual bool ToBooleanIsFalse() V8_OVERRIDE { + virtual bool ToBooleanIsFalse() const V8_OVERRIDE { return !value_->BooleanValue(); } - // Identity testers. - bool IsNull() const { - ASSERT(!value_.is_null()); - return value_->IsNull(); - } - bool IsTrue() const { - ASSERT(!value_.is_null()); - return value_->IsTrue(); - } - bool IsFalse() const { - ASSERT(!value_.is_null()); - return value_->IsFalse(); - } - Handle<Object> value() const { return value_; } // Support for using Literal as a HashMap key. NOTE: Currently, this works @@ -1380,17 +1373,16 @@ class Literal V8_FINAL : public Expression { static bool Match(void* literal1, void* literal2) { Handle<String> s1 = static_cast<Literal*>(literal1)->ToString(); Handle<String> s2 = static_cast<Literal*>(literal2)->ToString(); - return s1->Equals(*s2); + return String::Equals(s1, s2); } TypeFeedbackId LiteralFeedbackId() const { return reuse(id()); } protected: - Literal( - Isolate* isolate, Handle<Object> value, int position) - : Expression(isolate, position), + Literal(Zone* zone, Handle<Object> value, int position) + : Expression(zone, position), value_(value), - isolate_(isolate) { } + isolate_(zone->isolate()) { } private: Handle<String> ToString(); @@ -1415,10 +1407,10 @@ class MaterializedLiteral : public Expression { } protected: - MaterializedLiteral(Isolate* isolate, + MaterializedLiteral(Zone* zone, int literal_index, int pos) - : Expression(isolate, pos), + : Expression(zone, pos), literal_index_(literal_index), is_simple_(false), depth_(0) {} @@ -1466,7 +1458,7 @@ class ObjectLiteralProperty V8_FINAL : public ZoneObject { PROTOTYPE // Property is __proto__. }; - ObjectLiteralProperty(Literal* key, Expression* value, Isolate* isolate); + ObjectLiteralProperty(Zone* zone, Literal* key, Expression* value); Literal* key() { return key_; } Expression* value() { return value_; } @@ -1485,7 +1477,7 @@ class ObjectLiteralProperty V8_FINAL : public ZoneObject { protected: template<class> friend class AstNodeFactory; - ObjectLiteralProperty(bool is_getter, FunctionLiteral* value); + ObjectLiteralProperty(Zone* zone, bool is_getter, FunctionLiteral* value); void set_key(Literal* key) { key_ = key; } private: @@ -1537,13 +1529,13 @@ class ObjectLiteral V8_FINAL : public MaterializedLiteral { }; protected: - ObjectLiteral(Isolate* isolate, + ObjectLiteral(Zone* zone, ZoneList<Property*>* properties, int literal_index, int boilerplate_properties, bool has_function, int pos) - : MaterializedLiteral(isolate, literal_index, pos), + : MaterializedLiteral(zone, literal_index, pos), properties_(properties), boilerplate_properties_(boilerplate_properties), fast_elements_(false), @@ -1569,12 +1561,12 @@ class RegExpLiteral V8_FINAL : public MaterializedLiteral { Handle<String> flags() const { return flags_; } protected: - RegExpLiteral(Isolate* isolate, + RegExpLiteral(Zone* zone, Handle<String> pattern, Handle<String> flags, int literal_index, int pos) - : MaterializedLiteral(isolate, literal_index, pos), + : MaterializedLiteral(zone, literal_index, pos), pattern_(pattern), flags_(flags) { set_depth(1); @@ -1610,13 +1602,13 @@ class ArrayLiteral V8_FINAL : public MaterializedLiteral { }; protected: - ArrayLiteral(Isolate* isolate, + ArrayLiteral(Zone* zone, ZoneList<Expression*>* values, int literal_index, int pos) - : MaterializedLiteral(isolate, literal_index, pos), + : MaterializedLiteral(zone, literal_index, pos), values_(values), - first_element_id_(ReserveIdRange(isolate, values->length())) {} + first_element_id_(ReserveIdRange(zone, values->length())) {} private: Handle<FixedArray> constant_elements_; @@ -1629,19 +1621,17 @@ class VariableProxy V8_FINAL : public Expression { public: DECLARE_NODE_TYPE(VariableProxy) - virtual bool IsValidLeftHandSide() V8_OVERRIDE { - return var_ == NULL ? true : var_->IsValidLeftHandSide(); + virtual bool IsValidReferenceExpression() const V8_OVERRIDE { + return var_ == NULL ? true : var_->IsValidReference(); } - bool IsVariable(Handle<String> n) { + bool IsVariable(Handle<String> n) const { return !is_this() && name().is_identical_to(n); } - bool IsArguments() { return var_ != NULL && var_->is_arguments(); } + bool IsArguments() const { return var_ != NULL && var_->is_arguments(); } - bool IsLValue() { - return is_lvalue_; - } + bool IsLValue() const { return is_lvalue_; } Handle<String> name() const { return name_; } Variable* var() const { return var_; } @@ -1656,9 +1646,9 @@ class VariableProxy V8_FINAL : public Expression { void BindTo(Variable* var); protected: - VariableProxy(Isolate* isolate, Variable* var, int position); + VariableProxy(Zone* zone, Variable* var, int position); - VariableProxy(Isolate* isolate, + VariableProxy(Zone* zone, Handle<String> name, bool is_this, Interface* interface, @@ -1679,7 +1669,7 @@ class Property V8_FINAL : public Expression { public: DECLARE_NODE_TYPE(Property) - virtual bool IsValidLeftHandSide() V8_OVERRIDE { return true; } + virtual bool IsValidReferenceExpression() const V8_OVERRIDE { return true; } Expression* obj() const { return obj_; } Expression* key() const { return key_; } @@ -1699,28 +1689,28 @@ class Property V8_FINAL : public Expression { virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { return STANDARD_STORE; } - bool IsUninitialized() { return is_uninitialized_; } - bool IsPreMonomorphic() { return is_pre_monomorphic_; } + bool IsUninitialized() { return !is_for_call_ && is_uninitialized_; } bool HasNoTypeInformation() { - return is_uninitialized_ || is_pre_monomorphic_; + return is_uninitialized_; } void set_is_uninitialized(bool b) { is_uninitialized_ = b; } - void set_is_pre_monomorphic(bool b) { is_pre_monomorphic_ = b; } void set_is_string_access(bool b) { is_string_access_ = b; } void set_is_function_prototype(bool b) { is_function_prototype_ = b; } + void mark_for_call() { is_for_call_ = true; } + bool IsForCall() { return is_for_call_; } TypeFeedbackId PropertyFeedbackId() { return reuse(id()); } protected: - Property(Isolate* isolate, + Property(Zone* zone, Expression* obj, Expression* key, int pos) - : Expression(isolate, pos), + : Expression(zone, pos), obj_(obj), key_(key), - load_id_(GetNextId(isolate)), - is_pre_monomorphic_(false), + load_id_(GetNextId(zone)), + is_for_call_(false), is_uninitialized_(false), is_string_access_(false), is_function_prototype_(false) { } @@ -1731,14 +1721,14 @@ class Property V8_FINAL : public Expression { const BailoutId load_id_; SmallMapList receiver_types_; - bool is_pre_monomorphic_ : 1; + bool is_for_call_ : 1; bool is_uninitialized_ : 1; bool is_string_access_ : 1; bool is_function_prototype_ : 1; }; -class Call V8_FINAL : public Expression { +class Call V8_FINAL : public Expression, public FeedbackSlotInterface { public: DECLARE_NODE_TYPE(Call) @@ -1746,48 +1736,64 @@ class Call V8_FINAL : public Expression { ZoneList<Expression*>* arguments() const { return arguments_; } // Type feedback information. - TypeFeedbackId CallFeedbackId() const { return reuse(id()); } - void RecordTypeFeedback(TypeFeedbackOracle* oracle, CallKind call_kind); + virtual int ComputeFeedbackSlotCount() { return 1; } + virtual void SetFirstFeedbackSlot(int slot) { + call_feedback_slot_ = slot; + } + + bool HasCallFeedbackSlot() const { + return call_feedback_slot_ != kInvalidFeedbackSlot; + } + int CallFeedbackSlot() const { return call_feedback_slot_; } + virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { - return &receiver_types_; + if (expression()->IsProperty()) { + return expression()->AsProperty()->GetReceiverTypes(); + } + return NULL; } - virtual bool IsMonomorphic() V8_OVERRIDE { return is_monomorphic_; } - bool KeyedArrayCallIsHoley() { return keyed_array_call_is_holey_; } - CheckType check_type() const { return check_type_; } - void set_string_check(Handle<JSObject> holder) { - holder_ = holder; - check_type_ = STRING_CHECK; + virtual bool IsMonomorphic() V8_OVERRIDE { + if (expression()->IsProperty()) { + return expression()->AsProperty()->IsMonomorphic(); + } + return !target_.is_null(); } - void set_number_check(Handle<JSObject> holder) { - holder_ = holder; - check_type_ = NUMBER_CHECK; + bool global_call() const { + VariableProxy* proxy = expression_->AsVariableProxy(); + return proxy != NULL && proxy->var()->IsUnallocated(); } - void set_map_check() { - holder_ = Handle<JSObject>::null(); - check_type_ = RECEIVER_MAP_CHECK; + bool known_global_function() const { + return global_call() && !target_.is_null(); } Handle<JSFunction> target() { return target_; } - // A cache for the holder, set as a side effect of computing the target of the - // call. Note that it contains the null handle when the receiver is the same - // as the holder! - Handle<JSObject> holder() { return holder_; } - Handle<Cell> cell() { return cell_; } - bool ComputeTarget(Handle<Map> type, Handle<String> name); + Handle<AllocationSite> allocation_site() { return allocation_site_; } + + void set_target(Handle<JSFunction> target) { target_ = target; } + void set_allocation_site(Handle<AllocationSite> site) { + allocation_site_ = site; + } bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupResult* lookup); BailoutId ReturnId() const { return return_id_; } - // TODO(rossberg): this should really move somewhere else (and be merged with - // various similar methods in objets.cc), but for now... - static Handle<JSObject> GetPrototypeForPrimitiveCheck( - CheckType check, Isolate* isolate); + enum CallType { + POSSIBLY_EVAL_CALL, + GLOBAL_CALL, + LOOKUP_SLOT_CALL, + PROPERTY_CALL, + OTHER_CALL + }; + + // Helpers to determine how to handle the call. + CallType GetCallType(Isolate* isolate) const; + bool IsUsingCallFeedbackSlot(Isolate* isolate) const; #ifdef DEBUG // Used to assert that the FullCodeGenerator records the return site. @@ -1795,35 +1801,34 @@ class Call V8_FINAL : public Expression { #endif protected: - Call(Isolate* isolate, + Call(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments, int pos) - : Expression(isolate, pos), + : Expression(zone, pos), expression_(expression), arguments_(arguments), - is_monomorphic_(false), - keyed_array_call_is_holey_(true), - check_type_(RECEIVER_MAP_CHECK), - return_id_(GetNextId(isolate)) { } + call_feedback_slot_(kInvalidFeedbackSlot), + return_id_(GetNextId(zone)) { + if (expression->IsProperty()) { + expression->AsProperty()->mark_for_call(); + } + } private: Expression* expression_; ZoneList<Expression*>* arguments_; - bool is_monomorphic_; - bool keyed_array_call_is_holey_; - CheckType check_type_; - SmallMapList receiver_types_; Handle<JSFunction> target_; - Handle<JSObject> holder_; Handle<Cell> cell_; + Handle<AllocationSite> allocation_site_; + int call_feedback_slot_; const BailoutId return_id_; }; -class CallNew V8_FINAL : public Expression { +class CallNew V8_FINAL : public Expression, public FeedbackSlotInterface { public: DECLARE_NODE_TYPE(CallNew) @@ -1831,28 +1836,47 @@ class CallNew V8_FINAL : public Expression { ZoneList<Expression*>* arguments() const { return arguments_; } // Type feedback information. - TypeFeedbackId CallNewFeedbackId() const { return reuse(id()); } + virtual int ComputeFeedbackSlotCount() { + return FLAG_pretenuring_call_new ? 2 : 1; + } + virtual void SetFirstFeedbackSlot(int slot) { + callnew_feedback_slot_ = slot; + } + + int CallNewFeedbackSlot() { + ASSERT(callnew_feedback_slot_ != kInvalidFeedbackSlot); + return callnew_feedback_slot_; + } + int AllocationSiteFeedbackSlot() { + ASSERT(callnew_feedback_slot_ != kInvalidFeedbackSlot); + ASSERT(FLAG_pretenuring_call_new); + return callnew_feedback_slot_ + 1; + } + void RecordTypeFeedback(TypeFeedbackOracle* oracle); virtual bool IsMonomorphic() V8_OVERRIDE { return is_monomorphic_; } Handle<JSFunction> target() const { return target_; } ElementsKind elements_kind() const { return elements_kind_; } - Handle<Cell> allocation_info_cell() const { - return allocation_info_cell_; + Handle<AllocationSite> allocation_site() const { + return allocation_site_; } + static int feedback_slots() { return 1; } + BailoutId ReturnId() const { return return_id_; } protected: - CallNew(Isolate* isolate, + CallNew(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments, int pos) - : Expression(isolate, pos), + : Expression(zone, pos), expression_(expression), arguments_(arguments), is_monomorphic_(false), elements_kind_(GetInitialFastElementsKind()), - return_id_(GetNextId(isolate)) { } + callnew_feedback_slot_(kInvalidFeedbackSlot), + return_id_(GetNextId(zone)) { } private: Expression* expression_; @@ -1861,7 +1885,8 @@ class CallNew V8_FINAL : public Expression { bool is_monomorphic_; Handle<JSFunction> target_; ElementsKind elements_kind_; - Handle<Cell> allocation_info_cell_; + Handle<AllocationSite> allocation_site_; + int callnew_feedback_slot_; const BailoutId return_id_; }; @@ -1883,12 +1908,12 @@ class CallRuntime V8_FINAL : public Expression { TypeFeedbackId CallRuntimeFeedbackId() const { return reuse(id()); } protected: - CallRuntime(Isolate* isolate, + CallRuntime(Zone* zone, Handle<String> name, const Runtime::Function* function, ZoneList<Expression*>* arguments, int pos) - : Expression(isolate, pos), + : Expression(zone, pos), name_(name), function_(function), arguments_(arguments) { } @@ -1914,15 +1939,15 @@ class UnaryOperation V8_FINAL : public Expression { TypeFeedbackOracle* oracle) V8_OVERRIDE; protected: - UnaryOperation(Isolate* isolate, + UnaryOperation(Zone* zone, Token::Value op, Expression* expression, int pos) - : Expression(isolate, pos), + : Expression(zone, pos), op_(op), expression_(expression), - materialize_true_id_(GetNextId(isolate)), - materialize_false_id_(GetNextId(isolate)) { + materialize_true_id_(GetNextId(zone)), + materialize_false_id_(GetNextId(zone)) { ASSERT(Token::IsUnaryOp(op)); } @@ -1941,11 +1966,15 @@ class BinaryOperation V8_FINAL : public Expression { public: DECLARE_NODE_TYPE(BinaryOperation) - virtual bool ResultOverwriteAllowed(); + virtual bool ResultOverwriteAllowed() const V8_OVERRIDE; Token::Value op() const { return op_; } Expression* left() const { return left_; } Expression* right() const { return right_; } + Handle<AllocationSite> allocation_site() const { return allocation_site_; } + void set_allocation_site(Handle<AllocationSite> allocation_site) { + allocation_site_ = allocation_site; + } BailoutId RightId() const { return right_id_; } @@ -1957,16 +1986,16 @@ class BinaryOperation V8_FINAL : public Expression { TypeFeedbackOracle* oracle) V8_OVERRIDE; protected: - BinaryOperation(Isolate* isolate, + BinaryOperation(Zone* zone, Token::Value op, Expression* left, Expression* right, int pos) - : Expression(isolate, pos), + : Expression(zone, pos), op_(op), left_(left), right_(right), - right_id_(GetNextId(isolate)) { + right_id_(GetNextId(zone)) { ASSERT(Token::IsBinaryOp(op)); } @@ -1974,6 +2003,7 @@ class BinaryOperation V8_FINAL : public Expression { Token::Value op_; Expression* left_; Expression* right_; + Handle<AllocationSite> allocation_site_; // TODO(rossberg): the fixed arg should probably be represented as a Constant // type for the RHS. @@ -2008,9 +2038,9 @@ class CountOperation V8_FINAL : public Expression { virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { return store_mode_; } - Handle<Type> type() const { return type_; } + Type* type() const { return type_; } void set_store_mode(KeyedAccessStoreMode mode) { store_mode_ = mode; } - void set_type(Handle<Type> type) { type_ = type; } + void set_type(Type* type) { type_ = type; } BailoutId AssignmentId() const { return assignment_id_; } @@ -2018,25 +2048,25 @@ class CountOperation V8_FINAL : public Expression { TypeFeedbackId CountStoreFeedbackId() const { return reuse(id()); } protected: - CountOperation(Isolate* isolate, + CountOperation(Zone* zone, Token::Value op, bool is_prefix, Expression* expr, int pos) - : Expression(isolate, pos), + : Expression(zone, pos), op_(op), is_prefix_(is_prefix), store_mode_(STANDARD_STORE), expression_(expr), - assignment_id_(GetNextId(isolate)), - count_id_(GetNextId(isolate)) {} + assignment_id_(GetNextId(zone)), + count_id_(GetNextId(zone)) {} private: Token::Value op_; bool is_prefix_ : 1; KeyedAccessStoreMode store_mode_ : 5; // Windows treats as signed, // must have extra bit. - Handle<Type> type_; + Type* type_; Expression* expression_; const BailoutId assignment_id_; @@ -2055,8 +2085,8 @@ class CompareOperation V8_FINAL : public Expression { // Type feedback information. TypeFeedbackId CompareOperationFeedbackId() const { return reuse(id()); } - Handle<Type> combined_type() const { return combined_type_; } - void set_combined_type(Handle<Type> type) { combined_type_ = type; } + Type* combined_type() const { return combined_type_; } + void set_combined_type(Type* type) { combined_type_ = type; } // Match special cases. bool IsLiteralCompareTypeof(Expression** expr, Handle<String>* check); @@ -2064,16 +2094,16 @@ class CompareOperation V8_FINAL : public Expression { bool IsLiteralCompareNull(Expression** expr); protected: - CompareOperation(Isolate* isolate, + CompareOperation(Zone* zone, Token::Value op, Expression* left, Expression* right, int pos) - : Expression(isolate, pos), + : Expression(zone, pos), op_(op), left_(left), right_(right), - combined_type_(Type::None(), isolate) { + combined_type_(Type::None(zone)) { ASSERT(Token::IsCompareOp(op)); } @@ -2082,7 +2112,7 @@ class CompareOperation V8_FINAL : public Expression { Expression* left_; Expression* right_; - Handle<Type> combined_type_; + Type* combined_type_; }; @@ -2098,17 +2128,17 @@ class Conditional V8_FINAL : public Expression { BailoutId ElseId() const { return else_id_; } protected: - Conditional(Isolate* isolate, + Conditional(Zone* zone, Expression* condition, Expression* then_expression, Expression* else_expression, int position) - : Expression(isolate, position), + : Expression(zone, position), condition_(condition), then_expression_(then_expression), else_expression_(else_expression), - then_id_(GetNextId(isolate)), - else_id_(GetNextId(isolate)) { } + then_id_(GetNextId(zone)), + else_id_(GetNextId(zone)) { } private: Expression* condition_; @@ -2143,9 +2173,8 @@ class Assignment V8_FINAL : public Expression { return receiver_types_.length() == 1; } bool IsUninitialized() { return is_uninitialized_; } - bool IsPreMonomorphic() { return is_pre_monomorphic_; } bool HasNoTypeInformation() { - return is_uninitialized_ || is_pre_monomorphic_; + return is_uninitialized_; } virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { return &receiver_types_; @@ -2154,18 +2183,17 @@ class Assignment V8_FINAL : public Expression { return store_mode_; } void set_is_uninitialized(bool b) { is_uninitialized_ = b; } - void set_is_pre_monomorphic(bool b) { is_pre_monomorphic_ = b; } void set_store_mode(KeyedAccessStoreMode mode) { store_mode_ = mode; } protected: - Assignment(Isolate* isolate, + Assignment(Zone* zone, Token::Value op, Expression* target, Expression* value, int pos); template<class Visitor> - void Init(Isolate* isolate, AstNodeFactory<Visitor>* factory) { + void Init(Zone* zone, AstNodeFactory<Visitor>* factory) { ASSERT(Token::IsAssignmentOp(op_)); if (is_compound()) { binary_operation_ = factory->NewBinaryOperation( @@ -2181,7 +2209,6 @@ class Assignment V8_FINAL : public Expression { const BailoutId assignment_id_; bool is_uninitialized_ : 1; - bool is_pre_monomorphic_ : 1; KeyedAccessStoreMode store_mode_ : 5; // Windows treats as signed, // must have extra bit. SmallMapList receiver_types_; @@ -2216,12 +2243,12 @@ class Yield V8_FINAL : public Expression { } protected: - Yield(Isolate* isolate, + Yield(Zone* zone, Expression* generator_object, Expression* expression, Kind yield_kind, int pos) - : Expression(isolate, pos), + : Expression(zone, pos), generator_object_(generator_object), expression_(expression), yield_kind_(yield_kind), @@ -2242,8 +2269,8 @@ class Throw V8_FINAL : public Expression { Expression* exception() const { return exception_; } protected: - Throw(Isolate* isolate, Expression* exception, int pos) - : Expression(isolate, pos), exception_(exception) {} + Throw(Zone* zone, Expression* exception, int pos) + : Expression(zone, pos), exception_(exception) {} private: Expression* exception_; @@ -2278,6 +2305,12 @@ class FunctionLiteral V8_FINAL : public Expression { kNotGenerator }; + enum ArityRestriction { + NORMAL_ARITY, + GETTER_ARITY, + SETTER_ARITY + }; + DECLARE_NODE_TYPE(FunctionLiteral) Handle<String> name() const { return name_; } @@ -2290,8 +2323,7 @@ class FunctionLiteral V8_FINAL : public Expression { int SourceSize() const { return end_position() - start_position(); } bool is_expression() const { return IsExpression::decode(bitfield_); } bool is_anonymous() const { return IsAnonymous::decode(bitfield_); } - bool is_classic_mode() const { return language_mode() == CLASSIC_MODE; } - LanguageMode language_mode() const; + StrictMode strict_mode() const; int materialized_literal_count() { return materialized_literal_count_; } int expected_property_count() { return expected_property_count_; } @@ -2301,6 +2333,8 @@ class FunctionLiteral V8_FINAL : public Expression { bool AllowsLazyCompilation(); bool AllowsLazyCompilationWithoutContext(); + void InitializeSharedInfo(Handle<Code> code); + Handle<String> debug_name() const { if (name_->length() > 0) return name_; return inferred_name(); @@ -2311,6 +2345,9 @@ class FunctionLiteral V8_FINAL : public Expression { inferred_name_ = inferred_name; } + // shared_info may be null if it's not cached in full code. + Handle<SharedFunctionInfo> shared_info() { return shared_info_; } + bool pretenure() { return Pretenure::decode(bitfield_); } void set_pretenure() { bitfield_ |= Pretenure::encode(true); } @@ -2341,7 +2378,9 @@ class FunctionLiteral V8_FINAL : public Expression { void set_ast_properties(AstProperties* ast_properties) { ast_properties_ = *ast_properties; } - + int slot_count() { + return ast_properties_.feedback_slots(); + } bool dont_optimize() { return dont_optimize_reason_ != kNoReason; } BailoutReason dont_optimize_reason() { return dont_optimize_reason_; } void set_dont_optimize_reason(BailoutReason reason) { @@ -2349,7 +2388,7 @@ class FunctionLiteral V8_FINAL : public Expression { } protected: - FunctionLiteral(Isolate* isolate, + FunctionLiteral(Zone* zone, Handle<String> name, Scope* scope, ZoneList<Statement*>* body, @@ -2363,11 +2402,11 @@ class FunctionLiteral V8_FINAL : public Expression { IsParenthesizedFlag is_parenthesized, IsGeneratorFlag is_generator, int position) - : Expression(isolate, position), + : Expression(zone, position), name_(name), scope_(scope), body_(body), - inferred_name_(isolate->factory()->empty_string()), + inferred_name_(zone->isolate()->factory()->empty_string()), dont_optimize_reason_(kNoReason), materialized_literal_count_(materialized_literal_count), expected_property_count_(expected_property_count), @@ -2386,6 +2425,7 @@ class FunctionLiteral V8_FINAL : public Expression { private: Handle<String> name_; + Handle<SharedFunctionInfo> shared_info_; Scope* scope_; ZoneList<Statement*>* body_; Handle<String> inferred_name_; @@ -2418,8 +2458,8 @@ class NativeFunctionLiteral V8_FINAL : public Expression { protected: NativeFunctionLiteral( - Isolate* isolate, Handle<String> name, v8::Extension* extension, int pos) - : Expression(isolate, pos), name_(name), extension_(extension) {} + Zone* zone, Handle<String> name, v8::Extension* extension, int pos) + : Expression(zone, pos), name_(name), extension_(extension) {} private: Handle<String> name_; @@ -2432,7 +2472,7 @@ class ThisFunction V8_FINAL : public Expression { DECLARE_NODE_TYPE(ThisFunction) protected: - explicit ThisFunction(Isolate* isolate, int pos): Expression(isolate, pos) {} + explicit ThisFunction(Zone* zone, int pos): Expression(zone, pos) {} }; #undef DECLARE_NODE_TYPE @@ -2799,8 +2839,8 @@ class RegExpEmpty V8_FINAL : public RegExpTree { // ---------------------------------------------------------------------------- // Out-of-line inline constructors (to side-step cyclic dependencies). -inline ModuleVariable::ModuleVariable(VariableProxy* proxy, int pos) - : Module(proxy->interface(), pos), +inline ModuleVariable::ModuleVariable(Zone* zone, VariableProxy* proxy, int pos) + : Module(zone, proxy->interface(), pos), proxy_(proxy) { } @@ -2832,7 +2872,7 @@ class AstVisitor BASE_EMBEDDED { #define DEFINE_AST_VISITOR_SUBCLASS_MEMBERS() \ public: \ - virtual void Visit(AstNode* node) V8_FINAL V8_OVERRIDE { \ + virtual void Visit(AstNode* node) V8_FINAL V8_OVERRIDE { \ if (!CheckStackOverflow()) node->Accept(this); \ } \ \ @@ -2842,19 +2882,20 @@ public: \ \ bool CheckStackOverflow() { \ if (stack_overflow_) return true; \ - StackLimitCheck check(isolate_); \ + StackLimitCheck check(zone_->isolate()); \ if (!check.HasOverflowed()) return false; \ return (stack_overflow_ = true); \ } \ \ private: \ - void InitializeAstVisitor(Isolate* isolate) { \ - isolate_ = isolate; \ + void InitializeAstVisitor(Zone* zone) { \ + zone_ = zone; \ stack_overflow_ = false; \ } \ - Isolate* isolate() { return isolate_; } \ + Zone* zone() { return zone_; } \ + Isolate* isolate() { return zone_->isolate(); } \ \ - Isolate* isolate_; \ + Zone* zone_; \ bool stack_overflow_ @@ -2883,6 +2924,14 @@ class AstConstructionVisitor BASE_EMBEDDED { dont_optimize_reason_ = reason; } + void add_slot_node(FeedbackSlotInterface* slot_node) { + int count = slot_node->ComputeFeedbackSlotCount(); + if (count > 0) { + slot_node->SetFirstFeedbackSlot(properties_.feedback_slots()); + properties_.increase_feedback_slots(count); + } + } + AstProperties properties_; BailoutReason dont_optimize_reason_; }; @@ -2905,9 +2954,7 @@ class AstNullVisitor BASE_EMBEDDED { template<class Visitor> class AstNodeFactory V8_FINAL BASE_EMBEDDED { public: - AstNodeFactory(Isolate* isolate, Zone* zone) - : isolate_(isolate), - zone_(zone) { } + explicit AstNodeFactory(Zone* zone) : zone_(zone) { } Visitor* visitor() { return &visitor_; } @@ -2920,7 +2967,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Scope* scope, int pos) { VariableDeclaration* decl = - new(zone_) VariableDeclaration(proxy, mode, scope, pos); + new(zone_) VariableDeclaration(zone_, proxy, mode, scope, pos); VISIT_AND_RETURN(VariableDeclaration, decl) } @@ -2930,7 +2977,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Scope* scope, int pos) { FunctionDeclaration* decl = - new(zone_) FunctionDeclaration(proxy, mode, fun, scope, pos); + new(zone_) FunctionDeclaration(zone_, proxy, mode, fun, scope, pos); VISIT_AND_RETURN(FunctionDeclaration, decl) } @@ -2939,7 +2986,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Scope* scope, int pos) { ModuleDeclaration* decl = - new(zone_) ModuleDeclaration(proxy, module, scope, pos); + new(zone_) ModuleDeclaration(zone_, proxy, module, scope, pos); VISIT_AND_RETURN(ModuleDeclaration, decl) } @@ -2948,7 +2995,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Scope* scope, int pos) { ImportDeclaration* decl = - new(zone_) ImportDeclaration(proxy, module, scope, pos); + new(zone_) ImportDeclaration(zone_, proxy, module, scope, pos); VISIT_AND_RETURN(ImportDeclaration, decl) } @@ -2956,27 +3003,28 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Scope* scope, int pos) { ExportDeclaration* decl = - new(zone_) ExportDeclaration(proxy, scope, pos); + new(zone_) ExportDeclaration(zone_, proxy, scope, pos); VISIT_AND_RETURN(ExportDeclaration, decl) } ModuleLiteral* NewModuleLiteral(Block* body, Interface* interface, int pos) { - ModuleLiteral* module = new(zone_) ModuleLiteral(body, interface, pos); + ModuleLiteral* module = + new(zone_) ModuleLiteral(zone_, body, interface, pos); VISIT_AND_RETURN(ModuleLiteral, module) } ModuleVariable* NewModuleVariable(VariableProxy* proxy, int pos) { - ModuleVariable* module = new(zone_) ModuleVariable(proxy, pos); + ModuleVariable* module = new(zone_) ModuleVariable(zone_, proxy, pos); VISIT_AND_RETURN(ModuleVariable, module) } ModulePath* NewModulePath(Module* origin, Handle<String> name, int pos) { - ModulePath* module = new(zone_) ModulePath(origin, name, zone_, pos); + ModulePath* module = new(zone_) ModulePath(zone_, origin, name, pos); VISIT_AND_RETURN(ModulePath, module) } ModuleUrl* NewModuleUrl(Handle<String> url, int pos) { - ModuleUrl* module = new(zone_) ModuleUrl(url, zone_, pos); + ModuleUrl* module = new(zone_) ModuleUrl(zone_, url, pos); VISIT_AND_RETURN(ModuleUrl, module) } @@ -2985,13 +3033,13 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { bool is_initializer_block, int pos) { Block* block = new(zone_) Block( - isolate_, labels, capacity, is_initializer_block, pos, zone_); + zone_, labels, capacity, is_initializer_block, pos); VISIT_AND_RETURN(Block, block) } #define STATEMENT_WITH_LABELS(NodeType) \ NodeType* New##NodeType(ZoneStringList* labels, int pos) { \ - NodeType* stmt = new(zone_) NodeType(isolate_, labels, pos); \ + NodeType* stmt = new(zone_) NodeType(zone_, labels, pos); \ VISIT_AND_RETURN(NodeType, stmt); \ } STATEMENT_WITH_LABELS(DoWhileStatement) @@ -3005,11 +3053,11 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { int pos) { switch (visit_mode) { case ForEachStatement::ENUMERATE: { - ForInStatement* stmt = new(zone_) ForInStatement(isolate_, labels, pos); + ForInStatement* stmt = new(zone_) ForInStatement(zone_, labels, pos); VISIT_AND_RETURN(ForInStatement, stmt); } case ForEachStatement::ITERATE: { - ForOfStatement* stmt = new(zone_) ForOfStatement(isolate_, labels, pos); + ForOfStatement* stmt = new(zone_) ForOfStatement(zone_, labels, pos); VISIT_AND_RETURN(ForOfStatement, stmt); } } @@ -3019,27 +3067,28 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { ModuleStatement* NewModuleStatement( VariableProxy* proxy, Block* body, int pos) { - ModuleStatement* stmt = new(zone_) ModuleStatement(proxy, body, pos); + ModuleStatement* stmt = new(zone_) ModuleStatement(zone_, proxy, body, pos); VISIT_AND_RETURN(ModuleStatement, stmt) } ExpressionStatement* NewExpressionStatement(Expression* expression, int pos) { - ExpressionStatement* stmt = new(zone_) ExpressionStatement(expression, pos); + ExpressionStatement* stmt = + new(zone_) ExpressionStatement(zone_, expression, pos); VISIT_AND_RETURN(ExpressionStatement, stmt) } ContinueStatement* NewContinueStatement(IterationStatement* target, int pos) { - ContinueStatement* stmt = new(zone_) ContinueStatement(target, pos); + ContinueStatement* stmt = new(zone_) ContinueStatement(zone_, target, pos); VISIT_AND_RETURN(ContinueStatement, stmt) } BreakStatement* NewBreakStatement(BreakableStatement* target, int pos) { - BreakStatement* stmt = new(zone_) BreakStatement(target, pos); + BreakStatement* stmt = new(zone_) BreakStatement(zone_, target, pos); VISIT_AND_RETURN(BreakStatement, stmt) } ReturnStatement* NewReturnStatement(Expression* expression, int pos) { - ReturnStatement* stmt = new(zone_) ReturnStatement(expression, pos); + ReturnStatement* stmt = new(zone_) ReturnStatement(zone_, expression, pos); VISIT_AND_RETURN(ReturnStatement, stmt) } @@ -3048,7 +3097,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Statement* statement, int pos) { WithStatement* stmt = new(zone_) WithStatement( - scope, expression, statement, pos); + zone_, scope, expression, statement, pos); VISIT_AND_RETURN(WithStatement, stmt) } @@ -3057,7 +3106,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Statement* else_statement, int pos) { IfStatement* stmt = new(zone_) IfStatement( - isolate_, condition, then_statement, else_statement, pos); + zone_, condition, then_statement, else_statement, pos); VISIT_AND_RETURN(IfStatement, stmt) } @@ -3068,7 +3117,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Block* catch_block, int pos) { TryCatchStatement* stmt = new(zone_) TryCatchStatement( - index, try_block, scope, variable, catch_block, pos); + zone_, index, try_block, scope, variable, catch_block, pos); VISIT_AND_RETURN(TryCatchStatement, stmt) } @@ -3076,34 +3125,35 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Block* try_block, Block* finally_block, int pos) { - TryFinallyStatement* stmt = - new(zone_) TryFinallyStatement(index, try_block, finally_block, pos); + TryFinallyStatement* stmt = new(zone_) TryFinallyStatement( + zone_, index, try_block, finally_block, pos); VISIT_AND_RETURN(TryFinallyStatement, stmt) } DebuggerStatement* NewDebuggerStatement(int pos) { - DebuggerStatement* stmt = new(zone_) DebuggerStatement(pos); + DebuggerStatement* stmt = new(zone_) DebuggerStatement(zone_, pos); VISIT_AND_RETURN(DebuggerStatement, stmt) } EmptyStatement* NewEmptyStatement(int pos) { - return new(zone_) EmptyStatement(pos); + return new(zone_) EmptyStatement(zone_, pos); } CaseClause* NewCaseClause( Expression* label, ZoneList<Statement*>* statements, int pos) { CaseClause* clause = - new(zone_) CaseClause(isolate_, label, statements, pos); + new(zone_) CaseClause(zone_, label, statements, pos); VISIT_AND_RETURN(CaseClause, clause) } Literal* NewLiteral(Handle<Object> handle, int pos) { - Literal* lit = new(zone_) Literal(isolate_, handle, pos); + Literal* lit = new(zone_) Literal(zone_, handle, pos); VISIT_AND_RETURN(Literal, lit) } Literal* NewNumberLiteral(double number, int pos) { - return NewLiteral(isolate_->factory()->NewNumber(number, TENURED), pos); + return NewLiteral( + zone_->isolate()->factory()->NewNumber(number, TENURED), pos); } ObjectLiteral* NewObjectLiteral( @@ -3113,16 +3163,21 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { bool has_function, int pos) { ObjectLiteral* lit = new(zone_) ObjectLiteral( - isolate_, properties, literal_index, boilerplate_properties, + zone_, properties, literal_index, boilerplate_properties, has_function, pos); VISIT_AND_RETURN(ObjectLiteral, lit) } + ObjectLiteral::Property* NewObjectLiteralProperty(Literal* key, + Expression* value) { + return new(zone_) ObjectLiteral::Property(zone_, key, value); + } + ObjectLiteral::Property* NewObjectLiteralProperty(bool is_getter, FunctionLiteral* value, int pos) { ObjectLiteral::Property* prop = - new(zone_) ObjectLiteral::Property(is_getter, value); + new(zone_) ObjectLiteral::Property(zone_, is_getter, value); prop->set_key(NewLiteral(value->name(), pos)); return prop; // Not an AST node, will not be visited. } @@ -3132,7 +3187,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { int literal_index, int pos) { RegExpLiteral* lit = - new(zone_) RegExpLiteral(isolate_, pattern, flags, literal_index, pos); + new(zone_) RegExpLiteral(zone_, pattern, flags, literal_index, pos); VISIT_AND_RETURN(RegExpLiteral, lit); } @@ -3140,13 +3195,13 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { int literal_index, int pos) { ArrayLiteral* lit = new(zone_) ArrayLiteral( - isolate_, values, literal_index, pos); + zone_, values, literal_index, pos); VISIT_AND_RETURN(ArrayLiteral, lit) } VariableProxy* NewVariableProxy(Variable* var, int pos = RelocInfo::kNoPosition) { - VariableProxy* proxy = new(zone_) VariableProxy(isolate_, var, pos); + VariableProxy* proxy = new(zone_) VariableProxy(zone_, var, pos); VISIT_AND_RETURN(VariableProxy, proxy) } @@ -3155,26 +3210,26 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Interface* interface = Interface::NewValue(), int position = RelocInfo::kNoPosition) { VariableProxy* proxy = - new(zone_) VariableProxy(isolate_, name, is_this, interface, position); + new(zone_) VariableProxy(zone_, name, is_this, interface, position); VISIT_AND_RETURN(VariableProxy, proxy) } Property* NewProperty(Expression* obj, Expression* key, int pos) { - Property* prop = new(zone_) Property(isolate_, obj, key, pos); + Property* prop = new(zone_) Property(zone_, obj, key, pos); VISIT_AND_RETURN(Property, prop) } Call* NewCall(Expression* expression, ZoneList<Expression*>* arguments, int pos) { - Call* call = new(zone_) Call(isolate_, expression, arguments, pos); + Call* call = new(zone_) Call(zone_, expression, arguments, pos); VISIT_AND_RETURN(Call, call) } CallNew* NewCallNew(Expression* expression, ZoneList<Expression*>* arguments, int pos) { - CallNew* call = new(zone_) CallNew(isolate_, expression, arguments, pos); + CallNew* call = new(zone_) CallNew(zone_, expression, arguments, pos); VISIT_AND_RETURN(CallNew, call) } @@ -3183,7 +3238,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { ZoneList<Expression*>* arguments, int pos) { CallRuntime* call = - new(zone_) CallRuntime(isolate_, name, function, arguments, pos); + new(zone_) CallRuntime(zone_, name, function, arguments, pos); VISIT_AND_RETURN(CallRuntime, call) } @@ -3191,7 +3246,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Expression* expression, int pos) { UnaryOperation* node = - new(zone_) UnaryOperation(isolate_, op, expression, pos); + new(zone_) UnaryOperation(zone_, op, expression, pos); VISIT_AND_RETURN(UnaryOperation, node) } @@ -3200,7 +3255,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Expression* right, int pos) { BinaryOperation* node = - new(zone_) BinaryOperation(isolate_, op, left, right, pos); + new(zone_) BinaryOperation(zone_, op, left, right, pos); VISIT_AND_RETURN(BinaryOperation, node) } @@ -3209,7 +3264,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Expression* expr, int pos) { CountOperation* node = - new(zone_) CountOperation(isolate_, op, is_prefix, expr, pos); + new(zone_) CountOperation(zone_, op, is_prefix, expr, pos); VISIT_AND_RETURN(CountOperation, node) } @@ -3218,7 +3273,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Expression* right, int pos) { CompareOperation* node = - new(zone_) CompareOperation(isolate_, op, left, right, pos); + new(zone_) CompareOperation(zone_, op, left, right, pos); VISIT_AND_RETURN(CompareOperation, node) } @@ -3227,7 +3282,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Expression* else_expression, int position) { Conditional* cond = new(zone_) Conditional( - isolate_, condition, then_expression, else_expression, position); + zone_, condition, then_expression, else_expression, position); VISIT_AND_RETURN(Conditional, cond) } @@ -3236,8 +3291,8 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Expression* value, int pos) { Assignment* assign = - new(zone_) Assignment(isolate_, op, target, value, pos); - assign->Init(isolate_, this); + new(zone_) Assignment(zone_, op, target, value, pos); + assign->Init(zone_, this); VISIT_AND_RETURN(Assignment, assign) } @@ -3246,12 +3301,12 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { Yield::Kind yield_kind, int pos) { Yield* yield = new(zone_) Yield( - isolate_, generator_object, expression, yield_kind, pos); + zone_, generator_object, expression, yield_kind, pos); VISIT_AND_RETURN(Yield, yield) } Throw* NewThrow(Expression* exception, int pos) { - Throw* t = new(zone_) Throw(isolate_, exception, pos); + Throw* t = new(zone_) Throw(zone_, exception, pos); VISIT_AND_RETURN(Throw, t) } @@ -3270,7 +3325,7 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { FunctionLiteral::IsGeneratorFlag is_generator, int position) { FunctionLiteral* lit = new(zone_) FunctionLiteral( - isolate_, name, scope, body, + zone_, name, scope, body, materialized_literal_count, expected_property_count, handler_count, parameter_count, function_type, has_duplicate_parameters, is_function, is_parenthesized, is_generator, position); @@ -3284,19 +3339,18 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED { NativeFunctionLiteral* NewNativeFunctionLiteral( Handle<String> name, v8::Extension* extension, int pos) { NativeFunctionLiteral* lit = - new(zone_) NativeFunctionLiteral(isolate_, name, extension, pos); + new(zone_) NativeFunctionLiteral(zone_, name, extension, pos); VISIT_AND_RETURN(NativeFunctionLiteral, lit) } ThisFunction* NewThisFunction(int pos) { - ThisFunction* fun = new(zone_) ThisFunction(isolate_, pos); + ThisFunction* fun = new(zone_) ThisFunction(zone_, pos); VISIT_AND_RETURN(ThisFunction, fun) } #undef VISIT_AND_RETURN private: - Isolate* isolate_; Zone* zone_; Visitor visitor_; }; |