Zonify types in compiler frontend
authorrossberg@chromium.org <rossberg@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 21 Jan 2014 16:22:52 +0000 (16:22 +0000)
committerrossberg@chromium.org <rossberg@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 21 Jan 2014 16:22:52 +0000 (16:22 +0000)
Clean up some zone/isolate handling in AST and its visitors on the way.

(Based on https://codereview.chromium.org/103743004/)

R=jkummerow@chromium.org, titzer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/102563004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18719 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

40 files changed:
src/arm/codegen-arm.h
src/arm/stub-cache-arm.cc
src/ast.cc
src/ast.h
src/code-stubs-hydrogen.cc
src/code-stubs.cc
src/code-stubs.h
src/codegen.cc
src/effects.h
src/full-codegen.cc
src/full-codegen.h
src/heap.cc
src/hydrogen.cc
src/hydrogen.h
src/ia32/stub-cache-ia32.cc
src/ic-inl.h
src/ic.cc
src/ic.h
src/list.h
src/objects.cc
src/objects.h
src/parser.cc
src/parser.h
src/prettyprinter.cc
src/prettyprinter.h
src/property-details.h
src/rewriter.cc
src/scopes.cc
src/stub-cache.cc
src/stub-cache.h
src/type-info.cc
src/type-info.h
src/types.cc
src/types.h
src/typing.cc
src/typing.h
src/x64/codegen-x64.h
src/x64/stub-cache-x64.cc
test/cctest/test-ast.cc
test/cctest/test-types.cc

index ecbe64cbad304d8f7eb5d875f99ea3e7e5ad7a61..1ef71a0554d4b3ef0dfea258b7e6083089549c4c 100644 (file)
@@ -44,8 +44,8 @@ enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF };
 
 class CodeGenerator: public AstVisitor {
  public:
-  explicit CodeGenerator(Isolate* isolate) {
-    InitializeAstVisitor(isolate);
+  explicit CodeGenerator(Zone* zone) {
+    InitializeAstVisitor(zone);
   }
 
   static bool MakeCode(CompilationInfo* info);
index 50fec5dacf0539a5afc485706e8b3d9b09be88af..987437bbd7bd60163f17c9d828fad46951f0c6fc 100644 (file)
@@ -1160,7 +1160,7 @@ void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) {
 #define __ ACCESS_MASM(masm())
 
 
-Register StubCompiler::CheckPrototypes(Handle<Type> type,
+Register StubCompiler::CheckPrototypes(Handle<HeapType> type,
                                        Register object_reg,
                                        Handle<JSObject> holder,
                                        Register holder_reg,
@@ -1296,7 +1296,7 @@ void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) {
 
 
 Register LoadStubCompiler::CallbackHandlerFrontend(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Register object_reg,
     Handle<JSObject> holder,
     Handle<Name> name,
@@ -1962,7 +1962,7 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
 }
 
 
-Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<Type> type,
+Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<HeapType> type,
                                                       Handle<JSObject> last,
                                                       Handle<Name> name) {
   NonexistentHandlerFrontend(type, last, name);
@@ -2045,7 +2045,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
 
 
 Handle<Code> LoadStubCompiler::CompileLoadGlobal(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Handle<GlobalObject> global,
     Handle<PropertyCell> cell,
     Handle<Name> name,
@@ -2101,13 +2101,13 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
   int number_of_handled_maps = 0;
   __ ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
   for (int current = 0; current < receiver_count; ++current) {
-    Handle<Type> type = types->at(current);
+    Handle<HeapType> type = types->at(current);
     Handle<Map> map = IC::TypeToMap(*type, isolate());
     if (!map->is_deprecated()) {
       number_of_handled_maps++;
       __ mov(ip, Operand(map));
       __ cmp(map_reg, ip);
-      if (type->Is(Type::Number())) {
+      if (type->Is(HeapType::Number())) {
         ASSERT(!number_case.is_unused());
         __ bind(&number_case);
       }
index c7e06d387341f37ab700dd9887bd2b3dd1ac9d90..9d8624ca1b179b239314388eab61e9d4a8062f74 100644 (file)
@@ -82,8 +82,8 @@ bool Expression::IsUndefinedLiteral(Isolate* isolate) {
 }
 
 
-VariableProxy::VariableProxy(Isolate* isolate, Variable* var, int position)
-    : Expression(isolate, position),
+VariableProxy::VariableProxy(Zone* zone, Variable* var, int position)
+    : Expression(zone, position),
       name_(var->name()),
       var_(NULL),  // Will be set by the call to BindTo.
       is_this_(var->is_this()),
@@ -94,12 +94,12 @@ VariableProxy::VariableProxy(Isolate* isolate, Variable* var, int position)
 }
 
 
-VariableProxy::VariableProxy(Isolate* isolate,
+VariableProxy::VariableProxy(Zone* zone,
                              Handle<String> name,
                              bool is_this,
                              Interface* interface,
                              int position)
-    : Expression(isolate, position),
+    : Expression(zone, position),
       name_(name),
       var_(NULL),
       is_this_(is_this),
@@ -126,17 +126,17 @@ void VariableProxy::BindTo(Variable* var) {
 }
 
 
-Assignment::Assignment(Isolate* isolate,
+Assignment::Assignment(Zone* zone,
                        Token::Value op,
                        Expression* target,
                        Expression* value,
                        int pos)
-    : Expression(isolate, pos),
+    : Expression(zone, pos),
       op_(op),
       target_(target),
       value_(value),
       binary_operation_(NULL),
-      assignment_id_(GetNextId(isolate)),
+      assignment_id_(GetNextId(zone)),
       is_uninitialized_(false),
       is_pre_monomorphic_(false),
       store_mode_(STANDARD_STORE) { }
@@ -203,15 +203,14 @@ void FunctionLiteral::InitializeSharedInfo(
 }
 
 
-ObjectLiteralProperty::ObjectLiteralProperty(Literal* key,
-                                             Expression* value,
-                                             Isolate* isolate) {
+ObjectLiteralProperty::ObjectLiteralProperty(
+    Zone* zone, Literal* key, Expression* value) {
   emit_store_ = true;
   key_ = key;
   value_ = value;
   Object* k = *key->value();
   if (k->IsInternalizedString() &&
-      isolate->heap()->proto_string()->Equals(String::cast(k))) {
+      zone->isolate()->heap()->proto_string()->Equals(String::cast(k))) {
     kind_ = PROTOTYPE;
   } else if (value_->AsMaterializedLiteral() != NULL) {
     kind_ = MATERIALIZED_LITERAL;
@@ -223,8 +222,8 @@ ObjectLiteralProperty::ObjectLiteralProperty(Literal* key,
 }
 
 
-ObjectLiteralProperty::ObjectLiteralProperty(bool is_getter,
-                                             FunctionLiteral* value) {
+ObjectLiteralProperty::ObjectLiteralProperty(
+    Zone* zone, bool is_getter, FunctionLiteral* value) {
   emit_store_ = true;
   value_ = value;
   kind_ = is_getter ? GETTER : SETTER;
@@ -1146,16 +1145,16 @@ RegExpAlternative::RegExpAlternative(ZoneList<RegExpTree*>* nodes)
 }
 
 
-CaseClause::CaseClause(Isolate* isolate,
+CaseClause::CaseClause(Zone* zone,
                        Expression* label,
                        ZoneList<Statement*>* statements,
                        int pos)
-    : Expression(isolate, pos),
+    : Expression(zone, pos),
       label_(label),
       statements_(statements),
-      compare_type_(Type::None(isolate)),
-      compare_id_(AstNode::GetNextId(isolate)),
-      entry_id_(AstNode::GetNextId(isolate)) {
+      compare_type_(Type::None(zone)),
+      compare_id_(AstNode::GetNextId(zone)),
+      entry_id_(AstNode::GetNextId(zone)) {
 }
 
 
index fe457bd2f7eb2b29abf3b6bfbbfe4a0636905c1c..07227b105c50818d32ff4219ef0038436ba28bfe 100644 (file)
--- a/src/ast.h
+++ b/src/ast.h
@@ -226,13 +226,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;
   }
 
@@ -255,7 +255,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; }
@@ -377,11 +377,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:
@@ -422,13 +422,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);
   }
 
@@ -462,13 +462,12 @@ 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),
         scope_(NULL) {
@@ -490,7 +489,8 @@ class Declaration : public AstNode {
   virtual bool IsInlineable() const;
 
  protected:
-  Declaration(VariableProxy* proxy,
+  Declaration(Zone* zone,
+              VariableProxy* proxy,
               VariableMode mode,
               Scope* scope,
               int pos)
@@ -519,11 +519,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) {
   }
 };
 
@@ -539,12 +540,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);
@@ -566,11 +568,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) {
   }
 
@@ -589,11 +592,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) {
   }
 
@@ -611,8 +615,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) {}
 };
 
 
@@ -626,7 +630,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) {}
@@ -642,8 +646,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) {}
 };
 
 
@@ -654,7 +658,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_;
@@ -669,7 +673,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) {
@@ -688,7 +692,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) {
   }
 
@@ -705,8 +709,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) {
   }
@@ -734,10 +738,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) {
@@ -768,11 +772,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:
@@ -805,11 +809,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:
@@ -856,15 +860,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:
@@ -898,8 +902,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) {
   }
@@ -929,11 +933,11 @@ 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)) {
+        body_id_(GetNextId(zone)),
+        prepare_id_(GetNextId(zone)) {
   }
 
   ForInType for_in_type_;
@@ -990,13 +994,13 @@ 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_iterator_;
@@ -1016,8 +1020,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_;
@@ -1029,7 +1033,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) {}
 };
 
 
@@ -1040,8 +1044,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_;
@@ -1055,8 +1059,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_;
@@ -1070,8 +1074,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_;
@@ -1088,8 +1092,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) { }
@@ -1117,11 +1122,11 @@ class CaseClause V8_FINAL : public Expression {
 
   // 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);
@@ -1129,7 +1134,7 @@ class CaseClause V8_FINAL : public Expression {
   Expression* label_;
   Label body_target_;
   ZoneList<Statement*>* statements_;
-  Handle<Type> compare_type_;
+  Type* compare_type_;
 
   const TypeFeedbackId compare_id_;
   const BailoutId entry_id_;
@@ -1149,8 +1154,8 @@ class SwitchStatement V8_FINAL : public BreakableStatement {
   ZoneList<CaseClause*>* cases() const { return cases_; }
 
  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) { }
 
@@ -1186,18 +1191,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:
@@ -1245,8 +1250,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) { }
@@ -1269,13 +1274,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) {
@@ -1296,8 +1302,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:
@@ -1310,7 +1316,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) {}
 };
 
 
@@ -1319,7 +1325,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) {}
 };
 
 
@@ -1376,11 +1382,10 @@ class Literal V8_FINAL : public Expression {
   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();
@@ -1405,10 +1410,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) {}
@@ -1456,7 +1461,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_; }
@@ -1475,7 +1480,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:
@@ -1527,13 +1532,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),
@@ -1559,12 +1564,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);
@@ -1600,13 +1605,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_;
@@ -1646,9 +1651,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,
@@ -1702,14 +1707,14 @@ class Property V8_FINAL : public Expression {
   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)),
+        load_id_(GetNextId(zone)),
         is_pre_monomorphic_(false),
         is_uninitialized_(false),
         is_string_access_(false),
@@ -1796,17 +1801,17 @@ 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)) { }
+        return_id_(GetNextId(zone)) { }
 
  private:
   Expression* expression_;
@@ -1844,16 +1849,16 @@ class CallNew V8_FINAL : public Expression {
   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)) { }
+        return_id_(GetNextId(zone)) { }
 
  private:
   Expression* expression_;
@@ -1884,12 +1889,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) { }
@@ -1915,15 +1920,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));
   }
 
@@ -1962,16 +1967,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));
   }
 
@@ -2014,9 +2019,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_; }
 
@@ -2024,25 +2029,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_;
@@ -2061,8 +2066,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);
@@ -2070,16 +2075,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));
   }
 
@@ -2088,7 +2093,7 @@ class CompareOperation V8_FINAL : public Expression {
   Expression* left_;
   Expression* right_;
 
-  Handle<Type> combined_type_;
+  Type* combined_type_;
 };
 
 
@@ -2104,17 +2109,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_;
@@ -2164,14 +2169,14 @@ class Assignment V8_FINAL : public Expression {
   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(
@@ -2222,12 +2227,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),
@@ -2248,8 +2253,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_;
@@ -2360,7 +2365,7 @@ class FunctionLiteral V8_FINAL : public Expression {
   }
 
  protected:
-  FunctionLiteral(Isolate* isolate,
+  FunctionLiteral(Zone* zone,
                   Handle<String> name,
                   Scope* scope,
                   ZoneList<Statement*>* body,
@@ -2374,11 +2379,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),
@@ -2430,8 +2435,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_;
@@ -2444,7 +2449,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
@@ -2811,8 +2816,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) {
 }
 
@@ -2844,7 +2849,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);                  \
   }                                                                 \
                                                                     \
@@ -2854,19 +2859,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_
 
 
@@ -2917,9 +2923,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_; }
 
@@ -2932,7 +2936,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)
   }
 
@@ -2942,7 +2946,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)
   }
 
@@ -2951,7 +2955,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)
   }
 
@@ -2960,7 +2964,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)
   }
 
@@ -2968,27 +2972,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)
   }
 
@@ -2997,13 +3002,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)
@@ -3017,11 +3022,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);
       }
     }
@@ -3031,27 +3036,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)
   }
 
@@ -3060,7 +3066,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)
   }
 
@@ -3069,7 +3075,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)
   }
 
@@ -3080,7 +3086,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)
   }
 
@@ -3088,34 +3094,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(
@@ -3125,16 +3132,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.
   }
@@ -3144,7 +3156,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);
   }
 
@@ -3152,13 +3164,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)
   }
 
@@ -3167,26 +3179,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)
   }
 
@@ -3195,7 +3207,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)
   }
 
@@ -3203,7 +3215,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)
   }
 
@@ -3212,7 +3224,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)
   }
 
@@ -3221,7 +3233,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)
   }
 
@@ -3230,7 +3242,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)
   }
 
@@ -3239,7 +3251,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)
   }
 
@@ -3248,8 +3260,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)
   }
 
@@ -3258,12 +3270,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)
   }
 
@@ -3282,7 +3294,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);
@@ -3296,19 +3308,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_;
 };
index 04c66b878145c47580b6d04508166a37f681fc02..32b4b3eb88a16e6dd4670486015f1324977126f7 100644 (file)
@@ -323,7 +323,7 @@ template <>
 HValue* CodeStubGraphBuilder<NumberToStringStub>::BuildCodeStub() {
   info()->MarkAsSavesCallerDoubles();
   HValue* number = GetParameter(NumberToStringStub::kNumber);
-  return BuildNumberToString(number, Type::Number(isolate()));
+  return BuildNumberToString(number, Type::Number(zone()));
 }
 
 
@@ -841,7 +841,7 @@ HValue* CodeStubGraphBuilder<CompareNilICStub>::BuildCodeInitializedStub() {
   CompareNilICStub* stub = casted_stub();
   HIfContinuation continuation;
   Handle<Map> sentinel_map(isolate->heap()->meta_map());
-  Handle<Type> type = stub->GetType(isolate, sentinel_map);
+  Type* type = stub->GetType(zone(), sentinel_map);
   BuildCompareNil(GetParameter(0), type, &continuation);
   IfBuilder if_nil(this, &continuation);
   if_nil.Then();
@@ -868,9 +868,9 @@ HValue* CodeStubGraphBuilder<BinaryOpICStub>::BuildCodeInitializedStub() {
   HValue* left = GetParameter(BinaryOpICStub::kLeft);
   HValue* right = GetParameter(BinaryOpICStub::kRight);
 
-  Handle<Type> left_type = state.GetLeftType(isolate());
-  Handle<Type> right_type = state.GetRightType(isolate());
-  Handle<Type> result_type = state.GetResultType(isolate());
+  Type* left_type = state.GetLeftType(zone());
+  Type* right_type = state.GetRightType(zone());
+  Type* result_type = state.GetResultType(zone());
 
   ASSERT(!left_type->Is(Type::None()) && !right_type->Is(Type::None()) &&
          (state.HasSideEffects() || !result_type->Is(Type::None())));
@@ -889,7 +889,7 @@ HValue* CodeStubGraphBuilder<BinaryOpICStub>::BuildCodeInitializedStub() {
       {
         Push(BuildBinaryOperation(
                     state.op(), left, right,
-                    Type::String(isolate()), right_type,
+                    Type::String(zone()), right_type,
                     result_type, state.fixed_right_arg(),
                     allocation_mode));
       }
@@ -909,7 +909,7 @@ HValue* CodeStubGraphBuilder<BinaryOpICStub>::BuildCodeInitializedStub() {
       {
         Push(BuildBinaryOperation(
                     state.op(), left, right,
-                    left_type, Type::String(isolate()),
+                    left_type, Type::String(zone()),
                     result_type, state.fixed_right_arg(),
                     allocation_mode));
       }
@@ -983,9 +983,9 @@ HValue* CodeStubGraphBuilder<BinaryOpWithAllocationSiteStub>::BuildCodeStub() {
   HValue* left = GetParameter(BinaryOpWithAllocationSiteStub::kLeft);
   HValue* right = GetParameter(BinaryOpWithAllocationSiteStub::kRight);
 
-  Handle<Type> left_type = state.GetLeftType(isolate());
-  Handle<Type> right_type = state.GetRightType(isolate());
-  Handle<Type> result_type = state.GetResultType(isolate());
+  Type* left_type = state.GetLeftType(zone());
+  Type* right_type = state.GetRightType(zone());
+  Type* result_type = state.GetResultType(zone());
   HAllocationMode allocation_mode(allocation_site);
 
   return BuildBinaryOperation(state.op(), left, right,
index 7e886757f81056d151f5ceece7a967deeef2a633..da0a9b6ce6c5b30d7d1a40c1d525bc4764f53a22 100644 (file)
@@ -476,37 +476,33 @@ void CompareNilICStub::State::Print(StringStream* stream) const {
 }
 
 
-Handle<Type> CompareNilICStub::GetType(
-    Isolate* isolate,
-    Handle<Map> map) {
+Type* CompareNilICStub::GetType(Zone* zone, Handle<Map> map) {
   if (state_.Contains(CompareNilICStub::GENERIC)) {
-    return Type::Any(isolate);
+    return Type::Any(zone);
   }
 
-  Handle<Type> result = Type::None(isolate);
+  Type* result = Type::None(zone);
   if (state_.Contains(CompareNilICStub::UNDEFINED)) {
-    result = Type::Union(result, Type::Undefined(isolate), isolate);
+    result = Type::Union(result, Type::Undefined(zone), zone);
   }
   if (state_.Contains(CompareNilICStub::NULL_TYPE)) {
-    result = Type::Union(result, Type::Null(isolate), isolate);
+    result = Type::Union(result, Type::Null(zone), zone);
   }
   if (state_.Contains(CompareNilICStub::MONOMORPHIC_MAP)) {
-    Handle<Type> type = map.is_null()
-        ? Type::Detectable(isolate) : Type::Class(map, isolate);
-    result = Type::Union(result, type, isolate);
+    Type* type =
+        map.is_null() ? Type::Detectable(zone) : Type::Class(map, zone);
+    result = Type::Union(result, type, zone);
   }
 
   return result;
 }
 
 
-Handle<Type> CompareNilICStub::GetInputType(
-    Isolate* isolate,
-    Handle<Map> map) {
-  Handle<Type> output_type = GetType(isolate, map);
-  Handle<Type> nil_type = nil_value_ == kNullValue
-      ? Type::Null(isolate) : Type::Undefined(isolate);
-  return Type::Union(output_type, nil_type, isolate);
+Type* CompareNilICStub::GetInputType(Zone* zone, Handle<Map> map) {
+  Type* output_type = GetType(zone, map);
+  Type* nil_type =
+      nil_value_ == kNullValue ? Type::Null(zone) : Type::Undefined(zone);
+  return Type::Union(output_type, nil_type, zone);
 }
 
 
index 9fa9e5dae920b9a1fdfcec158f57f49be905df3a..b08f982bf40abce9db6e14dd42a2e51727783c1a 100644 (file)
@@ -1368,8 +1368,8 @@ class ICCompareStub: public PlatformCodeStub {
 
 class CompareNilICStub : public HydrogenCodeStub  {
  public:
-  Handle<Type> GetType(Isolate* isolate, Handle<Map> map = Handle<Map>());
-  Handle<Type> GetInputType(Isolate* isolate, Handle<Map> map);
+  Type* GetType(Zone* zone, Handle<Map> map = Handle<Map>());
+  Type* GetInputType(Zone* zone, Handle<Map> map);
 
   explicit CompareNilICStub(NilValue nil) : nil_value_(nil) { }
 
index adb47b8fe46533deb2128d16c68ce1ca9f5c845a..13ce2218df41d972fda1c2b715fd3c8fcce9722f 100644 (file)
@@ -89,12 +89,12 @@ void CodeGenerator::MakeCodePrologue(CompilationInfo* info, const char* kind) {
 #ifdef DEBUG
   if (!info->IsStub() && print_source) {
     PrintF("--- Source from AST ---\n%s\n",
-           PrettyPrinter(info->isolate()).PrintProgram(info->function()));
+           PrettyPrinter(info->zone()).PrintProgram(info->function()));
   }
 
   if (!info->IsStub() && print_ast) {
     PrintF("--- AST ---\n%s\n",
-           AstPrinter(info->isolate()).PrintProgram(info->function()));
+           AstPrinter(info->zone()).PrintProgram(info->function()));
   }
 #endif  // DEBUG
 }
index afb8f9e54b393a3c42d660234b9ca6bb2fdec3e3..5d980f54ed80810fd138ed339856101b064b8558 100644 (file)
@@ -59,24 +59,24 @@ struct Effect {
   Effect(Bounds b, Modality m = DEFINITE) : modality(m), bounds(b) {}
 
   // The unknown effect.
-  static Effect Unknown(Isolate* isolate) {
-    return Effect(Bounds::Unbounded(isolate), POSSIBLE);
+  static Effect Unknown(Zone* zone) {
+    return Effect(Bounds::Unbounded(zone), POSSIBLE);
   }
 
-  static Effect Forget(Isolate* isolate) {
-    return Effect(Bounds::Unbounded(isolate), DEFINITE);
+  static Effect Forget(Zone* zone) {
+    return Effect(Bounds::Unbounded(zone), DEFINITE);
   }
 
   // Sequential composition, as in 'e1; e2'.
-  static Effect Seq(Effect e1, Effect e2, Isolate* isolate) {
+  static Effect Seq(Effect e1, Effect e2, Zone* zone) {
     if (e2.modality == DEFINITE) return e2;
-    return Effect(Bounds::Either(e1.bounds, e2.bounds, isolate), e1.modality);
+    return Effect(Bounds::Either(e1.bounds, e2.bounds, zone), e1.modality);
   }
 
   // Alternative composition, as in 'cond ? e1 : e2'.
-  static Effect Alt(Effect e1, Effect e2, Isolate* isolate) {
+  static Effect Alt(Effect e1, Effect e2, Zone* zone) {
     return Effect(
-        Bounds::Either(e1.bounds, e2.bounds, isolate),
+        Bounds::Either(e1.bounds, e2.bounds, zone),
         e1.modality == POSSIBLE ? POSSIBLE : e2.modality);
   }
 };
@@ -106,20 +106,20 @@ class EffectsMixin: public Base {
   Effect Lookup(Var var) {
     Locator locator;
     return this->Find(var, &locator)
-        ? locator.value() : Effect::Unknown(Base::isolate());
+        ? locator.value() : Effect::Unknown(Base::zone());
   }
 
   Bounds LookupBounds(Var var) {
     Effect effect = Lookup(var);
     return effect.modality == Effect::DEFINITE
-        ? effect.bounds : Bounds::Unbounded(Base::isolate());
+        ? effect.bounds : Bounds::Unbounded(Base::zone());
   }
 
   // Sequential composition.
   void Seq(Var var, Effect effect) {
     Locator locator;
     if (!this->Insert(var, &locator)) {
-      effect = Effect::Seq(locator.value(), effect, Base::isolate());
+      effect = Effect::Seq(locator.value(), effect, Base::zone());
     }
     locator.set_value(effect);
   }
@@ -133,7 +133,7 @@ class EffectsMixin: public Base {
   void Alt(Var var, Effect effect) {
     Locator locator;
     if (!this->Insert(var, &locator)) {
-      effect = Effect::Alt(locator.value(), effect, Base::isolate());
+      effect = Effect::Alt(locator.value(), effect, Base::zone());
     }
     locator.set_value(effect);
   }
@@ -148,7 +148,7 @@ class EffectsMixin: public Base {
   // Invalidation.
   void Forget() {
     Overrider override = {
-        Effect::Forget(Base::isolate()), Effects(Base::zone()) };
+        Effect::Forget(Base::zone()), Effects(Base::zone()) };
     this->ForEach(&override);
     Seq(override.effects);
   }
@@ -206,7 +206,6 @@ class EffectsBase {
       EffectsMixin<Var, NestedEffectsBase<Var, kNoVar>, Effects<Var, kNoVar> >;
 
   Zone* zone() { return map_->allocator().zone(); }
-  Isolate* isolate() { return zone()->isolate(); }
 
   struct SplayTreeConfig {
     typedef Var Key;
@@ -277,7 +276,6 @@ class NestedEffectsBase {
   typedef typename EffectsBase<Var, kNoVar>::Locator Locator;
 
   Zone* zone() { return node_->zone; }
-  Isolate* isolate() { return zone()->isolate(); }
 
   void push() { node_ = new(node_->zone) Node(node_->zone, node_); }
   void pop() { node_ = node_->previous; }
index ec25b232844916f8eb7b673895ac09b66e4f0e53..cbf013e0bc8dcf9be468b0e509baa26539202d34 100644 (file)
@@ -421,7 +421,7 @@ void FullCodeGenerator::Initialize() {
                          !Snapshot::HaveASnapshotToStartFrom();
   masm_->set_emit_debug_code(generate_debug_code_);
   masm_->set_predictable_code_size(true);
-  InitializeAstVisitor(info_->isolate());
+  InitializeAstVisitor(info_->zone());
 }
 
 
@@ -847,7 +847,7 @@ void FullCodeGenerator::SetStatementPosition(Statement* stmt) {
   } else {
     // Check if the statement will be breakable without adding a debug break
     // slot.
-    BreakableStatementChecker checker(isolate());
+    BreakableStatementChecker checker(zone());
     checker.Check(stmt);
     // Record the statement position right here if the statement is not
     // breakable. For breakable statements the actual recording of the
@@ -873,7 +873,7 @@ void FullCodeGenerator::SetExpressionPosition(Expression* expr) {
   } else {
     // Check if the expression will be breakable without adding a debug break
     // slot.
-    BreakableStatementChecker checker(isolate());
+    BreakableStatementChecker checker(zone());
     checker.Check(expr);
     // Record a statement position right here if the expression is not
     // breakable. For breakable expressions the actual recording of the
index 12f355abc5297669404f07f1b81cb93d2e53f695..5aa0a09fc9bd30af6ef7bf35c2eab36296c75499 100644 (file)
@@ -52,8 +52,8 @@ class JumpPatchSite;
 // debugger to piggybag on.
 class BreakableStatementChecker: public AstVisitor {
  public:
-  explicit BreakableStatementChecker(Isolate* isolate) : is_breakable_(false) {
-    InitializeAstVisitor(isolate);
+  explicit BreakableStatementChecker(Zone* zone) : is_breakable_(false) {
+    InitializeAstVisitor(zone);
   }
 
   void Check(Statement* stmt);
@@ -99,8 +99,7 @@ class FullCodeGenerator: public AstVisitor {
         type_feedback_cells_(info->HasDeoptimizationSupport()
                              ? info->function()->ast_node_count() : 0,
                              info->zone()),
-        ic_total_count_(0),
-        zone_(info->zone()) {
+        ic_total_count_(0) {
     Initialize();
   }
 
@@ -122,8 +121,6 @@ class FullCodeGenerator: public AstVisitor {
     return NULL;
   }
 
-  Zone* zone() const { return zone_; }
-
   static const int kMaxBackEdgeWeight = 127;
 
   // Platform-specific code size multiplier.
@@ -853,7 +850,6 @@ class FullCodeGenerator: public AstVisitor {
   Handle<FixedArray> handler_table_;
   Handle<Cell> profiling_counter_;
   bool generate_debug_code_;
-  Zone* zone_;
 
   friend class NestedStatement;
 
index ff0a7472324f0f1c8f9cec1e38e3667d9c80a7a5..8934acba5c0ce9ca74eb123e18108d4fac68ffc0 100644 (file)
@@ -2980,7 +2980,7 @@ MaybeObject* Heap::AllocatePropertyCell() {
   cell->set_dependent_code(DependentCode::cast(empty_fixed_array()),
                            SKIP_WRITE_BARRIER);
   cell->set_value(the_hole_value());
-  cell->set_type(Type::None());
+  cell->set_type(HeapType::None());
   return result;
 }
 
index b2635f5836a7bc5d1faade15ac684e87f0b47841..8980087309941c8c26c619fceb3bba86bd0792bf 100644 (file)
@@ -1557,8 +1557,7 @@ HValue* HGraphBuilder::BuildUncheckedDictionaryElementLoad(HValue* receiver,
 }
 
 
-HValue* HGraphBuilder::BuildNumberToString(HValue* object,
-                                           Handle<Type> type) {
+HValue* HGraphBuilder::BuildNumberToString(HValue* object, Type* type) {
   NoObservableSideEffectsScope scope(this);
 
   // Convert constant numbers at compile time.
@@ -2584,7 +2583,7 @@ HValue* HGraphBuilder::BuildCloneShallowArray(HValue* boilerplate,
 
 void HGraphBuilder::BuildCompareNil(
     HValue* value,
-    Handle<Type> type,
+    Type* type,
     HIfContinuation* continuation) {
   IfBuilder if_nil(this);
   bool some_case_handled = false;
@@ -2902,7 +2901,7 @@ HOptimizedGraphBuilder::HOptimizedGraphBuilder(CompilationInfo* info)
   // constructor for the initial state relies on function_state_ == NULL
   // to know it's the initial state.
   function_state_= &initial_function_state_;
-  InitializeAstVisitor(info->isolate());
+  InitializeAstVisitor(info->zone());
   if (FLAG_emit_opt_code_positions) {
     SetSourcePosition(info->shared_info()->start_position());
   }
@@ -4233,7 +4232,7 @@ void HOptimizedGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) {
   CHECK_ALIVE(VisitForValue(stmt->tag()));
   Add<HSimulate>(stmt->EntryId());
   HValue* tag_value = Top();
-  Handle<Type> tag_type = stmt->tag()->bounds().lower;
+  Type* tag_type = stmt->tag()->bounds().lower;
 
   // 1. Build all the tests, with dangling true branches
   BailoutId default_id = BailoutId::None();
@@ -4249,8 +4248,8 @@ void HOptimizedGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) {
     CHECK_ALIVE(VisitForValue(clause->label()));
     HValue* label_value = Pop();
 
-    Handle<Type> label_type = clause->label()->bounds().lower;
-    Handle<Type> combined_type = clause->compare_type();
+    Type* label_type = clause->label()->bounds().lower;
+    Type* combined_type = clause->compare_type();
     HControlInstruction* compare = BuildCompareInstruction(
         Token::EQ_STRICT, tag_value, label_value, tag_type, label_type,
         combined_type, stmt->tag()->position(), clause->label()->position(),
@@ -8590,8 +8589,7 @@ HInstruction* HOptimizedGraphBuilder::BuildIncrement(
     bool returns_original_input,
     CountOperation* expr) {
   // The input to the count operation is on top of the expression stack.
-  Handle<Type> info = expr->type();
-  Representation rep = Representation::FromType(info);
+  Representation rep = Representation::FromType(expr->type());
   if (rep.IsNone() || rep.IsTagged()) {
     rep = Representation::Smi();
   }
@@ -8842,7 +8840,7 @@ bool CanBeZero(HValue* right) {
 
 
 HValue* HGraphBuilder::EnforceNumberType(HValue* number,
-                                         Handle<Type> expected) {
+                                         Type* expected) {
   if (expected->Is(Type::Smi())) {
     return AddUncasted<HForceRepresentation>(number, Representation::Smi());
   }
@@ -8854,12 +8852,12 @@ HValue* HGraphBuilder::EnforceNumberType(HValue* number,
 }
 
 
-HValue* HGraphBuilder::TruncateToNumber(HValue* value, Handle<Type>* expected) {
+HValue* HGraphBuilder::TruncateToNumber(HValue* value, Type** expected) {
   if (value->IsConstant()) {
     HConstant* constant = HConstant::cast(value);
     Maybe<HConstant*> number = constant->CopyToTruncatedNumber(zone());
     if (number.has_value) {
-      *expected = Type::Number(isolate());
+      *expected = Type::Number(zone());
       return AddInstruction(number.value);
     }
   }
@@ -8869,25 +8867,24 @@ HValue* HGraphBuilder::TruncateToNumber(HValue* value, Handle<Type>* expected) {
   // pushes with a NoObservableSideEffectsScope.
   NoObservableSideEffectsScope no_effects(this);
 
-  Handle<Type> expected_type = *expected;
+  Type* expected_type = *expected;
 
   // Separate the number type from the rest.
-  Handle<Type> expected_obj = Type::Intersect(
-      expected_type, Type::NonNumber(isolate()), isolate());
-  Handle<Type> expected_number = Type::Intersect(
-      expected_type, Type::Number(isolate()), isolate());
+  Type* expected_obj =
+      Type::Intersect(expected_type, Type::NonNumber(zone()), zone());
+  Type* expected_number =
+      Type::Intersect(expected_type, Type::Number(zone()), zone());
 
   // We expect to get a number.
   // (We need to check first, since Type::None->Is(Type::Any()) == true.
   if (expected_obj->Is(Type::None())) {
-    ASSERT(!expected_number->Is(Type::None()));
+    ASSERT(!expected_number->Is(Type::None(zone())));
     return value;
   }
 
-  if (expected_obj->Is(Type::Undefined())) {
+  if (expected_obj->Is(Type::Undefined(zone()))) {
     // This is already done by HChange.
-    *expected = Type::Union(
-          expected_number, Type::Double(isolate()), isolate());
+    *expected = Type::Union(expected_number, Type::Double(zone()), zone());
     return value;
   }
 
@@ -8899,9 +8896,9 @@ HValue* HOptimizedGraphBuilder::BuildBinaryOperation(
     BinaryOperation* expr,
     HValue* left,
     HValue* right) {
-  Handle<Type> left_type = expr->left()->bounds().lower;
-  Handle<Type> right_type = expr->right()->bounds().lower;
-  Handle<Type> result_type = expr->bounds().lower;
+  Type* left_type = expr->left()->bounds().lower;
+  Type* right_type = expr->right()->bounds().lower;
+  Type* result_type = expr->bounds().lower;
   Maybe<int> fixed_right_arg = expr->fixed_right_arg();
   Handle<AllocationSite> allocation_site = expr->allocation_site();
 
@@ -8931,9 +8928,9 @@ HValue* HGraphBuilder::BuildBinaryOperation(
     Token::Value op,
     HValue* left,
     HValue* right,
-    Handle<Type> left_type,
-    Handle<Type> right_type,
-    Handle<Type> result_type,
+    Type* left_type,
+    Type* right_type,
+    Type* result_type,
     Maybe<int> fixed_right_arg,
     HAllocationMode allocation_mode) {
 
@@ -8949,7 +8946,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
                      Deoptimizer::SOFT);
     // TODO(rossberg): we should be able to get rid of non-continuous
     // defaults.
-    left_type = Type::Any(isolate());
+    left_type = Type::Any(zone());
   } else {
     if (!maybe_string_add) left = TruncateToNumber(left, &left_type);
     left_rep = Representation::FromType(left_type);
@@ -8958,7 +8955,7 @@ HValue* HGraphBuilder::BuildBinaryOperation(
   if (right_type->Is(Type::None())) {
     Add<HDeoptimize>("Insufficient type feedback for RHS of binary operation",
                      Deoptimizer::SOFT);
-    right_type = Type::Any(isolate());
+    right_type = Type::Any(zone());
   } else {
     if (!maybe_string_add) right = TruncateToNumber(right, &right_type);
     right_rep = Representation::FromType(right_type);
@@ -9366,9 +9363,9 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
     return ast_context()->ReturnControl(instr, expr->id());
   }
 
-  Handle<Type> left_type = expr->left()->bounds().lower;
-  Handle<Type> right_type = expr->right()->bounds().lower;
-  Handle<Type> combined_type = expr->combined_type();
+  Type* left_type = expr->left()->bounds().lower;
+  Type* right_type = expr->right()->bounds().lower;
+  Type* combined_type = expr->combined_type();
 
   CHECK_ALIVE(VisitForValue(expr->left()));
   CHECK_ALIVE(VisitForValue(expr->right()));
@@ -9445,9 +9442,9 @@ HControlInstruction* HOptimizedGraphBuilder::BuildCompareInstruction(
     Token::Value op,
     HValue* left,
     HValue* right,
-    Handle<Type> left_type,
-    Handle<Type> right_type,
-    Handle<Type> combined_type,
+    Type* left_type,
+    Type* right_type,
+    Type* combined_type,
     int left_position,
     int right_position,
     BailoutId bailout_id) {
@@ -9457,7 +9454,7 @@ HControlInstruction* HOptimizedGraphBuilder::BuildCompareInstruction(
     Add<HDeoptimize>("Insufficient type feedback for combined type "
                      "of binary operation",
                      Deoptimizer::SOFT);
-    combined_type = left_type = right_type = Type::Any(isolate());
+    combined_type = left_type = right_type = Type::Any(zone());
   }
 
   Representation left_rep = Representation::FromType(left_type);
@@ -9553,8 +9550,8 @@ void HOptimizedGraphBuilder::HandleLiteralCompareNil(CompareOperation* expr,
     return ast_context()->ReturnControl(instr, expr->id());
   } else {
     ASSERT_EQ(Token::EQ, expr->op());
-    Handle<Type> type = expr->combined_type()->Is(Type::None())
-        ? Type::Any(isolate_) : expr->combined_type();
+    Type* type = expr->combined_type()->Is(Type::None())
+        ? Type::Any(zone()) : expr->combined_type();
     HIfContinuation continuation;
     BuildCompareNil(value, type, &continuation);
     return ast_context()->ReturnContinuation(&continuation, expr->id());
@@ -10324,7 +10321,7 @@ void HOptimizedGraphBuilder::GenerateNumberToString(CallRuntime* call) {
   ASSERT_EQ(1, call->arguments()->length());
   CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
   HValue* number = Pop();
-  HValue* result = BuildNumberToString(number, Type::Any(isolate()));
+  HValue* result = BuildNumberToString(number, Type::Any(zone()));
   return ast_context()->ReturnValue(result);
 }
 
index 643074c3df878fe431d224f551c9202fa9461eb3..d7579c46450e9ca5137ff2a947869409beea7e65 100644 (file)
@@ -1306,7 +1306,7 @@ class HGraphBuilder {
                                    ElementsKind to_kind,
                                    bool is_jsarray);
 
-  HValue* BuildNumberToString(HValue* object, Handle<Type> type);
+  HValue* BuildNumberToString(HValue* object, Type* type);
 
   HValue* BuildUncheckedDictionaryElementLoad(HValue* receiver,
                                               HValue* key);
@@ -1386,9 +1386,9 @@ class HGraphBuilder {
   HValue* BuildBinaryOperation(Token::Value op,
                                HValue* left,
                                HValue* right,
-                               Handle<Type> left_type,
-                               Handle<Type> right_type,
-                               Handle<Type> result_type,
+                               Type* left_type,
+                               Type* right_type,
+                               Type* result_type,
                                Maybe<int> fixed_right_arg,
                                HAllocationMode allocation_mode);
 
@@ -1396,8 +1396,8 @@ class HGraphBuilder {
 
   HValue* AddLoadJSBuiltin(Builtins::JavaScript builtin);
 
-  HValue* EnforceNumberType(HValue* number, Handle<Type> expected);
-  HValue* TruncateToNumber(HValue* value, Handle<Type>* expected);
+  HValue* EnforceNumberType(HValue* number, Type* expected);
+  HValue* TruncateToNumber(HValue* value, Type** expected);
 
   void FinishExitWithHardDeoptimization(const char* reason,
                                         HBasicBlock* continuation);
@@ -1753,7 +1753,7 @@ class HGraphBuilder {
 
   void BuildCompareNil(
       HValue* value,
-      Handle<Type> type,
+      Type* type,
       HIfContinuation* continuation);
 
   void BuildCreateAllocationMemento(HValue* previous_object,
@@ -2368,9 +2368,9 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
   HControlInstruction* BuildCompareInstruction(Token::Value op,
                                                HValue* left,
                                                HValue* right,
-                                               Handle<Type> left_type,
-                                               Handle<Type> right_type,
-                                               Handle<Type> combined_type,
+                                               Type* left_type,
+                                               Type* right_type,
+                                               Type* combined_type,
                                                int left_position,
                                                int right_position,
                                                BailoutId bailout_id);
index c64035c8c9ebe60e42aca84dd6c04a3ada346631..e76bfb5f3bf87569557897cad25d486e29818070 100644 (file)
@@ -1143,7 +1143,7 @@ void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) {
 #define __ ACCESS_MASM(masm())
 
 
-Register StubCompiler::CheckPrototypes(Handle<Type> type,
+Register StubCompiler::CheckPrototypes(Handle<HeapType> type,
                                        Register object_reg,
                                        Handle<JSObject> holder,
                                        Register holder_reg,
@@ -1281,7 +1281,7 @@ void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) {
 
 
 Register LoadStubCompiler::CallbackHandlerFrontend(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Register object_reg,
     Handle<JSObject> holder,
     Handle<Name> name,
@@ -1978,7 +1978,7 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic(
 }
 
 
-Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<Type> type,
+Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<HeapType> type,
                                                       Handle<JSObject> last,
                                                       Handle<Name> name) {
   NonexistentHandlerFrontend(type, last, name);
@@ -2056,7 +2056,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
 
 
 Handle<Code> LoadStubCompiler::CompileLoadGlobal(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Handle<GlobalObject> global,
     Handle<PropertyCell> cell,
     Handle<Name> name,
@@ -2116,12 +2116,12 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
   int receiver_count = types->length();
   int number_of_handled_maps = 0;
   for (int current = 0; current < receiver_count; ++current) {
-    Handle<Type> type = types->at(current);
+    Handle<HeapType> type = types->at(current);
     Handle<Map> map = IC::TypeToMap(*type, isolate());
     if (!map->is_deprecated()) {
       number_of_handled_maps++;
       __ cmp(map_reg, map);
-      if (type->Is(Type::Number())) {
+      if (type->Is(HeapType::Number())) {
         ASSERT(!number_case.is_unused());
         __ bind(&number_case);
       }
index 24a939dedbf2a8d5ec3a96204d1d7d3729cc50f7..e0f807ce4bfa4651cdfcab38a706f498450eb42b 100644 (file)
@@ -111,8 +111,8 @@ InlineCacheHolderFlag IC::GetCodeCacheForObject(Object* object) {
 
 
 HeapObject* IC::GetCodeCacheHolder(Isolate* isolate,
-                                 Object* object,
-                                 InlineCacheHolderFlag holder) {
+                                   Object* object,
+                                   InlineCacheHolderFlag holder) {
   if (object->IsSmi()) holder = PROTOTYPE_MAP;
   Object* map_owner = holder == OWN_MAP
       ? object : object->GetPrototype(isolate);
@@ -120,11 +120,11 @@ HeapObject* IC::GetCodeCacheHolder(Isolate* isolate,
 }
 
 
-InlineCacheHolderFlag IC::GetCodeCacheFlag(Type* type) {
-  if (type->Is(Type::Boolean()) ||
-      type->Is(Type::Number()) ||
-      type->Is(Type::String()) ||
-      type->Is(Type::Symbol())) {
+InlineCacheHolderFlag IC::GetCodeCacheFlag(HeapType* type) {
+  if (type->Is(HeapType::Boolean()) ||
+      type->Is(HeapType::Number()) ||
+      type->Is(HeapType::String()) ||
+      type->Is(HeapType::Symbol())) {
     return PROTOTYPE_MAP;
   }
   return OWN_MAP;
@@ -132,19 +132,19 @@ InlineCacheHolderFlag IC::GetCodeCacheFlag(Type* type) {
 
 
 Handle<Map> IC::GetCodeCacheHolder(InlineCacheHolderFlag flag,
-                                   Type* type,
+                                   HeapType* type,
                                    Isolate* isolate) {
   if (flag == PROTOTYPE_MAP) {
     Context* context = isolate->context()->native_context();
     JSFunction* constructor;
-    if (type->Is(Type::Boolean())) {
+    if (type->Is(HeapType::Boolean())) {
       constructor = context->boolean_function();
-    } else if (type->Is(Type::Number())) {
+    } else if (type->Is(HeapType::Number())) {
       constructor = context->number_function();
-    } else if (type->Is(Type::String())) {
+    } else if (type->Is(HeapType::String())) {
       constructor = context->string_function();
     } else {
-      ASSERT(type->Is(Type::Symbol()));
+      ASSERT(type->Is(HeapType::Symbol()));
       constructor = context->symbol_function();
     }
     return handle(JSObject::cast(constructor->instance_prototype())->map());
index 20a714d0929897672749d7b3a988f644bba57d61..b46575794486e9dbc29b75a2eb2d25964b1dba8b 100644 (file)
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -898,7 +898,7 @@ static bool AddOneReceiverMapIfMissing(MapHandleList* receiver_maps,
 }
 
 
-bool IC::UpdatePolymorphicIC(Handle<Type> type,
+bool IC::UpdatePolymorphicIC(Handle<HeapType> type,
                              Handle<String> name,
                              Handle<Code> code) {
   if (!code->is_handler()) return false;
@@ -913,7 +913,7 @@ bool IC::UpdatePolymorphicIC(Handle<Type> type,
   number_of_valid_types = number_of_types;
 
   for (int i = 0; i < number_of_types; i++) {
-    Handle<Type> current_type = types.at(i);
+    Handle<HeapType> current_type = types.at(i);
     // Filter out deprecated maps to ensure their instances get migrated.
     if (current_type->IsClass() && current_type->AsClass()->is_deprecated()) {
       number_of_valid_types--;
@@ -946,16 +946,17 @@ bool IC::UpdatePolymorphicIC(Handle<Type> type,
 }
 
 
-Handle<Type> IC::CurrentTypeOf(Handle<Object> object, Isolate* isolate) {
+Handle<HeapType> IC::CurrentTypeOf(Handle<Object> object, Isolate* isolate) {
   return object->IsJSGlobalObject()
-      ? Type::Constant(Handle<JSGlobalObject>::cast(object), isolate)
-      : Type::OfCurrently(object, isolate);
+      ? HeapType::Constant(Handle<JSGlobalObject>::cast(object), isolate)
+      : HeapType::OfCurrently(object, isolate);
 }
 
 
-Handle<Map> IC::TypeToMap(Type* type, Isolate* isolate) {
-  if (type->Is(Type::Number())) return isolate->factory()->heap_number_map();
-  if (type->Is(Type::Boolean())) return isolate->factory()->oddball_map();
+Handle<Map> IC::TypeToMap(HeapType* type, Isolate* isolate) {
+  if (type->Is(HeapType::Number()))
+    return isolate->factory()->heap_number_map();
+  if (type->Is(HeapType::Boolean())) return isolate->factory()->oddball_map();
   if (type->IsConstant()) {
     return handle(Handle<JSGlobalObject>::cast(type->AsConstant())->map());
   }
@@ -964,16 +965,20 @@ Handle<Map> IC::TypeToMap(Type* type, Isolate* isolate) {
 }
 
 
-Handle<Type> IC::MapToType(Handle<Map> map) {
+Handle<HeapType> IC::MapToType(Handle<Map> map) {
   Isolate* isolate = map->GetIsolate();
-  if (map->instance_type() == HEAP_NUMBER_TYPE) return Type::Number(isolate);
-  // The only oddballs that can be recorded in ICs are booleans.
-  if (map->instance_type() == ODDBALL_TYPE) return Type::Boolean(isolate);
-  return Type::Class(map, isolate);
+  if (map->instance_type() == HEAP_NUMBER_TYPE) {
+    return HeapType::Number(isolate);
+  } else if (map->instance_type() == ODDBALL_TYPE) {
+    // The only oddballs that can be recorded in ICs are booleans.
+    return HeapType::Boolean(isolate);
+  } else {
+    return HeapType::Class(map, isolate);
+  }
 }
 
 
-void IC::UpdateMonomorphicIC(Handle<Type> type,
+void IC::UpdateMonomorphicIC(Handle<HeapType> type,
                              Handle<Code> handler,
                              Handle<String> name) {
   if (!handler->is_handler()) return set_target(*handler);
@@ -994,7 +999,7 @@ void IC::CopyICToMegamorphicCache(Handle<String> name) {
 }
 
 
-bool IC::IsTransitionOfMonomorphicTarget(Handle<Type> type) {
+bool IC::IsTransitionOfMonomorphicTarget(Handle<HeapType> type) {
   if (!type->IsClass()) return false;
   Map* receiver_map = *type->AsClass();
   Map* current_map = target()->FindFirstMap();
@@ -1010,7 +1015,7 @@ bool IC::IsTransitionOfMonomorphicTarget(Handle<Type> type) {
 }
 
 
-void IC::PatchCache(Handle<Type> type,
+void IC::PatchCache(Handle<HeapType> type,
                     Handle<String> name,
                     Handle<Code> code) {
   switch (state()) {
@@ -1096,7 +1101,7 @@ void LoadIC::UpdateCaches(LookupResult* lookup,
     return;
   }
 
-  Handle<Type> type = CurrentTypeOf(object, isolate());
+  Handle<HeapType> type = CurrentTypeOf(object, isolate());
   Handle<Code> code;
   if (!lookup->IsCacheable()) {
     // Bail out if the result is not cacheable.
@@ -1116,7 +1121,7 @@ void LoadIC::UpdateCaches(LookupResult* lookup,
 }
 
 
-void IC::UpdateMegamorphicCache(Type* type, Name* name, Code* code) {
+void IC::UpdateMegamorphicCache(HeapType* type, Name* name, Code* code) {
   // Cache code holding map should be consistent with
   // GenerateMonomorphicCacheProbe.
   Map* map = *TypeToMap(type, isolate());
@@ -1157,7 +1162,7 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup,
     return SimpleFieldLoad(length_index);
   }
 
-  Handle<Type> type = CurrentTypeOf(object, isolate());
+  Handle<HeapType> type = CurrentTypeOf(object, isolate());
   Handle<JSObject> holder(lookup->holder());
   LoadStubCompiler compiler(isolate(), kNoExtraICState, cache_holder, kind());
 
@@ -1629,7 +1634,7 @@ Handle<Code> StoreIC::CompileHandler(LookupResult* lookup,
         // global object.
         Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver);
         Handle<PropertyCell> cell(global->GetPropertyCell(lookup), isolate());
-        Handle<Type> union_type = PropertyCell::UpdatedType(cell, value);
+        Handle<HeapType> union_type = PropertyCell::UpdatedType(cell, value);
         StoreGlobalStub stub(union_type->IsConstant());
 
         Handle<Code> code = stub.GetCodeCopyFromTemplate(
@@ -2563,17 +2568,17 @@ void BinaryOpIC::State::GenerateAheadOfTime(
 }
 
 
-Handle<Type> BinaryOpIC::State::GetResultType(Isolate* isolate) const {
+Type* BinaryOpIC::State::GetResultType(Zone* zone) const {
   Kind result_kind = result_kind_;
   if (HasSideEffects()) {
     result_kind = NONE;
   } else if (result_kind == GENERIC && op_ == Token::ADD) {
-    return Type::Union(Type::Number(isolate), Type::String(isolate), isolate);
+    return Type::Union(Type::Number(zone), Type::String(zone), zone);
   } else if (result_kind == NUMBER && op_ == Token::SHR) {
-    return Type::Unsigned32(isolate);
+    return Type::Unsigned32(zone);
   }
   ASSERT_NE(GENERIC, result_kind);
-  return KindToType(result_kind, isolate);
+  return KindToType(result_kind, zone);
 }
 
 
@@ -2704,17 +2709,17 @@ const char* BinaryOpIC::State::KindToString(Kind kind) {
 
 
 // static
-Handle<Type> BinaryOpIC::State::KindToType(Kind kind, Isolate* isolate) {
+Type* BinaryOpIC::State::KindToType(Kind kind, Zone* zone) {
   switch (kind) {
-    case NONE: return Type::None(isolate);
-    case SMI: return Type::Smi(isolate);
-    case INT32: return Type::Signed32(isolate);
-    case NUMBER: return Type::Number(isolate);
-    case STRING: return Type::String(isolate);
-    case GENERIC: return Type::Any(isolate);
+    case NONE: return Type::None(zone);
+    case SMI: return Type::Smi(zone);
+    case INT32: return Type::Signed32(zone);
+    case NUMBER: return Type::Number(zone);
+    case STRING: return Type::String(zone);
+    case GENERIC: return Type::Any(zone);
   }
   UNREACHABLE();
-  return Handle<Type>();
+  return NULL;
 }
 
 
@@ -2844,41 +2849,39 @@ const char* CompareIC::GetStateName(State state) {
 }
 
 
-Handle<Type> CompareIC::StateToType(
-    Isolate* isolate,
+Type* CompareIC::StateToType(
+    Zone* zone,
     CompareIC::State state,
     Handle<Map> map) {
   switch (state) {
-    case CompareIC::UNINITIALIZED: return Type::None(isolate);
-    case CompareIC::SMI: return Type::Smi(isolate);
-    case CompareIC::NUMBER: return Type::Number(isolate);
-    case CompareIC::STRING: return Type::String(isolate);
-    case CompareIC::INTERNALIZED_STRING:
-      return Type::InternalizedString(isolate);
-    case CompareIC::UNIQUE_NAME: return Type::UniqueName(isolate);
-    case CompareIC::OBJECT: return Type::Receiver(isolate);
+    case CompareIC::UNINITIALIZED: return Type::None(zone);
+    case CompareIC::SMI: return Type::Smi(zone);
+    case CompareIC::NUMBER: return Type::Number(zone);
+    case CompareIC::STRING: return Type::String(zone);
+    case CompareIC::INTERNALIZED_STRING: return Type::InternalizedString(zone);
+    case CompareIC::UNIQUE_NAME: return Type::UniqueName(zone);
+    case CompareIC::OBJECT: return Type::Receiver(zone);
     case CompareIC::KNOWN_OBJECT:
-      return map.is_null()
-          ? Type::Receiver(isolate) : Type::Class(map, isolate);
-    case CompareIC::GENERIC: return Type::Any(isolate);
+      return map.is_null() ? Type::Receiver(zone) : Type::Class(map, zone);
+    case CompareIC::GENERIC: return Type::Any(zone);
   }
   UNREACHABLE();
-  return Handle<Type>();
+  return NULL;
 }
 
 
 void CompareIC::StubInfoToType(int stub_minor_key,
-                               Handle<Type>* left_type,
-                               Handle<Type>* right_type,
-                               Handle<Type>* overall_type,
+                               Type** left_type,
+                               Type** right_type,
+                               Type** overall_type,
                                Handle<Map> map,
-                               Isolate* isolate) {
+                               Zone* zone) {
   State left_state, right_state, handler_state;
   ICCompareStub::DecodeMinorKey(stub_minor_key, &left_state, &right_state,
                                 &handler_state, NULL);
-  *left_type = StateToType(isolate, left_state);
-  *right_type = StateToType(isolate, right_state);
-  *overall_type = StateToType(isolate, handler_state, map);
+  *left_type = StateToType(zone, left_state);
+  *right_type = StateToType(zone, right_state);
+  *overall_type = StateToType(zone, handler_state, map);
 }
 
 
index a253017dfd0366289c440cb8fed9c1415dc5cfb0..64098ea0353f51a6abcf1adfe716aafcb068ead4 100644 (file)
--- a/src/ic.h
+++ b/src/ic.h
@@ -130,9 +130,9 @@ class IC {
                                                Object* object,
                                                InlineCacheHolderFlag holder);
 
-  static inline InlineCacheHolderFlag GetCodeCacheFlag(Type* type);
+  static inline InlineCacheHolderFlag GetCodeCacheFlag(HeapType* type);
   static inline Handle<Map> GetCodeCacheHolder(InlineCacheHolderFlag flag,
-                                               Type* type,
+                                               HeapType* type,
                                                Isolate* isolate);
 
   static bool IsCleared(Code* code) {
@@ -145,9 +145,10 @@ class IC {
   // - The heap_number_map is used as a marker which includes heap numbers as
   //   well as smis.
   // - The oddball map is only used for booleans.
-  static Handle<Map> TypeToMap(Type* type, Isolate* isolate);
-  static Handle<Type> MapToType(Handle<Map> type);
-  static Handle<Type> CurrentTypeOf(Handle<Object> object, Isolate* isolate);
+  static Handle<Map> TypeToMap(HeapType* type, Isolate* isolate);
+  static Handle<HeapType> MapToType(Handle<Map> map);
+  static Handle<HeapType> CurrentTypeOf(
+      Handle<Object> object, Isolate* isolate);
 
  protected:
   // Get the call-site target; used for determining the state.
@@ -201,19 +202,19 @@ class IC {
     return Handle<Code>::null();
   }
 
-  void UpdateMonomorphicIC(Handle<Type> type,
+  void UpdateMonomorphicIC(Handle<HeapType> type,
                            Handle<Code> handler,
                            Handle<String> name);
 
-  bool UpdatePolymorphicIC(Handle<Type> type,
+  bool UpdatePolymorphicIC(Handle<HeapType> type,
                            Handle<String> name,
                            Handle<Code> code);
 
-  virtual void UpdateMegamorphicCache(Type* type, Name* name, Code* code);
+  virtual void UpdateMegamorphicCache(HeapType* type, Name* name, Code* code);
 
   void CopyICToMegamorphicCache(Handle<String> name);
-  bool IsTransitionOfMonomorphicTarget(Handle<Type> type);
-  void PatchCache(Handle<Type> type,
+  bool IsTransitionOfMonomorphicTarget(Handle<HeapType> type);
+  void PatchCache(Handle<HeapType> type,
                   Handle<String> name,
                   Handle<Code> code);
   virtual Code::Kind kind() const {
@@ -536,7 +537,7 @@ class KeyedLoadIC: public LoadIC {
     return isolate()->builtins()->KeyedLoadIC_Slow();
   }
 
-  virtual void UpdateMegamorphicCache(Type* type, Name* name, Code* code) { }
+  virtual void UpdateMegamorphicCache(HeapType* type, Name* name, Code* code) {}
 
  private:
   // Stub accessors.
@@ -708,7 +709,7 @@ class KeyedStoreIC: public StoreIC {
  protected:
   virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; }
 
-  virtual void UpdateMegamorphicCache(Type* type, Name* name, Code* code) { }
+  virtual void UpdateMegamorphicCache(HeapType* type, Name* name, Code* code) {}
 
   virtual Handle<Code> pre_monomorphic_stub() {
     return pre_monomorphic_stub(isolate(), strict_mode());
@@ -843,13 +844,13 @@ class BinaryOpIC: public IC {
     OverwriteMode mode() const { return mode_; }
     Maybe<int> fixed_right_arg() const { return fixed_right_arg_; }
 
-    Handle<Type> GetLeftType(Isolate* isolate) const {
-      return KindToType(left_kind_, isolate);
+    Type* GetLeftType(Zone* zone) const {
+      return KindToType(left_kind_, zone);
     }
-    Handle<Type> GetRightType(Isolate* isolate) const {
-      return KindToType(right_kind_, isolate);
+    Type* GetRightType(Zone* zone) const {
+      return KindToType(right_kind_, zone);
     }
-    Handle<Type> GetResultType(Isolate* isolate) const;
+    Type* GetResultType(Zone* zone) const;
 
     void Print(StringStream* stream) const;
 
@@ -863,7 +864,7 @@ class BinaryOpIC: public IC {
     Kind UpdateKind(Handle<Object> object, Kind kind) const;
 
     static const char* KindToString(Kind kind);
-    static Handle<Type> KindToType(Kind kind, Isolate* isolate);
+    static Type* KindToType(Kind kind, Zone* zone);
     static bool KindMaybeSmi(Kind kind) {
       return (kind >= SMI && kind <= NUMBER) || kind == GENERIC;
     }
@@ -921,16 +922,16 @@ class CompareIC: public IC {
 
   static State NewInputState(State old_state, Handle<Object> value);
 
-  static Handle<Type> StateToType(Isolate* isolate,
-                                  State state,
-                                  Handle<Map> map = Handle<Map>());
+  static Type* StateToType(Zone* zone,
+                           State state,
+                           Handle<Map> map = Handle<Map>());
 
   static void StubInfoToType(int stub_minor_key,
-                             Handle<Type>* left_type,
-                             Handle<Type>* right_type,
-                             Handle<Type>* overall_type,
+                             Type** left_type,
+                             Type** right_type,
+                             Type** overall_type,
                              Handle<Map> map,
-                             Isolate* isolate);
+                             Zone* zone);
 
   CompareIC(Isolate* isolate, Token::Value op)
       : IC(EXTRA_CALL_FRAME, isolate), op_(op) { }
index e498ae162aaa3f6526f23f26e31496023cb59723..65645c9a53cee473d183d8f40efc9fc9bfcbbc21 100644 (file)
@@ -206,13 +206,13 @@ size_t GetMemoryUsedByList(const List<T, P>& list) {
 class Map;
 template<class> class TypeImpl;
 struct HeapTypeConfig;
-typedef TypeImpl<HeapTypeConfig> Type;
+typedef TypeImpl<HeapTypeConfig> HeapType;
 class Code;
 template<typename T> class Handle;
 typedef List<Map*> MapList;
 typedef List<Code*> CodeList;
 typedef List<Handle<Map> > MapHandleList;
-typedef List<Handle<Type> > TypeHandleList;
+typedef List<Handle<HeapType> > TypeHandleList;
 typedef List<Handle<Code> > CodeHandleList;
 
 // Perform binary search for an element in an already sorted
index 636113d439e3f21288435e1dae6df74b27bab3b1..6007558cb33111a54d2e7bf6d8cf5f16cd81d8b8 100644 (file)
@@ -16541,25 +16541,25 @@ void JSTypedArray::Neuter() {
 }
 
 
-Type* PropertyCell::type() {
-  return static_cast<Type*>(type_raw());
+HeapType* PropertyCell::type() {
+  return static_cast<HeapType*>(type_raw());
 }
 
 
-void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) {
+void PropertyCell::set_type(HeapType* type, WriteBarrierMode ignored) {
   ASSERT(IsPropertyCell());
   set_type_raw(type, ignored);
 }
 
 
-Handle<Type> PropertyCell::UpdatedType(Handle<PropertyCell> cell,
-                                       Handle<Object> value) {
+Handle<HeapType> PropertyCell::UpdatedType(Handle<PropertyCell> cell,
+                                           Handle<Object> value) {
   Isolate* isolate = cell->GetIsolate();
-  Handle<Type> old_type(cell->type(), isolate);
+  Handle<HeapType> old_type(cell->type(), isolate);
   // TODO(2803): Do not track ConsString as constant because they cannot be
   // embedded into code.
-  Handle<Type> new_type = value->IsConsString() || value->IsTheHole()
-      ? Type::Any(isolate) : Type::Constant(value, isolate);
+  Handle<HeapType> new_type = value->IsConsString() || value->IsTheHole()
+      ? HeapType::Any(isolate) : HeapType::Constant(value, isolate);
 
   if (new_type->Is(old_type)) {
     return old_type;
@@ -16568,19 +16568,19 @@ Handle<Type> PropertyCell::UpdatedType(Handle<PropertyCell> cell,
   cell->dependent_code()->DeoptimizeDependentCodeGroup(
       isolate, DependentCode::kPropertyCellChangedGroup);
 
-  if (old_type->Is(Type::None()) || old_type->Is(Type::Undefined())) {
+  if (old_type->Is(HeapType::None()) || old_type->Is(HeapType::Undefined())) {
     return new_type;
   }
 
-  return Type::Any(isolate);
+  return HeapType::Any(isolate);
 }
 
 
 void PropertyCell::SetValueInferType(Handle<PropertyCell> cell,
                                      Handle<Object> value) {
   cell->set_value(*value);
-  if (!Type::Any()->Is(cell->type())) {
-    Handle<Type> new_type = UpdatedType(cell, value);
+  if (!HeapType::Any()->Is(cell->type())) {
+    Handle<HeapType> new_type = UpdatedType(cell, value);
     cell->set_type(*new_type);
   }
 }
index ac00904c465351842592fa0516dfb5d88bf27b99..874c48653f3689c4b334aa6f69d304805eb38787 100644 (file)
@@ -906,10 +906,10 @@ class FixedArrayBase;
 class GlobalObject;
 class ObjectVisitor;
 class StringStream;
-// We cannot just say "class Type;" if it is created from a template... =8-?
+// We cannot just say "class HeapType;" if it is created from a template... =8-?
 template<class> class TypeImpl;
 struct HeapTypeConfig;
-typedef TypeImpl<HeapTypeConfig> Type;
+typedef TypeImpl<HeapTypeConfig> HeapType;
 
 
 // A template-ized version of the IsXXX functions.
@@ -9512,8 +9512,8 @@ class Cell: public HeapObject {
 class PropertyCell: public Cell {
  public:
   // [type]: type of the global property.
-  Type* type();
-  void set_type(Type* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
+  HeapType* type();
+  void set_type(HeapType* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
 
   // [dependent_code]: dependent code that depends on the type of the global
   // property.
@@ -9528,8 +9528,8 @@ class PropertyCell: public Cell {
 
   // Computes the new type of the cell's contents for the given value, but
   // without actually modifying the 'type' field.
-  static Handle<Type> UpdatedType(Handle<PropertyCell> cell,
-                                  Handle<Object> value);
+  static Handle<HeapType> UpdatedType(Handle<PropertyCell> cell,
+                                      Handle<Object> value);
 
   void AddDependentCompilationInfo(CompilationInfo* info);
 
index bfb5bd1955caedbf9a79647c904c24e4ae1ab761..d525252001bcb14748446510ef0689f96c7fefaa 100644 (file)
@@ -485,9 +485,7 @@ class Parser::BlockState BASE_EMBEDDED {
 };
 
 
-Parser::FunctionState::FunctionState(Parser* parser,
-                                     Scope* scope,
-                                     Isolate* isolate)
+Parser::FunctionState::FunctionState(Parser* parser, Scope* scope)
     : next_materialized_literal_index_(JSFunction::kLiteralsPrefixSize),
       next_handler_index_(0),
       expected_property_count_(0),
@@ -495,11 +493,11 @@ Parser::FunctionState::FunctionState(Parser* parser,
       parser_(parser),
       outer_function_state_(parser->current_function_state_),
       outer_scope_(parser->top_scope_),
-      saved_ast_node_id_(isolate->ast_node_id()),
-      factory_(isolate, parser->zone()) {
+      saved_ast_node_id_(parser->zone()->isolate()->ast_node_id()),
+      factory_(parser->zone()) {
   parser->top_scope_ = scope;
   parser->current_function_state_ = this;
-  isolate->set_ast_node_id(BailoutId::FirstUsable().ToInt());
+  parser->zone()->isolate()->set_ast_node_id(BailoutId::FirstUsable().ToInt());
 }
 
 
@@ -645,7 +643,7 @@ FunctionLiteral* Parser::DoParseProgram(CompilationInfo* info,
     ParsingModeScope parsing_mode(this, mode);
 
     // Enters 'scope'.
-    FunctionState function_state(this, scope, isolate());
+    FunctionState function_state(this, scope);
 
     top_scope_->SetLanguageMode(info->language_mode());
     ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(16, zone());
@@ -759,7 +757,7 @@ FunctionLiteral* Parser::ParseLazy(Utf16CharacterStream* source) {
                                            zone());
     }
     original_scope_ = scope;
-    FunctionState function_state(this, scope, isolate());
+    FunctionState function_state(this, scope);
     ASSERT(scope->language_mode() != STRICT_MODE || !info()->is_classic_mode());
     ASSERT(scope->language_mode() != EXTENDED_MODE ||
            info()->is_extended_mode());
@@ -3835,7 +3833,7 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
     Expression* value = ParseAssignmentExpression(true, CHECK_OK);
 
     ObjectLiteral::Property* property =
-        new(zone()) ObjectLiteral::Property(key, value, isolate());
+        factory()->NewObjectLiteralProperty(key, value);
 
     // Mark top-level object literals that contain function literals and
     // pretenure the literal so it can be added as a constant function
@@ -4084,7 +4082,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
   AstProperties ast_properties;
   BailoutReason dont_optimize_reason = kNoReason;
   // Parse function body.
-  { FunctionState function_state(this, scope, isolate());
+  { FunctionState function_state(this, scope);
     top_scope_->SetScopeName(function_name);
 
     if (is_generator) {
index d3c24d1a58191ed981005a3bfb99e5214196f42f..2d7c899d541d04ea0c71128dc630e2407aba4eba 100644 (file)
@@ -451,9 +451,7 @@ class Parser : public ParserBase {
 
   class FunctionState BASE_EMBEDDED {
    public:
-    FunctionState(Parser* parser,
-                  Scope* scope,
-                  Isolate* isolate);
+    FunctionState(Parser* parser, Scope* scope);
     ~FunctionState();
 
     int NextMaterializedLiteralIndex() {
index 4b441b9ae41f520e670d98e6643f9264899a17a5..130fec1b233ae86df59bf499ec2f11b9117eb3fc 100644 (file)
@@ -38,11 +38,11 @@ namespace internal {
 
 #ifdef DEBUG
 
-PrettyPrinter::PrettyPrinter(Isolate* isolate) {
+PrettyPrinter::PrettyPrinter(Zone* zone) {
   output_ = NULL;
   size_ = 0;
   pos_ = 0;
-  InitializeAstVisitor(isolate);
+  InitializeAstVisitor(zone);
 }
 
 
@@ -493,8 +493,8 @@ const char* PrettyPrinter::PrintProgram(FunctionLiteral* program) {
 }
 
 
-void PrettyPrinter::PrintOut(Isolate* isolate, AstNode* node) {
-  PrettyPrinter printer(isolate);
+void PrettyPrinter::PrintOut(Zone* zone, AstNode* node) {
+  PrettyPrinter printer(zone);
   PrintF("%s", printer.Print(node));
 }
 
@@ -657,7 +657,7 @@ class IndentedScope BASE_EMBEDDED {
 //-----------------------------------------------------------------------------
 
 
-AstPrinter::AstPrinter(Isolate* isolate) : PrettyPrinter(isolate), indent_(0) {
+AstPrinter::AstPrinter(Zone* zone) : PrettyPrinter(zone), indent_(0) {
 }
 
 
index b7ff2af5fa1af13941e0155b47063f4efb5ac51d..a792720fe8a3505275880c32cfff22fc89f749d5 100644 (file)
@@ -38,7 +38,7 @@ namespace internal {
 
 class PrettyPrinter: public AstVisitor {
  public:
-  explicit PrettyPrinter(Isolate* isolate);
+  explicit PrettyPrinter(Zone* zone);
   virtual ~PrettyPrinter();
 
   // The following routines print a node into a string.
@@ -50,7 +50,7 @@ class PrettyPrinter: public AstVisitor {
   void Print(const char* format, ...);
 
   // Print a node to stdout.
-  static void PrintOut(Isolate* isolate, AstNode* node);
+  static void PrintOut(Zone* zone, AstNode* node);
 
   // Individual nodes
 #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
@@ -82,7 +82,7 @@ class PrettyPrinter: public AstVisitor {
 // Prints the AST structure
 class AstPrinter: public PrettyPrinter {
  public:
-  explicit AstPrinter(Isolate* isolate);
+  explicit AstPrinter(Zone* zone);
   virtual ~AstPrinter();
 
   const char* PrintProgram(FunctionLiteral* program);
index 5686ed074430be4198dd040fa6458f4e68f59cf0..5f0920b6705d5b19e39966bf2ed7c51af60cb089 100644 (file)
@@ -59,8 +59,8 @@ namespace internal {
 
 class Smi;
 template<class> class TypeImpl;
-struct HeapTypeConfig;
-typedef TypeImpl<HeapTypeConfig> Type;
+struct ZoneTypeConfig;
+typedef TypeImpl<ZoneTypeConfig> Type;
 class TypeInfo;
 
 // Type of properties.
@@ -116,7 +116,7 @@ class Representation {
 
   static Representation FromKind(Kind kind) { return Representation(kind); }
 
-  static Representation FromType(Handle<Type> type);
+  static Representation FromType(Type* type);
 
   bool Equals(const Representation& other) const {
     return kind_ == other.kind_;
index 5e81cf859f910e1ebccfaed6429e9e216723124c..2b68ed1c905581d0f5d1d6b79af0f55ff389a1b6 100644 (file)
@@ -43,8 +43,8 @@ class Processor: public AstVisitor {
         result_assigned_(false),
         is_set_(false),
         in_try_(false),
-        factory_(zone->isolate(), zone) {
-    InitializeAstVisitor(zone->isolate());
+        factory_(zone) {
+    InitializeAstVisitor(zone);
   }
 
   virtual ~Processor() { }
index a84d4e73a83162ab994cf12d0c7cc8b5fb5fd019..97b67bd5a4b639ce656fb3918f3de635389a9d28 100644 (file)
@@ -290,8 +290,7 @@ bool Scope::Analyze(CompilationInfo* info) {
 
   // Allocate the variables.
   {
-    AstNodeFactory<AstNullVisitor> ast_node_factory(info->isolate(),
-                                                    info->zone());
+    AstNodeFactory<AstNullVisitor> ast_node_factory(info->zone());
     if (!top->AllocateVariables(info, &ast_node_factory)) return false;
   }
 
index 7bcdbab9ee46dc94d56bbaf2064733a5a440c15d..aa54d818f0682de8034dac51ffc9086f81f34d23 100644 (file)
@@ -128,7 +128,7 @@ Handle<Code> StubCache::FindHandler(Handle<Name> name,
 
 Handle<Code> StubCache::ComputeMonomorphicIC(
     Handle<Name> name,
-    Handle<Type> type,
+    Handle<HeapType> type,
     Handle<Code> handler,
     ExtraICState extra_ic_state) {
   Code::Kind kind = handler->handler_kind();
@@ -139,7 +139,7 @@ Handle<Code> StubCache::ComputeMonomorphicIC(
   // There are multiple string maps that all use the same prototype. That
   // prototype cannot hold multiple handlers, one for each of the string maps,
   // for a single name. Hence, turn off caching of the IC.
-  bool can_be_cached = !type->Is(Type::String());
+  bool can_be_cached = !type->Is(HeapType::String());
   if (can_be_cached) {
     stub_holder = IC::GetCodeCacheHolder(flag, *type, isolate());
     ic = FindIC(name, stub_holder, kind, extra_ic_state, flag);
@@ -169,7 +169,7 @@ Handle<Code> StubCache::ComputeMonomorphicIC(
 
 
 Handle<Code> StubCache::ComputeLoadNonexistent(Handle<Name> name,
-                                               Handle<Type> type) {
+                                               Handle<HeapType> type) {
   InlineCacheHolderFlag flag = IC::GetCodeCacheFlag(*type);
   Handle<Map> stub_holder = IC::GetCodeCacheHolder(flag, *type, isolate());
   // If no dictionary mode objects are present in the prototype chain, the load
@@ -638,7 +638,7 @@ Handle<Code> StubCache::ComputeLoadElementPolymorphic(
 
   TypeHandleList types(receiver_maps->length());
   for (int i = 0; i < receiver_maps->length(); i++) {
-    types.Add(Type::Class(receiver_maps->at(i), isolate()));
+    types.Add(HeapType::Class(receiver_maps->at(i), isolate()));
   }
   CodeHandleList handlers(receiver_maps->length());
   KeyedLoadStubCompiler compiler(isolate_);
@@ -1343,20 +1343,20 @@ Handle<Code> CallStubCompiler::CompileCallConstant(
 
 
 Register LoadStubCompiler::HandlerFrontendHeader(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Register object_reg,
     Handle<JSObject> holder,
     Handle<Name> name,
     Label* miss) {
   PrototypeCheckType check_type = CHECK_ALL_MAPS;
   int function_index = -1;
-  if (type->Is(Type::String())) {
+  if (type->Is(HeapType::String())) {
     function_index = Context::STRING_FUNCTION_INDEX;
-  } else if (type->Is(Type::Symbol())) {
+  } else if (type->Is(HeapType::Symbol())) {
     function_index = Context::SYMBOL_FUNCTION_INDEX;
-  } else if (type->Is(Type::Number())) {
+  } else if (type->Is(HeapType::Number())) {
     function_index = Context::NUMBER_FUNCTION_INDEX;
-  } else if (type->Is(Type::Boolean())) {
+  } else if (type->Is(HeapType::Boolean())) {
     // Booleans use the generic oddball map, so an additional check is needed to
     // ensure the receiver is really a boolean.
     GenerateBooleanCheck(object_reg, miss);
@@ -1384,7 +1384,7 @@ Register LoadStubCompiler::HandlerFrontendHeader(
 // HandlerFrontend for store uses the name register. It has to be restored
 // before a miss.
 Register StoreStubCompiler::HandlerFrontendHeader(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Register object_reg,
     Handle<JSObject> holder,
     Handle<Name> name,
@@ -1396,13 +1396,13 @@ Register StoreStubCompiler::HandlerFrontendHeader(
 
 bool BaseLoadStoreStubCompiler::IncludesNumberType(TypeHandleList* types) {
   for (int i = 0; i < types->length(); ++i) {
-    if (types->at(i)->Is(Type::Number())) return true;
+    if (types->at(i)->Is(HeapType::Number())) return true;
   }
   return false;
 }
 
 
-Register BaseLoadStoreStubCompiler::HandlerFrontend(Handle<Type> type,
+Register BaseLoadStoreStubCompiler::HandlerFrontend(Handle<HeapType> type,
                                                     Register object_reg,
                                                     Handle<JSObject> holder,
                                                     Handle<Name> name) {
@@ -1416,7 +1416,7 @@ Register BaseLoadStoreStubCompiler::HandlerFrontend(Handle<Type> type,
 }
 
 
-void LoadStubCompiler::NonexistentHandlerFrontend(Handle<Type> type,
+void LoadStubCompiler::NonexistentHandlerFrontend(Handle<HeapType> type,
                                                   Handle<JSObject> last,
                                                   Handle<Name> name) {
   Label miss;
@@ -1461,7 +1461,7 @@ void LoadStubCompiler::NonexistentHandlerFrontend(Handle<Type> type,
 
 
 Handle<Code> LoadStubCompiler::CompileLoadField(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Handle<JSObject> holder,
     Handle<Name> name,
     PropertyIndex field,
@@ -1481,7 +1481,7 @@ Handle<Code> LoadStubCompiler::CompileLoadField(
 
 
 Handle<Code> LoadStubCompiler::CompileLoadConstant(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Handle<JSObject> holder,
     Handle<Name> name,
     Handle<Object> value) {
@@ -1494,7 +1494,7 @@ Handle<Code> LoadStubCompiler::CompileLoadConstant(
 
 
 Handle<Code> LoadStubCompiler::CompileLoadCallback(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Handle<JSObject> holder,
     Handle<Name> name,
     Handle<ExecutableAccessorInfo> callback) {
@@ -1508,7 +1508,7 @@ Handle<Code> LoadStubCompiler::CompileLoadCallback(
 
 
 Handle<Code> LoadStubCompiler::CompileLoadCallback(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Handle<JSObject> holder,
     Handle<Name> name,
     const CallOptimization& call_optimization) {
@@ -1523,7 +1523,7 @@ Handle<Code> LoadStubCompiler::CompileLoadCallback(
 
 
 Handle<Code> LoadStubCompiler::CompileLoadInterceptor(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Handle<JSObject> holder,
     Handle<Name> name) {
   LookupResult lookup(isolate());
@@ -1576,7 +1576,7 @@ void LoadStubCompiler::GenerateLoadPostInterceptor(
 
 
 Handle<Code> BaseLoadStoreStubCompiler::CompileMonomorphicIC(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Handle<Code> handler,
     Handle<Name> name) {
   TypeHandleList types(1);
@@ -1589,7 +1589,7 @@ Handle<Code> BaseLoadStoreStubCompiler::CompileMonomorphicIC(
 
 
 Handle<Code> LoadStubCompiler::CompileLoadViaGetter(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Handle<JSObject> holder,
     Handle<Name> name,
     Handle<JSFunction> getter) {
index c0bde19be37c50821e8e649d5a7a7bc1d1c535da..f544ec411bf0f0e1d2df415bf13460e8b8153f54 100644 (file)
@@ -92,11 +92,11 @@ class StubCache {
                            InlineCacheHolderFlag cache_holder = OWN_MAP);
 
   Handle<Code> ComputeMonomorphicIC(Handle<Name> name,
-                                    Handle<Type> type,
+                                    Handle<HeapType> type,
                                     Handle<Code> handler,
                                     ExtraICState extra_ic_state);
 
-  Handle<Code> ComputeLoadNonexistent(Handle<Name> name, Handle<Type> type);
+  Handle<Code> ComputeLoadNonexistent(Handle<Name> name, Handle<HeapType> type);
 
   Handle<Code> ComputeKeyedLoadElement(Handle<Map> receiver_map);
 
@@ -475,7 +475,7 @@ class StubCompiler BASE_EMBEDDED {
   // The function can optionally (when save_at_depth !=
   // kInvalidProtoDepth) save the object at the given depth by moving
   // it to [esp + kPointerSize].
-  Register CheckPrototypes(Handle<Type> type,
+  Register CheckPrototypes(Handle<HeapType> type,
                            Register object_reg,
                            Handle<JSObject> holder,
                            Register holder_reg,
@@ -530,7 +530,7 @@ class BaseLoadStoreStubCompiler: public StubCompiler {
   }
   virtual ~BaseLoadStoreStubCompiler() { }
 
-  Handle<Code> CompileMonomorphicIC(Handle<Type> type,
+  Handle<Code> CompileMonomorphicIC(Handle<HeapType> type,
                                     Handle<Code> handler,
                                     Handle<Name> name);
 
@@ -552,7 +552,7 @@ class BaseLoadStoreStubCompiler: public StubCompiler {
   }
 
  protected:
-  virtual Register HandlerFrontendHeader(Handle<Type> type,
+  virtual Register HandlerFrontendHeader(Handle<HeapType> type,
                                          Register object_reg,
                                          Handle<JSObject> holder,
                                          Handle<Name> name,
@@ -560,7 +560,7 @@ class BaseLoadStoreStubCompiler: public StubCompiler {
 
   virtual void HandlerFrontendFooter(Handle<Name> name, Label* miss) = 0;
 
-  Register HandlerFrontend(Handle<Type> type,
+  Register HandlerFrontend(Handle<HeapType> type,
                            Register object_reg,
                            Handle<JSObject> holder,
                            Handle<Name> name);
@@ -619,32 +619,32 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler {
                                   cache_holder) { }
   virtual ~LoadStubCompiler() { }
 
-  Handle<Code> CompileLoadField(Handle<Type> type,
+  Handle<Code> CompileLoadField(Handle<HeapType> type,
                                 Handle<JSObject> holder,
                                 Handle<Name> name,
                                 PropertyIndex index,
                                 Representation representation);
 
-  Handle<Code> CompileLoadCallback(Handle<Type> type,
+  Handle<Code> CompileLoadCallback(Handle<HeapType> type,
                                    Handle<JSObject> holder,
                                    Handle<Name> name,
                                    Handle<ExecutableAccessorInfo> callback);
 
-  Handle<Code> CompileLoadCallback(Handle<Type> type,
+  Handle<Code> CompileLoadCallback(Handle<HeapType> type,
                                    Handle<JSObject> holder,
                                    Handle<Name> name,
                                    const CallOptimization& call_optimization);
 
-  Handle<Code> CompileLoadConstant(Handle<Type> type,
+  Handle<Code> CompileLoadConstant(Handle<HeapType> type,
                                    Handle<JSObject> holder,
                                    Handle<Name> name,
                                    Handle<Object> value);
 
-  Handle<Code> CompileLoadInterceptor(Handle<Type> type,
+  Handle<Code> CompileLoadInterceptor(Handle<HeapType> type,
                                       Handle<JSObject> holder,
                                       Handle<Name> name);
 
-  Handle<Code> CompileLoadViaGetter(Handle<Type> type,
+  Handle<Code> CompileLoadViaGetter(Handle<HeapType> type,
                                     Handle<JSObject> holder,
                                     Handle<Name> name,
                                     Handle<JSFunction> getter);
@@ -653,11 +653,11 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler {
                                     Register receiver,
                                     Handle<JSFunction> getter);
 
-  Handle<Code> CompileLoadNonexistent(Handle<Type> type,
+  Handle<Code> CompileLoadNonexistent(Handle<HeapType> type,
                                       Handle<JSObject> last,
                                       Handle<Name> name);
 
-  Handle<Code> CompileLoadGlobal(Handle<Type> type,
+  Handle<Code> CompileLoadGlobal(Handle<HeapType> type,
                                  Handle<GlobalObject> holder,
                                  Handle<PropertyCell> cell,
                                  Handle<Name> name,
@@ -670,7 +670,7 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler {
     return LoadIC::GetContextualMode(extra_state());
   }
 
-  virtual Register HandlerFrontendHeader(Handle<Type> type,
+  virtual Register HandlerFrontendHeader(Handle<HeapType> type,
                                          Register object_reg,
                                          Handle<JSObject> holder,
                                          Handle<Name> name,
@@ -678,12 +678,12 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler {
 
   virtual void HandlerFrontendFooter(Handle<Name> name, Label* miss);
 
-  Register CallbackHandlerFrontend(Handle<Type> type,
+  Register CallbackHandlerFrontend(Handle<HeapType> type,
                                    Register object_reg,
                                    Handle<JSObject> holder,
                                    Handle<Name> name,
                                    Handle<Object> callback);
-  void NonexistentHandlerFrontend(Handle<Type> type,
+  void NonexistentHandlerFrontend(Handle<HeapType> type,
                                   Handle<JSObject> last,
                                   Handle<Name> name);
 
@@ -814,7 +814,7 @@ class StoreStubCompiler: public BaseLoadStoreStubCompiler {
   }
 
  protected:
-  virtual Register HandlerFrontendHeader(Handle<Type> type,
+  virtual Register HandlerFrontendHeader(Handle<HeapType> type,
                                          Register object_reg,
                                          Handle<JSObject> holder,
                                          Handle<Name> name,
index b8805215b7950eefa9d1871ab56a6f1cec5f4b94..d2b2bd1df10ce0d21a3e7a550cdd6f408c5f4338 100644 (file)
@@ -44,10 +44,8 @@ namespace internal {
 
 TypeFeedbackOracle::TypeFeedbackOracle(Handle<Code> code,
                                        Handle<Context> native_context,
-                                       Isolate* isolate,
                                        Zone* zone)
     : native_context_(native_context),
-      isolate_(isolate),
       zone_(zone) {
   BuildDictionary(code);
   ASSERT(dictionary_->IsDictionary());
@@ -65,12 +63,12 @@ Handle<Object> TypeFeedbackOracle::GetInfo(TypeFeedbackId ast_id) {
     Object* value = dictionary_->ValueAt(entry);
     if (value->IsCell()) {
       Cell* cell = Cell::cast(value);
-      return Handle<Object>(cell->value(), isolate_);
+      return Handle<Object>(cell->value(), isolate());
     } else {
-      return Handle<Object>(value, isolate_);
+      return Handle<Object>(value, isolate());
     }
   }
-  return Handle<Object>::cast(isolate_->factory()->undefined_value());
+  return Handle<Object>::cast(isolate()->factory()->undefined_value());
 }
 
 
@@ -186,7 +184,7 @@ CheckType TypeFeedbackOracle::GetCallCheckType(TypeFeedbackId id) {
 Handle<JSFunction> TypeFeedbackOracle::GetCallTarget(TypeFeedbackId id) {
   Handle<Object> info = GetInfo(id);
   if (info->IsAllocationSite()) {
-    return Handle<JSFunction>(isolate_->global_context()->array_function());
+    return Handle<JSFunction>(isolate()->global_context()->array_function());
   } else {
     return Handle<JSFunction>::cast(info);
   }
@@ -196,7 +194,7 @@ Handle<JSFunction> TypeFeedbackOracle::GetCallTarget(TypeFeedbackId id) {
 Handle<JSFunction> TypeFeedbackOracle::GetCallNewTarget(TypeFeedbackId id) {
   Handle<Object> info = GetInfo(id);
   if (info->IsAllocationSite()) {
-    return Handle<JSFunction>(isolate_->global_context()->array_function());
+    return Handle<JSFunction>(isolate()->global_context()->array_function());
   } else {
     return Handle<JSFunction>::cast(info);
   }
@@ -215,7 +213,7 @@ Handle<AllocationSite> TypeFeedbackOracle::GetCallNewAllocationSite(
 
 bool TypeFeedbackOracle::LoadIsBuiltin(
     TypeFeedbackId id, Builtins::Name builtin) {
-  return *GetInfo(id) == isolate_->builtins()->builtin(builtin);
+  return *GetInfo(id) == isolate()->builtins()->builtin(builtin);
 }
 
 
@@ -230,13 +228,13 @@ bool TypeFeedbackOracle::LoadIsStub(TypeFeedbackId id, ICStub* stub) {
 
 
 void TypeFeedbackOracle::CompareType(TypeFeedbackId id,
-                                     Handle<Type>* left_type,
-                                     Handle<Type>* right_type,
-                                     Handle<Type>* combined_type) {
+                                     Type** left_type,
+                                     Type** right_type,
+                                     Type** combined_type) {
   Handle<Object> info = GetInfo(id);
   if (!info->IsCode()) {
     // For some comparisons we don't have ICs, e.g. LiteralCompareTypeof.
-    *left_type = *right_type = *combined_type = Type::None(isolate_);
+    *left_type = *right_type = *combined_type = Type::None(zone());
     return;
   }
   Handle<Code> code = Handle<Code>::cast(info);
@@ -253,19 +251,19 @@ void TypeFeedbackOracle::CompareType(TypeFeedbackId id,
   if (code->is_compare_ic_stub()) {
     int stub_minor_key = code->stub_info();
     CompareIC::StubInfoToType(
-        stub_minor_key, left_type, right_type, combined_type, map, isolate());
+        stub_minor_key, left_type, right_type, combined_type, map, zone());
   } else if (code->is_compare_nil_ic_stub()) {
     CompareNilICStub stub(code->extended_extra_ic_state());
-    *combined_type = stub.GetType(isolate_, map);
-    *left_type = *right_type = stub.GetInputType(isolate_, map);
+    *combined_type = stub.GetType(zone(), map);
+    *left_type = *right_type = stub.GetInputType(zone(), map);
   }
 }
 
 
 void TypeFeedbackOracle::BinaryType(TypeFeedbackId id,
-                                    Handle<Type>* left,
-                                    Handle<Type>* right,
-                                    Handle<Type>* result,
+                                    Type** left,
+                                    Type** right,
+                                    Type** result,
                                     Maybe<int>* fixed_right_arg,
                                     Handle<AllocationSite>* allocation_site,
                                     Token::Value op) {
@@ -275,7 +273,7 @@ void TypeFeedbackOracle::BinaryType(TypeFeedbackId id,
     // operations covered by the BinaryOpIC we should always have them.
     ASSERT(op < BinaryOpIC::State::FIRST_TOKEN ||
            op > BinaryOpIC::State::LAST_TOKEN);
-    *left = *right = *result = Type::None(isolate_);
+    *left = *right = *result = Type::None(zone());
     *fixed_right_arg = Maybe<int>();
     *allocation_site = Handle<AllocationSite>::null();
     return;
@@ -285,9 +283,9 @@ void TypeFeedbackOracle::BinaryType(TypeFeedbackId id,
   BinaryOpIC::State state(code->extended_extra_ic_state());
   ASSERT_EQ(op, state.op());
 
-  *left = state.GetLeftType(isolate());
-  *right = state.GetRightType(isolate());
-  *result = state.GetResultType(isolate());
+  *left = state.GetLeftType(zone());
+  *right = state.GetRightType(zone());
+  *result = state.GetResultType(zone());
   *fixed_right_arg = state.fixed_right_arg();
 
   AllocationSite* first_allocation_site = code->FindFirstAllocationSite();
@@ -299,13 +297,13 @@ void TypeFeedbackOracle::BinaryType(TypeFeedbackId id,
 }
 
 
-Handle<Type> TypeFeedbackOracle::CountType(TypeFeedbackId id) {
+Type* TypeFeedbackOracle::CountType(TypeFeedbackId id) {
   Handle<Object> object = GetInfo(id);
-  if (!object->IsCode()) return Type::None(isolate_);
+  if (!object->IsCode()) return Type::None(zone());
   Handle<Code> code = Handle<Code>::cast(object);
   ASSERT_EQ(Code::BINARY_OP_IC, code->kind());
   BinaryOpIC::State state(code->extended_extra_ic_state());
-  return state.GetLeftType(isolate());
+  return state.GetLeftType(zone());
 }
 
 
@@ -375,7 +373,7 @@ void TypeFeedbackOracle::CollectReceiverTypes(TypeFeedbackId ast_id,
   if (FLAG_collect_megamorphic_maps_from_stub_cache &&
       code->ic_state() == MEGAMORPHIC) {
     types->Reserve(4, zone());
-    isolate_->stub_cache()->CollectMatchingMaps(
+    isolate()->stub_cache()->CollectMatchingMaps(
         types, name, flags, native_context_, zone());
   } else {
     CollectReceiverTypes(ast_id, types);
@@ -454,7 +452,7 @@ byte TypeFeedbackOracle::ToBooleanTypes(TypeFeedbackId id) {
 void TypeFeedbackOracle::BuildDictionary(Handle<Code> code) {
   DisallowHeapAllocation no_allocation;
   ZoneList<RelocInfo> infos(16, zone());
-  HandleScope scope(isolate_);
+  HandleScope scope(isolate());
   GetRelocInfos(code, &infos);
   CreateDictionary(code, &infos);
   ProcessRelocInfos(&infos);
index a82f0c0c2a9cf12ff6d213350c4769fb9de5d550..a457d2ba41d51b701598761a1f16d018221dca20 100644 (file)
@@ -45,7 +45,6 @@ class TypeFeedbackOracle: public ZoneObject {
  public:
   TypeFeedbackOracle(Handle<Code> code,
                      Handle<Context> native_context,
-                     Isolate* isolate,
                      Zone* zone);
 
   bool LoadIsUninitialized(TypeFeedbackId id);
@@ -107,22 +106,22 @@ class TypeFeedbackOracle: public ZoneObject {
 
   // Get type information for arithmetic operations and compares.
   void BinaryType(TypeFeedbackId id,
-                  Handle<Type>* left,
-                  Handle<Type>* right,
-                  Handle<Type>* result,
+                  Type** left,
+                  Type** right,
+                  Type** result,
                   Maybe<int>* fixed_right_arg,
                   Handle<AllocationSite>* allocation_site,
                   Token::Value operation);
 
   void CompareType(TypeFeedbackId id,
-                   Handle<Type>* left,
-                   Handle<Type>* right,
-                   Handle<Type>* combined);
+                   Type** left,
+                   Type** right,
+                   Type** combined);
 
-  Handle<Type> CountType(TypeFeedbackId id);
+  Type* CountType(TypeFeedbackId id);
 
   Zone* zone() const { return zone_; }
-  Isolate* isolate() const { return isolate_; }
+  Isolate* isolate() const { return zone_->isolate(); }
 
  private:
   void CollectReceiverTypes(TypeFeedbackId id,
@@ -147,7 +146,6 @@ class TypeFeedbackOracle: public ZoneObject {
 
  private:
   Handle<Context> native_context_;
-  Isolate* isolate_;
   Zone* zone_;
   Handle<UnseededNumberDictionary> dictionary_;
 
index 9354965a7b7a57475a7568b08b2adaa9eee24411..bbaf7a93fe29d67cf07066ebcb45de1efc770101 100644 (file)
@@ -541,7 +541,7 @@ typename TypeImpl<Config>::TypeHandle TypeImpl<Config>::Intersect(
 
 
 // TODO(rossberg): this does not belong here.
-Representation Representation::FromType(Handle<Type> type) {
+Representation Representation::FromType(Type* type) {
   if (type->Is(Type::None())) return Representation::None();
   if (type->Is(Type::Smi())) return Representation::Smi();
   if (type->Is(Type::Signed32())) return Representation::Integer32();
index 6b3fba5c7d9e1f88ce4c080b5b7210cd34a99932..e7b306e4fa6568fe13ac52777fc6a9d7f1e662ce 100644 (file)
@@ -496,8 +496,8 @@ struct HeapTypeConfig {
   }
 };
 
-typedef TypeImpl<ZoneTypeConfig> ZoneType;
-typedef TypeImpl<HeapTypeConfig> Type;
+typedef TypeImpl<ZoneTypeConfig> Type;
+typedef TypeImpl<HeapTypeConfig> HeapType;
 
 
 // A simple struct to represent a pair of lower/upper type bounds.
@@ -550,8 +550,7 @@ struct BoundsImpl {
   }
 };
 
-typedef BoundsImpl<ZoneTypeConfig> ZoneBounds;
-typedef BoundsImpl<HeapTypeConfig> Bounds;
+typedef BoundsImpl<ZoneTypeConfig> Bounds;
 
 
 } }  // namespace v8::internal
index b1fde82c13ef9caa2901ecb32df2afa842e2bd99..596ea2c612ca0cbe4daeee72f5e41d9e6f9cfe7a 100644 (file)
@@ -41,10 +41,9 @@ AstTyper::AstTyper(CompilationInfo* info)
       oracle_(
           Handle<Code>(info->closure()->shared()->code()),
           Handle<Context>(info->closure()->context()->native_context()),
-          info->isolate(),
           info->zone()),
       store_(info->zone()) {
-  InitializeAstVisitor(info->isolate());
+  InitializeAstVisitor(info->zone());
 }
 
 
@@ -72,7 +71,7 @@ void AstTyper::Run(CompilationInfo* info) {
 
 
 #ifdef OBJECT_PRINT
-  static void PrintObserved(Variable* var, Object* value, Handle<Type> type) {
+  static void PrintObserved(Variable* var, Object* value, Type* type) {
     PrintF("  observed %s ", var->IsParameter() ? "param" : "local");
     var->name()->Print();
     PrintF(" : ");
@@ -84,8 +83,8 @@ void AstTyper::Run(CompilationInfo* info) {
 
 
 Effect AstTyper::ObservedOnStack(Object* value) {
-  Handle<Type> lower = Type::OfCurrently(handle(value, isolate()), isolate());
-  return Effect(Bounds(lower, Type::Any(isolate())));
+  Type* lower = Type::OfCurrently(handle(value, isolate()), zone());
+  return Effect(Bounds(lower, Type::Any(zone())));
 }
 
 
@@ -233,7 +232,9 @@ void AstTyper::VisitSwitchStatement(SwitchStatement* stmt) {
     if (!clause->is_default()) {
       Expression* label = clause->label();
       // Collect type feedback.
-      Handle<Type> tag_type, label_type, combined_type;
+      Type* tag_type;
+      Type* label_type;
+      Type* combined_type;
       oracle()->CompareType(clause->CompareId(),
                             &tag_type, &label_type, &combined_type);
       NarrowLowerType(stmt->tag(), tag_type);
@@ -392,7 +393,7 @@ void AstTyper::VisitConditional(Conditional* expr) {
 
   NarrowType(expr, Bounds::Either(
       expr->then_expression()->bounds(),
-      expr->else_expression()->bounds(), isolate_));
+      expr->else_expression()->bounds(), zone()));
 }
 
 
@@ -405,13 +406,13 @@ void AstTyper::VisitVariableProxy(VariableProxy* expr) {
 
 
 void AstTyper::VisitLiteral(Literal* expr) {
-  Handle<Type> type = Type::Constant(expr->value(), isolate_);
+  Type* type = Type::Constant(expr->value(), zone());
   NarrowType(expr, Bounds(type));
 }
 
 
 void AstTyper::VisitRegExpLiteral(RegExpLiteral* expr) {
-  NarrowType(expr, Bounds(Type::RegExp(isolate_)));
+  NarrowType(expr, Bounds(Type::RegExp(zone())));
 }
 
 
@@ -432,7 +433,7 @@ void AstTyper::VisitObjectLiteral(ObjectLiteral* expr) {
     RECURSE(Visit(prop->value()));
   }
 
-  NarrowType(expr, Bounds(Type::Object(isolate_)));
+  NarrowType(expr, Bounds(Type::Object(zone())));
 }
 
 
@@ -443,7 +444,7 @@ void AstTyper::VisitArrayLiteral(ArrayLiteral* expr) {
     RECURSE(Visit(value));
   }
 
-  NarrowType(expr, Bounds(Type::Array(isolate_)));
+  NarrowType(expr, Bounds(Type::Array(zone())));
 }
 
 
@@ -495,7 +496,7 @@ void AstTyper::VisitThrow(Throw* expr) {
   RECURSE(Visit(expr->exception()));
   // TODO(rossberg): is it worth having a non-termination effect?
 
-  NarrowType(expr, Bounds(Type::None(isolate_)));
+  NarrowType(expr, Bounds(Type::None(zone())));
 }
 
 
@@ -587,13 +588,13 @@ void AstTyper::VisitUnaryOperation(UnaryOperation* expr) {
   switch (expr->op()) {
     case Token::NOT:
     case Token::DELETE:
-      NarrowType(expr, Bounds(Type::Boolean(isolate_)));
+      NarrowType(expr, Bounds(Type::Boolean(zone())));
       break;
     case Token::VOID:
-      NarrowType(expr, Bounds(Type::Undefined(isolate_)));
+      NarrowType(expr, Bounds(Type::Undefined(zone())));
       break;
     case Token::TYPEOF:
-      NarrowType(expr, Bounds(Type::InternalizedString(isolate_)));
+      NarrowType(expr, Bounds(Type::InternalizedString(zone())));
       break;
     default:
       UNREACHABLE();
@@ -611,7 +612,7 @@ void AstTyper::VisitCountOperation(CountOperation* expr) {
 
   RECURSE(Visit(expr->expression()));
 
-  NarrowType(expr, Bounds(Type::Smi(isolate_), Type::Number(isolate_)));
+  NarrowType(expr, Bounds(Type::Smi(zone()), Type::Number(zone())));
 
   VariableProxy* proxy = expr->expression()->AsVariableProxy();
   if (proxy != NULL && proxy->var()->IsStackAllocated()) {
@@ -622,7 +623,9 @@ void AstTyper::VisitCountOperation(CountOperation* expr) {
 
 void AstTyper::VisitBinaryOperation(BinaryOperation* expr) {
   // Collect type feedback.
-  Handle<Type> type, left_type, right_type;
+  Type* type;
+  Type* left_type;
+  Type* right_type;
   Maybe<int> fixed_right_arg;
   Handle<AllocationSite> allocation_site;
   oracle()->BinaryType(expr->BinaryOperationFeedbackId(),
@@ -655,20 +658,17 @@ void AstTyper::VisitBinaryOperation(BinaryOperation* expr) {
       store_.Seq(left_effects);
 
       NarrowType(expr, Bounds::Either(
-          expr->left()->bounds(), expr->right()->bounds(), isolate_));
+          expr->left()->bounds(), expr->right()->bounds(), zone()));
       break;
     }
     case Token::BIT_OR:
     case Token::BIT_AND: {
       RECURSE(Visit(expr->left()));
       RECURSE(Visit(expr->right()));
-      Handle<Type> upper = Type::Union(
-          expr->left()->bounds().upper, expr->right()->bounds().upper,
-          isolate_);
-      if (!upper->Is(Type::Signed32()))
-        upper = Type::Signed32(isolate_);
-      Handle<Type> lower =
-          Type::Intersect(Type::Smi(isolate_), upper, isolate_);
+      Type* upper = Type::Union(
+          expr->left()->bounds().upper, expr->right()->bounds().upper, zone());
+      if (!upper->Is(Type::Signed32())) upper = Type::Signed32(zone());
+      Type* lower = Type::Intersect(Type::Smi(zone()), upper, zone());
       NarrowType(expr, Bounds(lower, upper));
       break;
     }
@@ -677,7 +677,7 @@ void AstTyper::VisitBinaryOperation(BinaryOperation* expr) {
     case Token::SAR:
       RECURSE(Visit(expr->left()));
       RECURSE(Visit(expr->right()));
-      NarrowType(expr, Bounds(Type::Smi(isolate_), Type::Signed32(isolate_)));
+      NarrowType(expr, Bounds(Type::Smi(zone()), Type::Signed32(zone())));
       break;
     case Token::SHR:
       RECURSE(Visit(expr->left()));
@@ -685,25 +685,25 @@ void AstTyper::VisitBinaryOperation(BinaryOperation* expr) {
       // TODO(rossberg): The upper bound would be Unsigned32, but since there
       // is no 'positive Smi' type for the lower bound, we use the smallest
       // union of Smi and Unsigned32 as upper bound instead.
-      NarrowType(expr, Bounds(Type::Smi(isolate_), Type::Number(isolate_)));
+      NarrowType(expr, Bounds(Type::Smi(zone()), Type::Number(zone())));
       break;
     case Token::ADD: {
       RECURSE(Visit(expr->left()));
       RECURSE(Visit(expr->right()));
       Bounds l = expr->left()->bounds();
       Bounds r = expr->right()->bounds();
-      Handle<Type> lower =
+      Type* lower =
           l.lower->Is(Type::None()) || r.lower->Is(Type::None()) ?
-              Type::None(isolate_) :
+              Type::None(zone()) :
           l.lower->Is(Type::String()) || r.lower->Is(Type::String()) ?
-              Type::String(isolate_) :
+              Type::String(zone()) :
           l.lower->Is(Type::Number()) && r.lower->Is(Type::Number()) ?
-              Type::Smi(isolate_) : Type::None(isolate_);
-      Handle<Type> upper =
+              Type::Smi(zone()) : Type::None(zone());
+      Type* upper =
           l.upper->Is(Type::String()) || r.upper->Is(Type::String()) ?
-              Type::String(isolate_) :
+              Type::String(zone()) :
           l.upper->Is(Type::Number()) && r.upper->Is(Type::Number()) ?
-              Type::Number(isolate_) : Type::NumberOrString(isolate_);
+              Type::Number(zone()) : Type::NumberOrString(zone());
       NarrowType(expr, Bounds(lower, upper));
       break;
     }
@@ -713,7 +713,7 @@ void AstTyper::VisitBinaryOperation(BinaryOperation* expr) {
     case Token::MOD:
       RECURSE(Visit(expr->left()));
       RECURSE(Visit(expr->right()));
-      NarrowType(expr, Bounds(Type::Smi(isolate_), Type::Number(isolate_)));
+      NarrowType(expr, Bounds(Type::Smi(zone()), Type::Number(zone())));
       break;
     default:
       UNREACHABLE();
@@ -723,7 +723,9 @@ void AstTyper::VisitBinaryOperation(BinaryOperation* expr) {
 
 void AstTyper::VisitCompareOperation(CompareOperation* expr) {
   // Collect type feedback.
-  Handle<Type> left_type, right_type, combined_type;
+  Type* left_type;
+  Type* right_type;
+  Type* combined_type;
   oracle()->CompareType(expr->CompareOperationFeedbackId(),
       &left_type, &right_type, &combined_type);
   NarrowLowerType(expr->left(), left_type);
@@ -733,7 +735,7 @@ void AstTyper::VisitCompareOperation(CompareOperation* expr) {
   RECURSE(Visit(expr->left()));
   RECURSE(Visit(expr->right()));
 
-  NarrowType(expr, Bounds(Type::Boolean(isolate_)));
+  NarrowType(expr, Bounds(Type::Boolean(zone())));
 }
 
 
index ec9132f161e9bbf808ab99e675bef7258f3ef3f2..0517812ec3061e9aed31c21019e81d504c48e1d0 100644 (file)
@@ -70,13 +70,12 @@ class AstTyper: public AstVisitor {
   Store store_;
 
   TypeFeedbackOracle* oracle() { return &oracle_; }
-  Zone* zone() const { return info_->zone(); }
 
   void NarrowType(Expression* e, Bounds b) {
-    e->set_bounds(Bounds::Both(e->bounds(), b, isolate_));
+    e->set_bounds(Bounds::Both(e->bounds(), b, zone()));
   }
-  void NarrowLowerType(Expression* e, Handle<Type> t) {
-    e->set_bounds(Bounds::NarrowLower(e->bounds(), t, isolate_));
+  void NarrowLowerType(Expression* e, Type* t) {
+    e->set_bounds(Bounds::NarrowLower(e->bounds(), t, zone()));
   }
 
   Effects EnterEffects() {
index 811ac507d53138a2a8377b2448fe69f86f2b7a61..aa0961de5c9949ae43f4962120dac8f12f70ab17 100644 (file)
@@ -44,8 +44,8 @@ enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF };
 
 class CodeGenerator: public AstVisitor {
  public:
-  explicit CodeGenerator(Isolate* isolate) {
-    InitializeAstVisitor(isolate);
+  explicit CodeGenerator(Zone* zone) {
+    InitializeAstVisitor(zone);
   }
 
   static bool MakeCode(CompilationInfo* info);
index 81797619fc32a78d491b7e5c5b832702d51b5be0..dbfd419290c692b61758bacb58d9e76dcea55668 100644 (file)
@@ -1068,7 +1068,7 @@ void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) {
 #define __ ACCESS_MASM((masm()))
 
 
-Register StubCompiler::CheckPrototypes(Handle<Type> type,
+Register StubCompiler::CheckPrototypes(Handle<HeapType> type,
                                        Register object_reg,
                                        Handle<JSObject> holder,
                                        Register holder_reg,
@@ -1206,7 +1206,7 @@ void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) {
 
 
 Register LoadStubCompiler::CallbackHandlerFrontend(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Register object_reg,
     Handle<JSObject> holder,
     Handle<Name> name,
@@ -1900,7 +1900,7 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic(
 }
 
 
-Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<Type> type,
+Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<HeapType> type,
                                                       Handle<JSObject> last,
                                                       Handle<Name> name) {
   NonexistentHandlerFrontend(type, last, name);
@@ -1983,7 +1983,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
 
 
 Handle<Code> LoadStubCompiler::CompileLoadGlobal(
-    Handle<Type> type,
+    Handle<HeapType> type,
     Handle<GlobalObject> global,
     Handle<PropertyCell> cell,
     Handle<Name> name,
@@ -2042,13 +2042,13 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
   int receiver_count = types->length();
   int number_of_handled_maps = 0;
   for (int current = 0; current < receiver_count; ++current) {
-    Handle<Type> type = types->at(current);
+    Handle<HeapType> type = types->at(current);
     Handle<Map> map = IC::TypeToMap(*type, isolate());
     if (!map->is_deprecated()) {
       number_of_handled_maps++;
       // Check map and tail call if there's a match
       __ Cmp(map_reg, map);
-      if (type->Is(Type::Number())) {
+      if (type->Is(HeapType::Number())) {
         ASSERT(!number_case.is_unused());
         __ bind(&number_case);
       }
index 299f2a896086d58f479a4eb6269eb349954d34e6..d6431371aa1b4e1d609c4af18e36bd86552a58a0 100644 (file)
@@ -41,7 +41,7 @@ TEST(List) {
 
   Isolate* isolate = CcTest::i_isolate();
   Zone zone(isolate);
-  AstNodeFactory<AstNullVisitor> factory(isolate, &zone);
+  AstNodeFactory<AstNullVisitor> factory(&zone);
   AstNode* node = factory.NewEmptyStatement(RelocInfo::kNoPosition);
   list->Add(node);
   CHECK_EQ(1, list->length());
index 2f0390868ab953baee37398f208969b41ac840c0..8f4ec97573caee66b9696c4e5a7cc0e1775db731 100644 (file)
@@ -126,31 +126,29 @@ class Types {
 
 // Testing auxiliaries (breaking the Type abstraction).
 struct ZoneRep {
-  static bool IsTagged(ZoneType* t, int tag) {
+  static bool IsTagged(Type* t, int tag) {
     return !IsBitset(t)
         && reinterpret_cast<intptr_t>(AsTagged(t)->at(0)) == tag;
   }
-  static bool IsBitset(ZoneType* t) {
-    return reinterpret_cast<intptr_t>(t) & 1;
-  }
-  static bool IsClass(ZoneType* t) { return IsTagged(t, 0); }
-  static bool IsConstant(ZoneType* t) { return IsTagged(t, 1); }
-  static bool IsUnion(ZoneType* t) { return IsTagged(t, 2); }
+  static bool IsBitset(Type* t) { return reinterpret_cast<intptr_t>(t) & 1; }
+  static bool IsClass(Type* t) { return IsTagged(t, 0); }
+  static bool IsConstant(Type* t) { return IsTagged(t, 1); }
+  static bool IsUnion(Type* t) { return IsTagged(t, 2); }
 
-  static ZoneList<void*>* AsTagged(ZoneType* t) {
+  static ZoneList<void*>* AsTagged(Type* t) {
     return reinterpret_cast<ZoneList<void*>*>(t);
   }
-  static int AsBitset(ZoneType* t) {
+  static int AsBitset(Type* t) {
     return static_cast<int>(reinterpret_cast<intptr_t>(t) >> 1);
   }
-  static Map* AsClass(ZoneType* t) {
+  static Map* AsClass(Type* t) {
     return *reinterpret_cast<Map**>(AsTagged(t)->at(1));
   }
-  static Object* AsConstant(ZoneType* t) {
+  static Object* AsConstant(Type* t) {
     return *reinterpret_cast<Object**>(AsTagged(t)->at(1));
   }
-  static ZoneList<ZoneType*>* AsUnion(ZoneType* t) {
-    return reinterpret_cast<ZoneList<ZoneType*>*>(AsTagged(t));
+  static ZoneList<Type*>* AsUnion(Type* t) {
+    return reinterpret_cast<ZoneList<Type*>*>(AsTagged(t));
   }
 
   static Zone* ToRegion(Zone* zone, Isolate* isolate) { return zone; }
@@ -158,15 +156,19 @@ struct ZoneRep {
 
 
 struct HeapRep {
-  static bool IsBitset(Handle<Type> t) { return t->IsSmi(); }
-  static bool IsClass(Handle<Type> t) { return t->IsMap(); }
-  static bool IsConstant(Handle<Type> t) { return t->IsBox(); }
-  static bool IsUnion(Handle<Type> t) { return t->IsFixedArray(); }
-
-  static int AsBitset(Handle<Type> t) { return Smi::cast(*t)->value(); }
-  static Map* AsClass(Handle<Type> t) { return Map::cast(*t); }
-  static Object* AsConstant(Handle<Type> t) { return Box::cast(*t)->value(); }
-  static FixedArray* AsUnion(Handle<Type> t) { return FixedArray::cast(*t); }
+  static bool IsBitset(Handle<HeapType> t) { return t->IsSmi(); }
+  static bool IsClass(Handle<HeapType> t) { return t->IsMap(); }
+  static bool IsConstant(Handle<HeapType> t) { return t->IsBox(); }
+  static bool IsUnion(Handle<HeapType> t) { return t->IsFixedArray(); }
+
+  static int AsBitset(Handle<HeapType> t) { return Smi::cast(*t)->value(); }
+  static Map* AsClass(Handle<HeapType> t) { return Map::cast(*t); }
+  static Object* AsConstant(Handle<HeapType> t) {
+    return Box::cast(*t)->value();
+  }
+  static FixedArray* AsUnion(Handle<HeapType> t) {
+    return FixedArray::cast(*t);
+  }
 
   static Isolate* ToRegion(Zone* zone, Isolate* isolate) { return isolate; }
 };
@@ -755,8 +757,8 @@ struct Tests : Rep {
   }
 };
 
-typedef Tests<ZoneType, ZoneType*, Zone, ZoneRep> ZoneTests;
-typedef Tests<Type, Handle<Type>, Isolate, HeapRep> HeapTests;
+typedef Tests<Type, Type*, Zone, ZoneRep> ZoneTests;
+typedef Tests<HeapType, Handle<HeapType>, Isolate, HeapRep> HeapTests;
 
 
 TEST(Bitset) {