Remove the dependency of Zone on Isolate
authordanno <danno@chromium.org>
Fri, 23 Jan 2015 15:19:34 +0000 (07:19 -0800)
committerCommit bot <commit-bot@chromium.org>
Fri, 23 Jan 2015 15:20:00 +0000 (15:20 +0000)
Along the way:
- Thread isolate parameter explicitly through code that used to
  rely on getting it from the zone.
- Canonicalize the parameter position of isolate and zone for
  affected code
- Change Hydrogen New<> instruction templates to automatically
  pass isolate

R=mstarzinger@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#26252}

131 files changed:
src/arm/regexp-macro-assembler-arm.cc
src/arm/regexp-macro-assembler-arm.h
src/arm64/regexp-macro-assembler-arm64.cc
src/arm64/regexp-macro-assembler-arm64.h
src/ast-numbering.cc
src/ast-numbering.h
src/ast-this-access-visitor.cc
src/ast-this-access-visitor.h
src/ast.h
src/codegen.cc
src/compiler.cc
src/compiler.h
src/compiler/arm/linkage-arm.cc
src/compiler/arm64/linkage-arm64.cc
src/compiler/ast-graph-builder.cc
src/compiler/ast-loop-assignment-analyzer.cc
src/compiler/code-generator.cc
src/compiler/code-generator.h
src/compiler/control-reducer.cc
src/compiler/graph-builder.cc
src/compiler/graph-builder.h
src/compiler/graph-inl.h
src/compiler/graph-visualizer.cc
src/compiler/ia32/instruction-selector-ia32.cc
src/compiler/ia32/linkage-ia32.cc
src/compiler/instruction-selector-impl.h
src/compiler/instruction.cc
src/compiler/instruction.h
src/compiler/js-generic-lowering.cc
src/compiler/js-generic-lowering.h
src/compiler/js-graph.h
src/compiler/js-inlining.cc
src/compiler/jump-threading.cc
src/compiler/linkage-impl.h
src/compiler/linkage.cc
src/compiler/linkage.h
src/compiler/mips/linkage-mips.cc
src/compiler/pipeline-statistics.cc
src/compiler/pipeline.cc
src/compiler/pipeline.h
src/compiler/raw-machine-assembler.cc
src/compiler/raw-machine-assembler.h
src/compiler/select-lowering.cc
src/compiler/simplified-lowering.cc
src/compiler/typer.cc
src/compiler/typer.h
src/compiler/verifier.cc
src/compiler/x64/linkage-x64.cc
src/compiler/zone-pool.cc
src/compiler/zone-pool.h
src/deoptimizer.cc
src/full-codegen.cc
src/full-codegen.h
src/gdb-jit.cc
src/hydrogen-bch.cc
src/hydrogen-escape-analysis.cc
src/hydrogen-instructions.cc
src/hydrogen-instructions.h
src/hydrogen.cc
src/hydrogen.h
src/ia32/regexp-macro-assembler-ia32.cc
src/ia32/regexp-macro-assembler-ia32.h
src/isolate.cc
src/json-parser.h
src/jsregexp.cc
src/jsregexp.h
src/lithium-allocator.cc
src/liveedit.cc
src/mips/regexp-macro-assembler-mips.cc
src/mips/regexp-macro-assembler-mips.h
src/objects.h
src/parser.cc
src/parser.h
src/preparser.h
src/prettyprinter.cc
src/prettyprinter.h
src/regexp-macro-assembler-tracer.cc
src/regexp-macro-assembler-tracer.h
src/regexp-macro-assembler.cc
src/regexp-macro-assembler.h
src/rewriter.cc
src/runtime/runtime-internal.cc
src/scopeinfo.cc
src/scopes.cc
src/scopes.h
src/type-info.cc
src/type-info.h
src/typing.cc
src/x64/regexp-macro-assembler-x64.cc
src/x64/regexp-macro-assembler-x64.h
src/zone.cc
src/zone.h
test/cctest/cctest.h
test/cctest/compiler/codegen-tester.h
test/cctest/compiler/graph-builder-tester.cc
test/cctest/compiler/graph-builder-tester.h
test/cctest/compiler/simplified-graph-builder.cc
test/cctest/compiler/simplified-graph-builder.h
test/cctest/compiler/test-changes-lowering.cc
test/cctest/compiler/test-codegen-deopt.cc
test/cctest/compiler/test-control-reducer.cc
test/cctest/compiler/test-instruction.cc
test/cctest/compiler/test-js-constant-cache.cc
test/cctest/compiler/test-js-context-specialization.cc
test/cctest/compiler/test-js-typed-lowering.cc
test/cctest/compiler/test-jump-threading.cc
test/cctest/compiler/test-loop-analysis.cc
test/cctest/compiler/test-machine-operator-reducer.cc
test/cctest/compiler/test-osr.cc
test/cctest/compiler/test-representation-change.cc
test/cctest/compiler/test-simplified-lowering.cc
test/cctest/compiler/test-typer.cc
test/cctest/test-ast.cc
test/cctest/test-bit-vector.cc
test/cctest/test-liveedit.cc
test/cctest/test-parsing.cc
test/cctest/test-regexp.cc
test/cctest/test-types.cc
test/cctest/test-unique.cc
test/unittests/compiler/change-lowering-unittest.cc
test/unittests/compiler/graph-unittest.cc
test/unittests/compiler/instruction-selector-unittest.cc
test/unittests/compiler/instruction-selector-unittest.h
test/unittests/compiler/instruction-sequence-unittest.cc
test/unittests/compiler/js-builtin-reducer-unittest.cc
test/unittests/compiler/js-typed-lowering-unittest.cc
test/unittests/compiler/loop-peeling-unittest.cc
test/unittests/compiler/machine-operator-reducer-unittest.cc
test/unittests/compiler/simplified-operator-reducer-unittest.cc
test/unittests/compiler/zone-pool-unittest.cc
test/unittests/test-utils.h

index f4918febb51fd165025dafe8d1e842a3bfa182af..c0c677c1b16e8e743a43dd3c36c898ad888a823a 100644 (file)
@@ -96,12 +96,11 @@ namespace internal {
 
 #define __ ACCESS_MASM(masm_)
 
-RegExpMacroAssemblerARM::RegExpMacroAssemblerARM(
-    Mode mode,
-    int registers_to_save,
-    Zone* zone)
-    : NativeRegExpMacroAssembler(zone),
-      masm_(new MacroAssembler(zone->isolate(), NULL, kRegExpCodeSize)),
+RegExpMacroAssemblerARM::RegExpMacroAssemblerARM(Isolate* isolate, Zone* zone,
+                                                 Mode mode,
+                                                 int registers_to_save)
+    : NativeRegExpMacroAssembler(isolate, zone),
+      masm_(new MacroAssembler(isolate, NULL, kRegExpCodeSize)),
       mode_(mode),
       num_registers_(registers_to_save),
       num_saved_registers_(registers_to_save),
index 7414e54a658dfd6730e7d914e6fe1d73658e48b9..078d0dfa629b8b230082b0086524c9cae556019c 100644 (file)
@@ -16,7 +16,8 @@ namespace internal {
 #ifndef V8_INTERPRETED_REGEXP
 class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
  public:
-  RegExpMacroAssemblerARM(Mode mode, int registers_to_save, Zone* zone);
+  RegExpMacroAssemblerARM(Isolate* isolate, Zone* zone, Mode mode,
+                          int registers_to_save);
   virtual ~RegExpMacroAssemblerARM();
   virtual int stack_limit_slack();
   virtual void AdvanceCurrentPosition(int by);
index e9a485d09036cc5d382245907e397bc45b84efd8..1630f212bf7114bf9700e6852bff28ee959f0a3e 100644 (file)
@@ -111,12 +111,11 @@ namespace internal {
 
 #define __ ACCESS_MASM(masm_)
 
-RegExpMacroAssemblerARM64::RegExpMacroAssemblerARM64(
-    Mode mode,
-    int registers_to_save,
-    Zone* zone)
-    : NativeRegExpMacroAssembler(zone),
-      masm_(new MacroAssembler(zone->isolate(), NULL, kRegExpCodeSize)),
+RegExpMacroAssemblerARM64::RegExpMacroAssemblerARM64(Isolate* isolate,
+                                                     Zone* zone, Mode mode,
+                                                     int registers_to_save)
+    : NativeRegExpMacroAssembler(isolate, zone),
+      masm_(new MacroAssembler(isolate, NULL, kRegExpCodeSize)),
       mode_(mode),
       num_registers_(registers_to_save),
       num_saved_registers_(registers_to_save),
index 632c513643fdb9b757bc8532d68e09261d499340..da6b26b9258ba19401e401dbb6096fdd7750ac2a 100644 (file)
@@ -17,7 +17,8 @@ namespace internal {
 #ifndef V8_INTERPRETED_REGEXP
 class RegExpMacroAssemblerARM64: public NativeRegExpMacroAssembler {
  public:
-  RegExpMacroAssemblerARM64(Mode mode, int registers_to_save, Zone* zone);
+  RegExpMacroAssemblerARM64(Isolate* isolate, Zone* zone, Mode mode,
+                            int registers_to_save);
   virtual ~RegExpMacroAssemblerARM64();
   virtual int stack_limit_slack();
   virtual void AdvanceCurrentPosition(int by);
index d9882ae672c5298e19b5b23e64ec93a99477c8bc..fd74b2e700af424ca554e088b49a964b805a6454 100644 (file)
@@ -15,11 +15,11 @@ namespace internal {
 
 class AstNumberingVisitor FINAL : public AstVisitor {
  public:
-  explicit AstNumberingVisitor(Zone* zone)
+  explicit AstNumberingVisitor(Isolate* isolate, Zone* zone)
       : AstVisitor(),
         next_id_(BailoutId::FirstUsable().ToInt()),
         dont_optimize_reason_(kNoReason) {
-    InitializeAstVisitor(zone);
+    InitializeAstVisitor(isolate, zone);
   }
 
   bool Renumber(FunctionLiteral* node);
@@ -559,8 +559,9 @@ bool AstNumberingVisitor::Renumber(FunctionLiteral* node) {
 }
 
 
-bool AstNumbering::Renumber(FunctionLiteral* function, Zone* zone) {
-  AstNumberingVisitor visitor(zone);
+bool AstNumbering::Renumber(Isolate* isolate, Zone* zone,
+                            FunctionLiteral* function) {
+  AstNumberingVisitor visitor(isolate, zone);
   return visitor.Renumber(function);
 }
 }
index ab97c22bdfea5c44b1f31a93efa86e3172e32c49..c068c2f286504da56ad44d741ba9b27649e20346 100644 (file)
@@ -11,7 +11,7 @@ namespace internal {
 namespace AstNumbering {
 // Assign type feedback IDs and bailout IDs to an AST node tree.
 //
-bool Renumber(FunctionLiteral* function, Zone* zone);
+bool Renumber(Isolate* isolate, Zone* zone, FunctionLiteral* function);
 }
 }
 }  // namespace v8::internal
index cf4a3de842a999a764a57aa1ecf437222a738e50..d3af53db06533550c652b83575668bab1fd9608b 100644 (file)
@@ -10,8 +10,8 @@ namespace internal {
 
 typedef class AstThisAccessVisitor ATAV;  // for code shortitude.
 
-ATAV::AstThisAccessVisitor(Zone* zone) : uses_this_(false) {
-  InitializeAstVisitor(zone);
+ATAV::AstThisAccessVisitor(Isolate* isolate, Zone* zone) : uses_this_(false) {
+  InitializeAstVisitor(isolate, zone);
 }
 
 
index 60309815ed603041ac6e778f1e650a32383dbfc9..08dddeed1c2beb4852a9fc9f0fd1a9a1a6b1817d 100644 (file)
@@ -11,7 +11,7 @@ namespace internal {
 
 class AstThisAccessVisitor : public AstVisitor {
  public:
-  explicit AstThisAccessVisitor(Zone* zone);
+  AstThisAccessVisitor(Isolate* isolate, Zone* zone);
 
   bool UsesThis() { return uses_this_; }
 
index a797272cec2d42432c94e6a7f09ad02c64a9a0f8..db9f575d038367af1f5ec6b3d99996e821792aad 100644 (file)
--- a/src/ast.h
+++ b/src/ast.h
@@ -3143,20 +3143,22 @@ class AstVisitor BASE_EMBEDDED {
                                                             \
   bool CheckStackOverflow() {                               \
     if (stack_overflow_) return true;                       \
-    StackLimitCheck check(zone_->isolate());                \
+    StackLimitCheck check(isolate_);                        \
     if (!check.HasOverflowed()) return false;               \
     stack_overflow_ = true;                                 \
     return true;                                            \
   }                                                         \
                                                             \
  private:                                                   \
-  void InitializeAstVisitor(Zone* zone) {                   \
+  void InitializeAstVisitor(Isolate* isolate, Zone* zone) { \
+    isolate_ = isolate;                                     \
     zone_ = zone;                                           \
     stack_overflow_ = false;                                \
   }                                                         \
   Zone* zone() { return zone_; }                            \
-  Isolate* isolate() { return zone_->isolate(); }           \
+  Isolate* isolate() { return isolate_; }                   \
                                                             \
+  Isolate* isolate_;                                        \
   Zone* zone_;                                              \
   bool stack_overflow_
 
index 627e8362e67c551641174d7b161d45b27bb7761d..66b605a4206658d2feebf56c084d2ff03b2e530c 100644 (file)
@@ -125,12 +125,13 @@ void CodeGenerator::MakeCodePrologue(CompilationInfo* info, const char* kind) {
 #ifdef DEBUG
   if (!info->IsStub() && print_source) {
     PrintF("--- Source from AST ---\n%s\n",
-           PrettyPrinter(info->zone()).PrintProgram(info->function()));
+           PrettyPrinter(info->isolate(), info->zone())
+               .PrintProgram(info->function()));
   }
 
   if (!info->IsStub() && print_ast) {
-    PrintF("--- AST ---\n%s\n",
-           AstPrinter(info->zone()).PrintProgram(info->function()));
+    PrintF("--- AST ---\n%s\n", AstPrinter(info->isolate(), info->zone())
+                                    .PrintProgram(info->function()));
   }
 #endif  // DEBUG
 }
index e7fa603909566867bf480426024a0310afc8d5aa..266bd54c6104820e836e6f2ebc18a16d7099822a 100644 (file)
@@ -700,7 +700,8 @@ MUST_USE_RESULT static MaybeHandle<Code> GetUnoptimizedCodeCommon(
 
   // Update the shared function info with the scope info. Allocating the
   // ScopeInfo object may cause a GC.
-  Handle<ScopeInfo> scope_info = ScopeInfo::Create(info->scope(), info->zone());
+  Handle<ScopeInfo> scope_info =
+      ScopeInfo::Create(info->isolate(), info->zone(), info->scope());
   shared->set_scope_info(*scope_info);
 
   // Update the code and feedback vector for the shared function info.
@@ -761,7 +762,10 @@ static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
 
 
 static bool Renumber(CompilationInfo* info) {
-  if (!AstNumbering::Renumber(info->function(), info->zone())) return false;
+  if (!AstNumbering::Renumber(info->isolate(), info->zone(),
+                              info->function())) {
+    return false;
+  }
   if (!info->shared_info().is_null()) {
     FunctionLiteral* lit = info->function();
     info->shared_info()->set_ast_node_count(lit->ast_node_count());
@@ -829,7 +833,7 @@ static bool CheckSuperConstructorCall(CompilationInfo* info) {
 
   ZoneList<Expression*>* arguments = callExpr->arguments();
 
-  AstThisAccessVisitor this_access_visitor(info->zone());
+  AstThisAccessVisitor this_access_visitor(info->isolate(), info->zone());
   this_access_visitor.VisitExpressions(arguments);
 
   if (this_access_visitor.HasStackOverflow()) return false;
@@ -1037,7 +1041,7 @@ bool Compiler::EnsureDeoptimizationSupport(CompilationInfo* info) {
     // function is inlined before being called for the first time.
     if (shared->scope_info() == ScopeInfo::Empty(info->isolate())) {
       Handle<ScopeInfo> target_scope_info =
-          ScopeInfo::Create(info->scope(), info->zone());
+          ScopeInfo::Create(info->isolate(), info->zone(), info->scope());
       shared->set_scope_info(*target_scope_info);
     }
 
@@ -1099,8 +1103,8 @@ void Compiler::CompileForLiveEdit(Handle<Script> script) {
   LiveEditFunctionTracker tracker(info.isolate(), info.function());
   if (!CompileUnoptimizedCode(&info)) return;
   if (!info.shared_info().is_null()) {
-    Handle<ScopeInfo> scope_info = ScopeInfo::Create(info.scope(),
-                                                     info.zone());
+    Handle<ScopeInfo> scope_info =
+        ScopeInfo::Create(info.isolate(), info.zone(), info.scope());
     info.shared_info()->set_scope_info(*scope_info);
   }
   tracker.RecordRootFunctionInfo(info.code());
@@ -1169,7 +1173,8 @@ static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
     DCHECK(!info->code().is_null());
     result = isolate->factory()->NewSharedFunctionInfo(
         lit->name(), lit->materialized_literal_count(), lit->kind(),
-        info->code(), ScopeInfo::Create(info->scope(), info->zone()),
+        info->code(),
+        ScopeInfo::Create(info->isolate(), info->zone(), info->scope()),
         info->feedback_vector());
 
     DCHECK_EQ(RelocInfo::kNoPosition, lit->function_token_position());
@@ -1425,7 +1430,7 @@ Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(
     // MakeCode will ensure that the feedback vector is present and
     // appropriately sized.
     DCHECK(!info.code().is_null());
-    scope_info = ScopeInfo::Create(info.scope(), info.zone());
+    scope_info = ScopeInfo::Create(info.isolate(), info.zone(), info.scope());
   } else {
     return Handle<SharedFunctionInfo>::null();
   }
@@ -1556,7 +1561,7 @@ bool Compiler::DebuggerWantsEagerCompilation(CompilationInfo* info,
 
 
 CompilationPhase::CompilationPhase(const char* name, CompilationInfo* info)
-    : name_(name), info_(info), zone_(info->isolate()) {
+    : name_(name), info_(info) {
   if (FLAG_hydrogen_stats) {
     info_zone_start_allocation_size_ = info->zone()->allocation_size();
     timer_.Start();
index 82b296a09968bd60f8e128850b77ca0d13e83048..bd9b98c74507cb0a887ce8d38dcfe6eb930ba6cf 100644 (file)
@@ -529,21 +529,17 @@ class CompilationInfo {
 class CompilationInfoWithZone: public CompilationInfo {
  public:
   explicit CompilationInfoWithZone(Handle<Script> script)
-      : CompilationInfo(script, &zone_),
-        zone_(script->GetIsolate()) {}
+      : CompilationInfo(script, &zone_) {}
   explicit CompilationInfoWithZone(Handle<SharedFunctionInfo> shared_info)
-      : CompilationInfo(shared_info, &zone_),
-        zone_(shared_info->GetIsolate()) {}
+      : CompilationInfo(shared_info, &zone_) {}
   explicit CompilationInfoWithZone(Handle<JSFunction> closure)
-      : CompilationInfo(closure, &zone_),
-        zone_(closure->GetIsolate()) {}
+      : CompilationInfo(closure, &zone_) {}
   CompilationInfoWithZone(HydrogenCodeStub* stub, Isolate* isolate)
-      : CompilationInfo(stub, isolate, &zone_),
-        zone_(isolate) {}
+      : CompilationInfo(stub, isolate, &zone_) {}
   CompilationInfoWithZone(ScriptCompiler::ExternalSourceStream* stream,
                           ScriptCompiler::StreamedSource::Encoding encoding,
                           Isolate* isolate)
-      : CompilationInfo(stream, encoding, isolate, &zone_), zone_(isolate) {}
+      : CompilationInfo(stream, encoding, isolate, &zone_) {}
 
   // Virtual destructor because a CompilationInfoWithZone has to exit the
   // zone scope and get rid of dependent maps even when the destructor is
index 3fca76ff543c40aabf112567abc34f69099b6772..5dc52f5c02c4e2e9ef910345ddc3474a6e310e6a 100644 (file)
@@ -35,25 +35,26 @@ struct ArmLinkageHelperTraits {
 
 typedef LinkageHelper<ArmLinkageHelperTraits> LH;
 
-CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count, Zone* zone,
+CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, int parameter_count,
                                              CallDescriptor::Flags flags) {
   return LH::GetJSCallDescriptor(zone, parameter_count, flags);
 }
 
 
 CallDescriptor* Linkage::GetRuntimeCallDescriptor(
-    Runtime::FunctionId function, int parameter_count,
-    Operator::Properties properties, Zone* zone) {
+    Zone* zone, Runtime::FunctionId function, int parameter_count,
+    Operator::Properties properties) {
   return LH::GetRuntimeCallDescriptor(zone, function, parameter_count,
                                       properties);
 }
 
 
 CallDescriptor* Linkage::GetStubCallDescriptor(
-    const CallInterfaceDescriptor& descriptor, int stack_parameter_count,
-    CallDescriptor::Flags flags, Operator::Properties properties, Zone* zone) {
-  return LH::GetStubCallDescriptor(zone, descriptor, stack_parameter_count,
-                                   flags, properties);
+    Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
+    int stack_parameter_count, CallDescriptor::Flags flags,
+    Operator::Properties properties) {
+  return LH::GetStubCallDescriptor(isolate, zone, descriptor,
+                                   stack_parameter_count, flags, properties);
 }
 
 
index 291b5520f9c6f776dbe62483ae0f63ee270f9e13..9dd1c489d6eeeb4a0a5d699151dbf094c1dac615 100644 (file)
@@ -35,25 +35,26 @@ struct Arm64LinkageHelperTraits {
 
 typedef LinkageHelper<Arm64LinkageHelperTraits> LH;
 
-CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count, Zone* zone,
+CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, int parameter_count,
                                              CallDescriptor::Flags flags) {
   return LH::GetJSCallDescriptor(zone, parameter_count, flags);
 }
 
 
 CallDescriptor* Linkage::GetRuntimeCallDescriptor(
-    Runtime::FunctionId function, int parameter_count,
-    Operator::Properties properties, Zone* zone) {
+    Zone* zone, Runtime::FunctionId function, int parameter_count,
+    Operator::Properties properties) {
   return LH::GetRuntimeCallDescriptor(zone, function, parameter_count,
                                       properties);
 }
 
 
 CallDescriptor* Linkage::GetStubCallDescriptor(
-    const CallInterfaceDescriptor& descriptor, int stack_parameter_count,
-    CallDescriptor::Flags flags, Operator::Properties properties, Zone* zone) {
-  return LH::GetStubCallDescriptor(zone, descriptor, stack_parameter_count,
-                                   flags, properties);
+    Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
+    int stack_parameter_count, CallDescriptor::Flags flags,
+    Operator::Properties properties) {
+  return LH::GetStubCallDescriptor(isolate, zone, descriptor,
+                                   stack_parameter_count, flags, properties);
 }
 
 
index 4177a75982df7337f4d9b1679a9361d9caaf2719..5e725284f39807983e56efd38900021c65cac5a6 100644 (file)
@@ -21,14 +21,15 @@ namespace compiler {
 
 AstGraphBuilder::AstGraphBuilder(Zone* local_zone, CompilationInfo* info,
                                  JSGraph* jsgraph, LoopAssignmentAnalysis* loop)
-    : StructuredGraphBuilder(local_zone, jsgraph->graph(), jsgraph->common()),
+    : StructuredGraphBuilder(jsgraph->isolate(), local_zone, jsgraph->graph(),
+                             jsgraph->common()),
       info_(info),
       jsgraph_(jsgraph),
       globals_(0, local_zone),
       breakable_(NULL),
       execution_context_(NULL),
       loop_assignment_analysis_(loop) {
-  InitializeAstVisitor(local_zone);
+  InitializeAstVisitor(info->isolate(), local_zone);
 }
 
 
index 7adac56e7675ad6814c724ac43a2005234311566..f94d9e07d2740b7827fa848d3bc32c511e58c358 100644 (file)
@@ -13,7 +13,7 @@ typedef class AstLoopAssignmentAnalyzer ALAA;  // for code shortitude.
 
 ALAA::AstLoopAssignmentAnalyzer(Zone* zone, CompilationInfo* info)
     : info_(info), loop_stack_(zone) {
-  InitializeAstVisitor(zone);
+  InitializeAstVisitor(info->isolate(), zone);
 }
 
 
index df485eba95209560ec13b01d0b0e5c0efd06acd1..44e3b9dc9d708378b0c1b60b215d3e762756c26f 100644 (file)
@@ -21,7 +21,7 @@ CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage,
       labels_(zone()->NewArray<Label>(code->InstructionBlockCount())),
       current_block_(BasicBlock::RpoNumber::Invalid()),
       current_source_position_(SourcePosition::Invalid()),
-      masm_(code->zone()->isolate(), NULL, 0),
+      masm_(info->isolate(), NULL, 0),
       resolver_(this),
       safepoints_(code->zone()),
       deoptimization_states_(code->zone()),
index d59105e67e2de2573dac01128a4494078861ff56..035cd5cc1e93a29586b2b998a957cc6a2ee05796 100644 (file)
@@ -38,7 +38,7 @@ class CodeGenerator FINAL : public GapResolver::Assembler {
 
   InstructionSequence* code() const { return code_; }
   Frame* frame() const { return frame_; }
-  Isolate* isolate() const { return zone()->isolate(); }
+  Isolate* isolate() const { return info_->isolate(); }
   Linkage* linkage() const { return linkage_; }
 
   Label* GetLabel(BasicBlock::RpoNumber rpo) { return &labels_[rpo.ToSize()]; }
index d34b4e8dcec7f207ee9a7f03ef8aff0cda0b9606..0c260623763fb8fb9ab53a0f642e4b8e4c159e9d 100644 (file)
@@ -563,7 +563,7 @@ void ControlReducer::TrimGraph(Zone* zone, JSGraph* jsgraph) {
 Node* ControlReducer::ReducePhiForTesting(JSGraph* jsgraph,
                                           CommonOperatorBuilder* common,
                                           Node* node) {
-  Zone zone(jsgraph->graph()->zone()->isolate());
+  Zone zone;
   ControlReducerImpl impl(&zone, jsgraph, common);
   return impl.ReducePhi(node);
 }
@@ -572,7 +572,7 @@ Node* ControlReducer::ReducePhiForTesting(JSGraph* jsgraph,
 Node* ControlReducer::ReduceMergeForTesting(JSGraph* jsgraph,
                                             CommonOperatorBuilder* common,
                                             Node* node) {
-  Zone zone(jsgraph->graph()->zone()->isolate());
+  Zone zone;
   ControlReducerImpl impl(&zone, jsgraph, common);
   return impl.ReduceMerge(node);
 }
@@ -581,7 +581,7 @@ Node* ControlReducer::ReduceMergeForTesting(JSGraph* jsgraph,
 Node* ControlReducer::ReduceBranchForTesting(JSGraph* jsgraph,
                                              CommonOperatorBuilder* common,
                                              Node* node) {
-  Zone zone(jsgraph->graph()->zone()->isolate());
+  Zone zone;
   ControlReducerImpl impl(&zone, jsgraph, common);
   return impl.ReduceBranch(node);
 }
index 9fa7a02754c127de38f2a3a7de8911fc2126b62e..4457ba095e70a24cced0e55f534be9ca67005bb9 100644 (file)
@@ -17,9 +17,10 @@ namespace internal {
 namespace compiler {
 
 
-StructuredGraphBuilder::StructuredGraphBuilder(Zone* local_zone, Graph* graph,
+StructuredGraphBuilder::StructuredGraphBuilder(Isolate* isolate,
+                                               Zone* local_zone, Graph* graph,
                                                CommonOperatorBuilder* common)
-    : GraphBuilder(graph),
+    : GraphBuilder(isolate, graph),
       common_(common),
       environment_(NULL),
       local_zone_(local_zone),
index fd0f0559d704a7415045260f34f0183ef8577002..8374675ab62f9ea5b842a87a3cf4e301cad95d8b 100644 (file)
@@ -25,7 +25,8 @@ class Node;
 // A common base class for anything that creates nodes in a graph.
 class GraphBuilder {
  public:
-  explicit GraphBuilder(Graph* graph) : graph_(graph) {}
+  GraphBuilder(Isolate* isolate, Graph* graph)
+      : isolate_(isolate), graph_(graph) {}
   virtual ~GraphBuilder() {}
 
   Node* NewNode(const Operator* op, bool incomplete = false) {
@@ -68,6 +69,7 @@ class GraphBuilder {
     return MakeNode(op, value_input_count, value_inputs, incomplete);
   }
 
+  Isolate* isolate() const { return isolate_; }
   Graph* graph() const { return graph_; }
 
  protected:
@@ -76,6 +78,7 @@ class GraphBuilder {
                          Node** value_inputs, bool incomplete) = 0;
 
  private:
+  Isolate* isolate_;
   Graph* graph_;
 };
 
@@ -85,7 +88,7 @@ class GraphBuilder {
 // StubGraphBuilder).
 class StructuredGraphBuilder : public GraphBuilder {
  public:
-  StructuredGraphBuilder(Zone* zone, Graph* graph,
+  StructuredGraphBuilder(Isolate* isolate, Zone* zone, Graph* graph,
                          CommonOperatorBuilder* common);
   ~StructuredGraphBuilder() OVERRIDE {}
 
@@ -131,7 +134,6 @@ class StructuredGraphBuilder : public GraphBuilder {
 
   Zone* graph_zone() const { return graph()->zone(); }
   Zone* local_zone() const { return local_zone_; }
-  Isolate* isolate() const { return graph_zone()->isolate(); }
   CommonOperatorBuilder* common() const { return common_; }
 
   // Helper to wrap a Handle<T> into a Unique<T>.
index c135ae5d77bc13b05bf3229f8debb74821d51ea7..3a21737c6e796c523800f540afb802458b5b5b21 100644 (file)
@@ -14,7 +14,7 @@ namespace compiler {
 
 template <class Visitor>
 void Graph::VisitNodeInputsFromEnd(Visitor* visitor) {
-  Zone tmp_zone(zone()->isolate());
+  Zone tmp_zone;
   GenericGraphVisit::Visit<Visitor>(this, &tmp_zone, end(), visitor);
 }
 
index e09d987fae02206a225ced5f6b21ddfa56007710..ff5ff5fe17bfcdacfd22fa4163438f3694480fed 100644 (file)
@@ -208,7 +208,7 @@ class JSONGraphEdgeWriter {
 
 
 std::ostream& operator<<(std::ostream& os, const AsJSON& ad) {
-  Zone tmp_zone(ad.graph.zone()->isolate());
+  Zone tmp_zone;
   os << "{\"nodes\":[";
   JSONGraphNodeWriter(os, &tmp_zone, &ad.graph).Print();
   os << "],\"edges\":[";
@@ -390,7 +390,7 @@ void GraphVisualizer::Print() {
 
 
 std::ostream& operator<<(std::ostream& os, const AsDOT& ad) {
-  Zone tmp_zone(ad.graph.zone()->isolate());
+  Zone tmp_zone;
   GraphVisualizer(os, &tmp_zone, &ad.graph).Print();
   return os;
 }
@@ -769,14 +769,14 @@ void GraphC1Visualizer::PrintLiveRange(LiveRange* range, const char* type) {
 
 
 std::ostream& operator<<(std::ostream& os, const AsC1VCompilation& ac) {
-  Zone tmp_zone(ac.info_->isolate());
+  Zone tmp_zone;
   GraphC1Visualizer(os, &tmp_zone).PrintCompilation(ac.info_);
   return os;
 }
 
 
 std::ostream& operator<<(std::ostream& os, const AsC1V& ac) {
-  Zone tmp_zone(ac.schedule_->zone()->isolate());
+  Zone tmp_zone;
   GraphC1Visualizer(os, &tmp_zone)
       .PrintSchedule(ac.phase_, ac.schedule_, ac.positions_, ac.instructions_);
   return os;
@@ -784,7 +784,7 @@ std::ostream& operator<<(std::ostream& os, const AsC1V& ac) {
 
 
 std::ostream& operator<<(std::ostream& os, const AsC1VAllocator& ac) {
-  Zone tmp_zone(ac.allocator_->code()->zone()->isolate());
+  Zone tmp_zone;
   GraphC1Visualizer(os, &tmp_zone).PrintAllocator(ac.phase_, ac.allocator_);
   return os;
 }
@@ -794,7 +794,7 @@ const int kOnStack = 1;
 const int kVisited = 2;
 
 std::ostream& operator<<(std::ostream& os, const AsRPO& ar) {
-  Zone local_zone(ar.graph.zone()->isolate());
+  Zone local_zone;
   ZoneVector<byte> state(ar.graph.NodeCount(), kUnvisited, &local_zone);
   ZoneStack<Node*> stack(&local_zone);
 
index 7b6b721a376e5441ed704ecf9c9922324de9d328..7f82a5ce38447a515e15b0a897704fb504dc86b6 100644 (file)
@@ -31,7 +31,8 @@ class IA32OperandGenerator FINAL : public OperandGenerator {
         // Constants in new space cannot be used as immediates in V8 because
         // the GC does not scan code objects when collecting the new generation.
         Unique<HeapObject> value = OpParameter<Unique<HeapObject> >(node);
-        return !isolate()->heap()->InNewSpace(*value.handle());
+        Isolate* isolate = value.handle()->GetIsolate();
+        return !isolate->heap()->InNewSpace(*value.handle());
       }
       default:
         return false;
index 12cc34f3b9138a79f0b745306d892b81f8d49fb9..b775626e1ffee7768ca6b1b5cda7f2158d532b76 100644 (file)
@@ -30,25 +30,26 @@ struct IA32LinkageHelperTraits {
 
 typedef LinkageHelper<IA32LinkageHelperTraits> LH;
 
-CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count, Zone* zone,
+CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, int parameter_count,
                                              CallDescriptor::Flags flags) {
   return LH::GetJSCallDescriptor(zone, parameter_count, flags);
 }
 
 
 CallDescriptor* Linkage::GetRuntimeCallDescriptor(
-    Runtime::FunctionId function, int parameter_count,
-    Operator::Properties properties, Zone* zone) {
+    Zone* zone, Runtime::FunctionId function, int parameter_count,
+    Operator::Properties properties) {
   return LH::GetRuntimeCallDescriptor(zone, function, parameter_count,
                                       properties);
 }
 
 
 CallDescriptor* Linkage::GetStubCallDescriptor(
-    const CallInterfaceDescriptor& descriptor, int stack_parameter_count,
-    CallDescriptor::Flags flags, Operator::Properties properties, Zone* zone) {
-  return LH::GetStubCallDescriptor(zone, descriptor, stack_parameter_count,
-                                   flags, properties);
+    Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
+    int stack_parameter_count, CallDescriptor::Flags flags,
+    Operator::Properties properties) {
+  return LH::GetStubCallDescriptor(isolate, zone, descriptor,
+                                   stack_parameter_count, flags, properties);
 }
 
 
index a02a6e222327ffae41ad14b77baa84ca20fcaf6e..26ac2d9f590f30e3a1ca2302eef3bbae8fd4f880 100644 (file)
@@ -143,7 +143,6 @@ class OperandGenerator {
  protected:
   InstructionSelector* selector() const { return selector_; }
   InstructionSequence* sequence() const { return selector()->sequence(); }
-  Isolate* isolate() const { return zone()->isolate(); }
   Zone* zone() const { return selector()->instruction_zone(); }
 
  private:
index 6b0540a0d3426b9ebd5341a7c2852894a7a70bb1..7d1851a94d579af844f1c0273e064c4bd724ab7f 100644 (file)
@@ -430,9 +430,11 @@ void InstructionSequence::ComputeAssemblyOrder(InstructionBlocks* blocks) {
 }
 
 
-InstructionSequence::InstructionSequence(Zone* instruction_zone,
+InstructionSequence::InstructionSequence(Isolate* isolate,
+                                         Zone* instruction_zone,
                                          InstructionBlocks* instruction_blocks)
-    : zone_(instruction_zone),
+    : isolate_(isolate),
+      zone_(instruction_zone),
       instruction_blocks_(instruction_blocks),
       block_starts_(zone()),
       constants_(ConstantMap::key_compare(),
index c1fdef4aacf648061ce94c1bb1b107e0adac8477..d9009b658039f193960d5ae75cb4ef37f6f82c16 100644 (file)
@@ -918,7 +918,8 @@ class InstructionSequence FINAL : public ZoneObject {
   // Puts the deferred blocks last.
   static void ComputeAssemblyOrder(InstructionBlocks* blocks);
 
-  InstructionSequence(Zone* zone, InstructionBlocks* instruction_blocks);
+  InstructionSequence(Isolate* isolate, Zone* zone,
+                      InstructionBlocks* instruction_blocks);
 
   int NextVirtualRegister();
   int VirtualRegisterCount() const { return next_virtual_register_; }
@@ -972,7 +973,7 @@ class InstructionSequence FINAL : public ZoneObject {
     return instructions_[index];
   }
 
-  Isolate* isolate() const { return zone()->isolate(); }
+  Isolate* isolate() const { return isolate_; }
   const PointerMapDeque* pointer_maps() const { return &pointer_maps_; }
   Zone* zone() const { return zone_; }
 
@@ -1037,6 +1038,7 @@ class InstructionSequence FINAL : public ZoneObject {
 
   typedef std::set<int, std::less<int>, ZoneIntAllocator> VirtualRegisterSet;
 
+  Isolate* isolate_;
   Zone* const zone_;
   InstructionBlocks* const instruction_blocks_;
   IntVector block_starts_;
index 05f4aa89eb5e01e91190dca3cdbd4f78afed099c..bad30ffd0cea10235c2ca995631adc80cc56c94a 100644 (file)
@@ -399,7 +399,7 @@ bool JSGenericLowering::TryLowerDirectJSCall(Node* node) {
   }
   node->ReplaceInput(index, context);
   CallDescriptor* desc = linkage()->GetJSCallDescriptor(
-      1 + arg_count, jsgraph()->zone(), FlagsForNode(node));
+      jsgraph()->zone(), 1 + arg_count, FlagsForNode(node));
   PatchOperator(node, common()->Call(desc));
   return true;
 }
index f6263385edca6a938034fe7f36b0e479d171a10e..e6fc88ebf7236c6b1bb103884090daff84e83ec7 100644 (file)
@@ -51,7 +51,7 @@ class JSGenericLowering FINAL : public Reducer {
   bool TryLowerDirectJSCall(Node* node);
 
   Zone* zone() const { return graph()->zone(); }
-  Isolate* isolate() const { return zone()->isolate(); }
+  Isolate* isolate() const { return info_->isolate(); }
   JSGraph* jsgraph() const { return jsgraph_; }
   Graph* graph() const { return jsgraph()->graph(); }
   Linkage* linkage() const { return linkage_; }
index 2f5ebd9ce9cd66ee6569d6a2ca3e45cb76ba514f..761b0dffe1bc6dd4ebee68ad9206d4fef464bdbc 100644 (file)
@@ -23,9 +23,10 @@ class Typer;
 // constants, and various helper methods.
 class JSGraph : public ZoneObject {
  public:
-  JSGraph(Graph* graph, CommonOperatorBuilder* common,
+  JSGraph(Isolate* isolate, Graph* graph, CommonOperatorBuilder* common,
           JSOperatorBuilder* javascript, MachineOperatorBuilder* machine)
-      : graph_(graph),
+      : isolate_(isolate),
+        graph_(graph),
         common_(common),
         javascript_(javascript),
         machine_(machine),
@@ -113,17 +114,18 @@ class JSGraph : public ZoneObject {
   // cannot deopt.
   Node* EmptyFrameState();
 
-  JSOperatorBuilder* javascript() { return javascript_; }
-  CommonOperatorBuilder* common() { return common_; }
-  MachineOperatorBuilder* machine() { return machine_; }
-  Graph* graph() { return graph_; }
-  Zone* zone() { return graph()->zone(); }
-  Isolate* isolate() { return zone()->isolate(); }
-  Factory* factory() { return isolate()->factory(); }
+  JSOperatorBuilder* javascript() const { return javascript_; }
+  CommonOperatorBuilder* common() const { return common_; }
+  MachineOperatorBuilder* machine() const { return machine_; }
+  Graph* graph() const { return graph_; }
+  Zone* zone() const { return graph()->zone(); }
+  Isolate* isolate() const { return isolate_; }
+  Factory* factory() const { return isolate()->factory(); }
 
   void GetCachedNodes(NodeVector* nodes);
 
  private:
+  Isolate* isolate_;
   Graph* graph_;
   CommonOperatorBuilder* common_;
   JSOperatorBuilder* javascript_;
index 32c381f3c6b71c0211daedee6343e0e4e2c756a1..040c721bade799506fe2df8e71004ca0946069f4 100644 (file)
@@ -387,8 +387,8 @@ void JSInliner::TryInlineJSCall(Node* call_node) {
   }
 
   Graph graph(info.zone());
-  JSGraph jsgraph(&graph, jsgraph_->common(), jsgraph_->javascript(),
-                  jsgraph_->machine());
+  JSGraph jsgraph(info.isolate(), &graph, jsgraph_->common(),
+                  jsgraph_->javascript(), jsgraph_->machine());
 
   AstGraphBuilder graph_builder(local_zone_, &info, &jsgraph);
   graph_builder.CreateGraph();
index f0bb731605998b3f10395d80e76661b8cd239b82..4242c957edc5cb409d26b132212eaef92d37b4ac 100644 (file)
@@ -140,7 +140,7 @@ void JumpThreading::ApplyForwarding(ZoneVector<RpoNumber>& result,
                                     InstructionSequence* code) {
   if (!FLAG_turbo_jt) return;
 
-  Zone local_zone(code->zone()->isolate());
+  Zone local_zone;
   ZoneVector<bool> skip(static_cast<int>(result.size()), false, &local_zone);
 
   // Skip empty blocks when the previous block doesn't fall through.
index 6c668596d458fbfdfd2865ac7b573eee8201ad09..c24ae8873c74746198f177bc40679d1d75cfeb6d 100644 (file)
@@ -134,7 +134,7 @@ class LinkageHelper {
 
   // TODO(turbofan): cache call descriptors for code stub calls.
   static CallDescriptor* GetStubCallDescriptor(
-      Zone* zone, const CallInterfaceDescriptor& descriptor,
+      Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
       int stack_parameter_count, CallDescriptor::Flags flags,
       Operator::Properties properties) {
     const int register_parameter_count =
@@ -183,7 +183,7 @@ class LinkageHelper {
         properties,                       // properties
         kNoCalleeSaved,                   // callee-saved registers
         flags,                            // flags
-        descriptor.DebugName(zone->isolate()));
+        descriptor.DebugName(isolate));
   }
 
   static CallDescriptor* GetSimplifiedCDescriptor(Zone* zone,
index d786169a6e20e01a002037b0ffedaacb7273b1d9..dcc1aa7e4fe3f4ac5a1304e36d7eb5c0d7f62125 100644 (file)
@@ -42,22 +42,23 @@ CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) {
   if (info->function() != NULL) {
     // If we already have the function literal, use the number of parameters
     // plus the receiver.
-    return GetJSCallDescriptor(1 + info->function()->parameter_count(), zone,
+    return GetJSCallDescriptor(zone, 1 + info->function()->parameter_count(),
                                CallDescriptor::kNoFlags);
   }
   if (!info->closure().is_null()) {
     // If we are compiling a JS function, use a JS call descriptor,
     // plus the receiver.
     SharedFunctionInfo* shared = info->closure()->shared();
-    return GetJSCallDescriptor(1 + shared->formal_parameter_count(), zone,
+    return GetJSCallDescriptor(zone, 1 + shared->formal_parameter_count(),
                                CallDescriptor::kNoFlags);
   }
   if (info->code_stub() != NULL) {
     // Use the code stub interface descriptor.
     CallInterfaceDescriptor descriptor =
         info->code_stub()->GetCallInterfaceDescriptor();
-    return GetStubCallDescriptor(descriptor, 0, CallDescriptor::kNoFlags,
-                                 Operator::kNoProperties, zone);
+    return GetStubCallDescriptor(info->isolate(), zone, descriptor, 0,
+                                 CallDescriptor::kNoFlags,
+                                 Operator::kNoProperties);
   }
   return NULL;  // TODO(titzer): ?
 }
@@ -93,22 +94,22 @@ FrameOffset Linkage::GetFrameOffset(int spill_slot, Frame* frame,
 
 CallDescriptor* Linkage::GetJSCallDescriptor(
     int parameter_count, CallDescriptor::Flags flags) const {
-  return GetJSCallDescriptor(parameter_count, zone_, flags);
+  return GetJSCallDescriptor(zone_, parameter_count, flags);
 }
 
 
 CallDescriptor* Linkage::GetRuntimeCallDescriptor(
     Runtime::FunctionId function, int parameter_count,
     Operator::Properties properties) const {
-  return GetRuntimeCallDescriptor(function, parameter_count, properties, zone_);
+  return GetRuntimeCallDescriptor(zone_, function, parameter_count, properties);
 }
 
 
 CallDescriptor* Linkage::GetStubCallDescriptor(
     const CallInterfaceDescriptor& descriptor, int stack_parameter_count,
     CallDescriptor::Flags flags, Operator::Properties properties) const {
-  return GetStubCallDescriptor(descriptor, stack_parameter_count, flags,
-                               properties, zone_);
+  return GetStubCallDescriptor(isolate_, zone_, descriptor,
+                               stack_parameter_count, flags, properties);
 }
 
 
@@ -230,7 +231,8 @@ bool Linkage::NeedsFrameState(Runtime::FunctionId function) {
 // Provide unimplemented methods on unsupported architectures, to at least link.
 //==============================================================================
 #if !V8_TURBOFAN_BACKEND
-CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count, Zone* zone,
+CallDescriptor* Linkage::GetJSCallDescriptor(Isolate* isolate, Zone* zone,
+                                             int parameter_count,
                                              CallDescriptor::Flags flags) {
   UNIMPLEMENTED();
   return NULL;
index c0f143c0cd8efb2ac63c8f6977417bb88c780ae0..45baa300bc19cdeee367dc1159a7a343fac50222 100644 (file)
@@ -172,9 +172,11 @@ std::ostream& operator<<(std::ostream& os, const CallDescriptor::Kind& k);
 class Linkage : public ZoneObject {
  public:
   Linkage(Zone* zone, CompilationInfo* info)
-      : zone_(zone), incoming_(ComputeIncoming(zone, info)) {}
-  Linkage(Zone* zone, CallDescriptor* incoming)
-      : zone_(zone), incoming_(incoming) {}
+      : isolate_(info->isolate()),
+        zone_(zone),
+        incoming_(ComputeIncoming(zone, info)) {}
+  Linkage(Isolate* isolate, Zone* zone, CallDescriptor* incoming)
+      : isolate_(isolate), zone_(zone), incoming_(incoming) {}
 
   static CallDescriptor* ComputeIncoming(Zone* zone, CompilationInfo* info);
 
@@ -183,22 +185,23 @@ class Linkage : public ZoneObject {
   CallDescriptor* GetIncomingDescriptor() const { return incoming_; }
   CallDescriptor* GetJSCallDescriptor(int parameter_count,
                                       CallDescriptor::Flags flags) const;
-  static CallDescriptor* GetJSCallDescriptor(int parameter_count, Zone* zone,
+  static CallDescriptor* GetJSCallDescriptor(Zone* zone, int parameter_count,
                                              CallDescriptor::Flags flags);
   CallDescriptor* GetRuntimeCallDescriptor(
       Runtime::FunctionId function, int parameter_count,
       Operator::Properties properties) const;
   static CallDescriptor* GetRuntimeCallDescriptor(
-      Runtime::FunctionId function, int parameter_count,
-      Operator::Properties properties, Zone* zone);
+      Zone* zone, Runtime::FunctionId function, int parameter_count,
+      Operator::Properties properties);
 
   CallDescriptor* GetStubCallDescriptor(
       const CallInterfaceDescriptor& descriptor, int stack_parameter_count = 0,
       CallDescriptor::Flags flags = CallDescriptor::kNoFlags,
       Operator::Properties properties = Operator::kNoProperties) const;
   static CallDescriptor* GetStubCallDescriptor(
-      const CallInterfaceDescriptor& descriptor, int stack_parameter_count,
-      CallDescriptor::Flags flags, Operator::Properties properties, Zone* zone);
+      Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
+      int stack_parameter_count, CallDescriptor::Flags flags,
+      Operator::Properties properties);
 
   // Creates a call descriptor for simplified C calls that is appropriate
   // for the host platform. This simplified calling convention only supports
@@ -238,6 +241,7 @@ class Linkage : public ZoneObject {
   LinkageLocation GetOsrValueLocation(int index) const;
 
  private:
+  Isolate* isolate_;
   Zone* const zone_;
   CallDescriptor* const incoming_;
 
index 2b314a2280f588960861c36045cde1e8022ca4a9..50f3ca2555237b75c340ef51f2c5c88ab0888714 100644 (file)
@@ -35,25 +35,26 @@ struct MipsLinkageHelperTraits {
 
 typedef LinkageHelper<MipsLinkageHelperTraits> LH;
 
-CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count, Zone* zone,
+CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, int parameter_count,
                                              CallDescriptor::Flags flags) {
   return LH::GetJSCallDescriptor(zone, parameter_count, flags);
 }
 
 
 CallDescriptor* Linkage::GetRuntimeCallDescriptor(
-    Runtime::FunctionId function, int parameter_count,
-    Operator::Properties properties, Zone* zone) {
+    Zone* zone, Runtime::FunctionId function, int parameter_count,
+    Operator::Properties properties) {
   return LH::GetRuntimeCallDescriptor(zone, function, parameter_count,
                                       properties);
 }
 
 
 CallDescriptor* Linkage::GetStubCallDescriptor(
-    const CallInterfaceDescriptor& descriptor, int stack_parameter_count,
-    CallDescriptor::Flags flags, Operator::Properties properties, Zone* zone) {
-  return LH::GetStubCallDescriptor(zone, descriptor, stack_parameter_count,
-                                   flags, properties);
+    Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
+    int stack_parameter_count, CallDescriptor::Flags flags,
+    Operator::Properties properties) {
+  return LH::GetStubCallDescriptor(isolate, zone, descriptor,
+                                   stack_parameter_count, flags, properties);
 }
 
 
index e58c3965784fc6c2a1f8b5e0c45be1a0e612e8ec..0203a3587259fce6404def1455113fc3cb3e4cd9 100644 (file)
@@ -43,7 +43,7 @@ void PipelineStatistics::CommonStats::End(
 
 PipelineStatistics::PipelineStatistics(CompilationInfo* info,
                                        ZonePool* zone_pool)
-    : isolate_(info->zone()->isolate()),
+    : isolate_(info->isolate()),
       outer_zone_(info->zone()),
       zone_pool_(zone_pool),
       compilation_stats_(isolate_->GetTurboStatistics()),
index 5233045f1b7cc94263e3f752b1cb3553c2858cc3..218b06745fb74907ef3ae6fd7c2916bcd8661d91 100644 (file)
@@ -54,7 +54,7 @@ namespace compiler {
 class PipelineData {
  public:
   explicit PipelineData(ZonePool* zone_pool, CompilationInfo* info)
-      : isolate_(info->zone()->isolate()),
+      : isolate_(info->isolate()),
         info_(info),
         outer_zone_(nullptr),
         zone_pool_(zone_pool),
@@ -96,9 +96,9 @@ class PipelineData {
         InstructionSelector::SupportedMachineOperatorFlags());
     common_ = new (graph_zone()) CommonOperatorBuilder(graph_zone());
     javascript_ = new (graph_zone()) JSOperatorBuilder(graph_zone());
-    jsgraph_ =
-        new (graph_zone()) JSGraph(graph(), common(), javascript(), machine());
-    typer_.Reset(new Typer(graph(), info()->context()));
+    jsgraph_ = new (graph_zone())
+        JSGraph(info()->isolate(), graph(), common(), javascript(), machine());
+    typer_.Reset(new Typer(info()->isolate(), graph(), info()->context()));
     instruction_zone_ = instruction_zone_scope_.zone();
   }
 
@@ -197,8 +197,8 @@ class PipelineData {
     InstructionBlocks* instruction_blocks =
         InstructionSequence::InstructionBlocksFor(instruction_zone(),
                                                   schedule());
-    sequence_ = new (instruction_zone())
-        InstructionSequence(instruction_zone(), instruction_blocks);
+    sequence_ = new (instruction_zone()) InstructionSequence(
+        info()->isolate(), instruction_zone(), instruction_blocks);
   }
 
   void InitializeRegisterAllocator(Zone* local_zone,
@@ -785,7 +785,7 @@ Handle<Code> Pipeline::GenerateCode() {
     return Handle<Code>::null();
   }
 
-  ZonePool zone_pool(isolate());
+  ZonePool zone_pool;
   SmartPointer<PipelineStatistics> pipeline_statistics;
 
   if (FLAG_turbo_stats) {
@@ -924,10 +924,11 @@ Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
 }
 
 
-Handle<Code> Pipeline::GenerateCodeForTesting(CallDescriptor* call_descriptor,
+Handle<Code> Pipeline::GenerateCodeForTesting(Isolate* isolate,
+                                              CallDescriptor* call_descriptor,
                                               Graph* graph,
                                               Schedule* schedule) {
-  CompilationInfo info(graph->zone()->isolate(), graph->zone());
+  CompilationInfo info(isolate, graph->zone());
   return GenerateCodeForTesting(&info, call_descriptor, graph, schedule);
 }
 
@@ -937,7 +938,7 @@ Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
                                               Graph* graph,
                                               Schedule* schedule) {
   CHECK(SupportedBackend());
-  ZonePool zone_pool(info->isolate());
+  ZonePool zone_pool;
   Pipeline pipeline(info);
   PipelineData data(&zone_pool, info);
   pipeline.data_ = &data;
@@ -950,7 +951,7 @@ Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
     TraceSchedule(schedule);
   }
 
-  Linkage linkage(info->zone(), call_descriptor);
+  Linkage linkage(info->isolate(), info->zone(), call_descriptor);
   pipeline.GenerateCode(&linkage);
   Handle<Code> code = data.code();
 
@@ -968,8 +969,8 @@ Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
 bool Pipeline::AllocateRegistersForTesting(const RegisterConfiguration* config,
                                            InstructionSequence* sequence,
                                            bool run_verifier) {
-  CompilationInfo info(sequence->zone()->isolate(), sequence->zone());
-  ZonePool zone_pool(sequence->zone()->isolate());
+  CompilationInfo info(sequence->isolate(), sequence->zone());
+  ZonePool zone_pool;
   PipelineData data(&zone_pool, &info);
   data.InitializeTorTesting(sequence);
   Pipeline pipeline(&info);
@@ -1044,7 +1045,7 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config,
   SmartPointer<Zone> verifier_zone;
   RegisterAllocatorVerifier* verifier = nullptr;
   if (run_verifier) {
-    verifier_zone.Reset(new Zone(info()->isolate()));
+    verifier_zone.Reset(new Zone());
     verifier = new (verifier_zone.get()) RegisterAllocatorVerifier(
         verifier_zone.get(), config, data->sequence());
   }
index 59070d4a9e0be43761c494a85002810a5d3810aa..03d889b0b02581f06eab006806706a51a145c66c 100644 (file)
@@ -37,7 +37,8 @@ class Pipeline {
 
   // Run the pipeline on a machine graph and generate code. If {schedule} is
   // {nullptr}, then compute a new schedule for code generation.
-  static Handle<Code> GenerateCodeForTesting(CallDescriptor* call_descriptor,
+  static Handle<Code> GenerateCodeForTesting(Isolate* isolate,
+                                             CallDescriptor* call_descriptor,
                                              Graph* graph,
                                              Schedule* schedule = nullptr);
 
index b93ec66338a228b919d25b40d0f140be7d47bfa4..3c7bfa73cdc378400aab084653e84cf46243ce41 100644 (file)
@@ -11,11 +11,11 @@ namespace v8 {
 namespace internal {
 namespace compiler {
 
-RawMachineAssembler::RawMachineAssembler(Graph* graph,
+RawMachineAssembler::RawMachineAssembler(Isolate* isolate, Graph* graph,
                                          MachineSignature* machine_sig,
                                          MachineType word,
                                          MachineOperatorBuilder::Flags flags)
-    : GraphBuilder(graph),
+    : GraphBuilder(isolate, graph),
       schedule_(new (zone()) Schedule(zone())),
       machine_(zone(), word, flags),
       common_(zone()),
@@ -87,8 +87,8 @@ Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver,
                                              CallFunctionFlags flags) {
   Callable callable = CodeFactory::CallFunction(isolate(), 0, flags);
   CallDescriptor* desc = Linkage::GetStubCallDescriptor(
-      callable.descriptor(), 1, CallDescriptor::kNeedsFrameState,
-      Operator::kNoProperties, zone());
+      isolate(), zone(), callable.descriptor(), 1,
+      CallDescriptor::kNeedsFrameState, Operator::kNoProperties);
   Node* stub_code = HeapConstant(callable.code());
   Node* call = graph()->NewNode(common()->Call(desc), stub_code, function,
                                 receiver, context, frame_state);
@@ -100,7 +100,7 @@ Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver,
 Node* RawMachineAssembler::CallJS0(Node* function, Node* receiver,
                                    Node* context, Node* frame_state) {
   CallDescriptor* descriptor =
-      Linkage::GetJSCallDescriptor(1, zone(), CallDescriptor::kNeedsFrameState);
+      Linkage::GetJSCallDescriptor(zone(), 1, CallDescriptor::kNeedsFrameState);
   Node* call = graph()->NewNode(common()->Call(descriptor), function, receiver,
                                 context, frame_state);
   schedule()->AddNode(CurrentBlock(), call);
@@ -112,7 +112,7 @@ Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function,
                                         Node* arg0, Node* context,
                                         Node* frame_state) {
   CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor(
-      function, 1, Operator::kNoProperties, zone());
+      zone(), function, 1, Operator::kNoProperties);
 
   Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode());
   Node* ref = NewNode(
index 5455814fa206e7e41b6043cf66a230ada384ccb4..7b4644497ea9feb1c85047e0b4be74bc51efa024 100644 (file)
@@ -44,13 +44,13 @@ class RawMachineAssembler : public GraphBuilder {
     DISALLOW_COPY_AND_ASSIGN(Label);
   };
 
-  RawMachineAssembler(Graph* graph, MachineSignature* machine_sig,
+  RawMachineAssembler(Isolate* isolate, Graph* graph,
+                      MachineSignature* machine_sig,
                       MachineType word = kMachPtr,
                       MachineOperatorBuilder::Flags flags =
                           MachineOperatorBuilder::Flag::kNoFlags);
   ~RawMachineAssembler() OVERRIDE {}
 
-  Isolate* isolate() const { return zone()->isolate(); }
   Zone* zone() const { return graph()->zone(); }
   MachineOperatorBuilder* machine() { return &machine_; }
   CommonOperatorBuilder* common() { return &common_; }
index edecf58fb84f148b22f005f62860c2469fb5bf1a..2e0f0d1a343811a82a2a2359306a5a3f63c1c5a5 100644 (file)
@@ -62,7 +62,7 @@ Reduction SelectLowering::Reduce(Node* node) {
 bool SelectLowering::ReachableFrom(Node* const sink, Node* const source) {
   // TODO(turbofan): This is probably horribly expensive, and it should be moved
   // into node.h or somewhere else?!
-  Zone zone(graph()->zone()->isolate());
+  Zone zone;
   std::queue<Node*, NodeDeque> queue((NodeDeque(&zone)));
   BoolVector visited(graph()->NodeCount(), false, &zone);
   queue.push(source);
index d7157f6bf04005be6feaf2396bdf25454fade664..e334d1faefca41cffcc6172d445884b0c9f6b39e 100644 (file)
@@ -76,7 +76,7 @@ class RepresentationSelector {
         queue_(zone) {
     memset(info_, 0, sizeof(NodeInfo) * count_);
 
-    Factory* f = zone->isolate()->factory();
+    Factory* f = jsgraph->isolate()->factory();
     safe_int_additive_range_ =
         Type::Range(f->NewNumber(-std::pow(2.0, 52.0)),
                     f->NewNumber(std::pow(2.0, 52.0)), zone);
@@ -530,7 +530,8 @@ class RepresentationSelector {
               jsgraph_->isolate(), ToBooleanStub::RESULT_AS_ODDBALL);
           CallDescriptor::Flags flags = CallDescriptor::kPatchableCallSite;
           CallDescriptor* desc = Linkage::GetStubCallDescriptor(
-              callable.descriptor(), 0, flags, properties, jsgraph_->zone());
+              jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0,
+              flags, properties);
           node->set_op(jsgraph_->common()->Call(desc));
           node->InsertInput(jsgraph_->zone(), 0,
                             jsgraph_->HeapConstant(callable.code()));
@@ -740,7 +741,8 @@ class RepresentationSelector {
           Callable callable = CodeFactory::ToNumber(jsgraph_->isolate());
           CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
           CallDescriptor* desc = Linkage::GetStubCallDescriptor(
-              callable.descriptor(), 0, flags, properties, jsgraph_->zone());
+              jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0,
+              flags, properties);
           node->set_op(jsgraph_->common()->Call(desc));
           node->InsertInput(jsgraph_->zone(), 0,
                             jsgraph_->HeapConstant(callable.code()));
@@ -1089,8 +1091,7 @@ Node* SimplifiedLowering::IsTagged(Node* node) {
 
 void SimplifiedLowering::LowerAllNodes() {
   SimplifiedOperatorBuilder simplified(graph()->zone());
-  RepresentationChanger changer(jsgraph(), &simplified,
-                                graph()->zone()->isolate());
+  RepresentationChanger changer(jsgraph(), &simplified, jsgraph()->isolate());
   RepresentationSelector selector(jsgraph(), zone_, &changer);
   selector.Run(this);
 }
@@ -1255,10 +1256,11 @@ void SimplifiedLowering::DoStoreElement(Node* node) {
 void SimplifiedLowering::DoStringAdd(Node* node) {
   Operator::Properties properties = node->op()->properties();
   Callable callable = CodeFactory::StringAdd(
-      zone()->isolate(), STRING_ADD_CHECK_NONE, NOT_TENURED);
+      jsgraph()->isolate(), STRING_ADD_CHECK_NONE, NOT_TENURED);
   CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
   CallDescriptor* desc = Linkage::GetStubCallDescriptor(
-      callable.descriptor(), 0, flags, properties, zone());
+      jsgraph()->isolate(), zone(), callable.descriptor(), 0, flags,
+      properties);
   node->set_op(common()->Call(desc));
   node->InsertInput(graph()->zone(), 0,
                     jsgraph()->HeapConstant(callable.code()));
@@ -1269,14 +1271,14 @@ void SimplifiedLowering::DoStringAdd(Node* node) {
 
 
 Node* SimplifiedLowering::StringComparison(Node* node, bool requires_ordering) {
-  CEntryStub stub(zone()->isolate(), 1);
+  CEntryStub stub(jsgraph()->isolate(), 1);
   Runtime::FunctionId f =
       requires_ordering ? Runtime::kStringCompare : Runtime::kStringEquals;
-  ExternalReference ref(f, zone()->isolate());
+  ExternalReference ref(f, jsgraph()->isolate());
   Operator::Properties props = node->op()->properties();
   // TODO(mstarzinger): We should call StringCompareStub here instead, once an
   // interface descriptor is available for it.
-  CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor(f, 2, props, zone());
+  CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor(zone(), f, 2, props);
   return graph()->NewNode(common()->Call(desc),
                           jsgraph()->HeapConstant(stub.GetCode()),
                           NodeProperties::GetValueInput(node, 0),
index 737dffaa0e377d9eadf3daddc55c4595f5467ca6..4b3a8830a0fff9cbed6694b9588742225d262814 100644 (file)
@@ -45,7 +45,8 @@ enum LazyCachedType {
 // TODO(turbofan): these types could be globally cached or cached per isolate.
 class LazyTypeCache FINAL : public ZoneObject {
  public:
-  explicit LazyTypeCache(Zone* zone) : zone_(zone) {
+  explicit LazyTypeCache(Isolate* isolate, Zone* zone)
+      : isolate_(isolate), zone_(zone) {
     memset(cache_, 0, sizeof(cache_));
   }
 
@@ -133,10 +134,11 @@ class LazyTypeCache FINAL : public ZoneObject {
   }
 
   Factory* factory() const { return isolate()->factory(); }
-  Isolate* isolate() const { return zone()->isolate(); }
+  Isolate* isolate() const { return isolate_; }
   Zone* zone() const { return zone_; }
 
   Type* cache_[kNumLazyCachedTypes];
+  Isolate* isolate_;
   Zone* zone_;
 };
 
@@ -151,15 +153,16 @@ class Typer::Decorator FINAL : public GraphDecorator {
 };
 
 
-Typer::Typer(Graph* graph, MaybeHandle<Context> context)
-    : graph_(graph),
+Typer::Typer(Isolate* isolate, Graph* graph, MaybeHandle<Context> context)
+    : isolate_(isolate),
+      graph_(graph),
       context_(context),
       decorator_(NULL),
-      cache_(new (graph->zone()) LazyTypeCache(graph->zone())),
+      cache_(new (graph->zone()) LazyTypeCache(isolate, graph->zone())),
       weaken_min_limits_(graph->zone()),
       weaken_max_limits_(graph->zone()) {
   Zone* zone = this->zone();
-  Factory* f = zone->isolate()->factory();
+  Factory* f = isolate->factory();
 
   Handle<Object> zero = f->NewNumber(0);
   Handle<Object> one = f->NewNumber(1);
index b65a9a5aff09edb1c5a13f4cc1df494b70d4e574..ad488afd54e9f7ebbd8abaddb5ecb24514c6abae 100644 (file)
@@ -21,7 +21,7 @@ class LazyTypeCache;
 
 class Typer {
  public:
-  explicit Typer(Graph* graph, MaybeHandle<Context> context);
+  Typer(Isolate* isolate, Graph* graph, MaybeHandle<Context> context);
   ~Typer();
 
   void Run();
@@ -29,12 +29,13 @@ class Typer {
   Graph* graph() { return graph_; }
   MaybeHandle<Context> context() { return context_; }
   Zone* zone() { return graph_->zone(); }
-  Isolate* isolate() { return zone()->isolate(); }
+  Isolate* isolate() { return isolate_; }
 
  private:
   class Visitor;
   class Decorator;
 
+  Isolate* isolate_;
   Graph* graph_;
   MaybeHandle<Context> context_;
   Decorator* decorator_;
index 82700f3fe59c0b8e5b1f68687862b40a0197fb3b..b2871ecbaf9ab6c01d4f9a6c21e802abe230c240 100644 (file)
@@ -829,7 +829,7 @@ static void CheckInputsDominate(Schedule* schedule, BasicBlock* block,
 
 void ScheduleVerifier::Run(Schedule* schedule) {
   const size_t count = schedule->BasicBlockCount();
-  Zone tmp_zone(schedule->zone()->isolate());
+  Zone tmp_zone;
   Zone* zone = &tmp_zone;
   BasicBlock* start = schedule->start();
   BasicBlockVector* rpo_order = schedule->rpo_order();
index 0b76cc783c98ec02053773b87bd9f21d188c30e2..5cb8d46db0e0112f17e3652134dd9b501e1f8076 100644 (file)
@@ -49,25 +49,26 @@ struct X64LinkageHelperTraits {
 
 typedef LinkageHelper<X64LinkageHelperTraits> LH;
 
-CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count, Zone* zone,
+CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, int parameter_count,
                                              CallDescriptor::Flags flags) {
   return LH::GetJSCallDescriptor(zone, parameter_count, flags);
 }
 
 
 CallDescriptor* Linkage::GetRuntimeCallDescriptor(
-    Runtime::FunctionId function, int parameter_count,
-    Operator::Properties properties, Zone* zone) {
+    Zone* zone, Runtime::FunctionId function, int parameter_count,
+    Operator::Properties properties) {
   return LH::GetRuntimeCallDescriptor(zone, function, parameter_count,
                                       properties);
 }
 
 
 CallDescriptor* Linkage::GetStubCallDescriptor(
-    const CallInterfaceDescriptor& descriptor, int stack_parameter_count,
-    CallDescriptor::Flags flags, Operator::Properties properties, Zone* zone) {
-  return LH::GetStubCallDescriptor(zone, descriptor, stack_parameter_count,
-                                   flags, properties);
+    Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
+    int stack_parameter_count, CallDescriptor::Flags flags,
+    Operator::Properties properties) {
+  return LH::GetStubCallDescriptor(isolate, zone, descriptor,
+                                   stack_parameter_count, flags, properties);
 }
 
 
index 179988d418f15a469b775a26a2d72065f2a4ad72..05907a969d9c56d5391634ae745ebf8869eb818d 100644 (file)
@@ -65,8 +65,7 @@ void ZonePool::StatsScope::ZoneReturned(Zone* zone) {
 }
 
 
-ZonePool::ZonePool(Isolate* isolate)
-    : isolate_(isolate), max_allocated_bytes_(0), total_deleted_bytes_(0) {}
+ZonePool::ZonePool() : max_allocated_bytes_(0), total_deleted_bytes_(0) {}
 
 
 ZonePool::~ZonePool() {
@@ -104,7 +103,7 @@ Zone* ZonePool::NewEmptyZone() {
     zone = unused_.back();
     unused_.pop_back();
   } else {
-    zone = new Zone(isolate_);
+    zone = new Zone();
   }
   used_.push_back(zone);
   DCHECK_EQ(0, zone->allocation_size());
index 8b43265c1a8ae24605de403c82642243568ecad7..d2fbbbd92f716e1f438a63c64f1f8d0750a61dad 100644 (file)
@@ -60,7 +60,7 @@ class ZonePool FINAL {
     DISALLOW_COPY_AND_ASSIGN(StatsScope);
   };
 
-  explicit ZonePool(Isolate* isolate);
+  ZonePool();
   ~ZonePool();
 
   size_t GetMaxAllocatedBytes();
@@ -76,7 +76,6 @@ class ZonePool FINAL {
   typedef std::vector<Zone*> Used;
   typedef std::vector<StatsScope*> Stats;
 
-  Isolate* const isolate_;
   Unused unused_;
   Used used_;
   Stats stats_;
index 748f95eff7c275c5b467b25bdb087c0a1df1b557..7ddd92886172e69c4d65a5b48786244b33abb12c 100644 (file)
@@ -367,7 +367,7 @@ void Deoptimizer::DeoptimizeMarkedCodeForContext(Context* context) {
 
   // Move marked code from the optimized code list to the deoptimized
   // code list, collecting them into a ZoneList.
-  Zone zone(isolate);
+  Zone zone;
   ZoneList<Code*> codes(10, &zone);
 
   // Walk over all optimized code objects in this native context.
index 86b781e20a5486957139f378b2976ed025c5c4b1..42941d88abcfcf2bb948ca57959fcf4b6e59b9fa 100644 (file)
@@ -420,7 +420,7 @@ void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) {
 
 
 void FullCodeGenerator::Initialize() {
-  InitializeAstVisitor(info_->zone());
+  InitializeAstVisitor(info_->isolate(), info_->zone());
   // The generation of debug code must match between the snapshot code and the
   // code that is generated later.  This is assumed by the debugger when it is
   // calculating PC offsets after generating a debug version of code.  Therefore
@@ -837,7 +837,7 @@ void FullCodeGenerator::SetStatementPosition(Statement* stmt) {
   } else {
     // Check if the statement will be breakable without adding a debug break
     // slot.
-    BreakableStatementChecker checker(zone());
+    BreakableStatementChecker checker(info_->isolate(), zone());
     checker.Check(stmt);
     // Record the statement position right here if the statement is not
     // breakable. For breakable statements the actual recording of the
@@ -864,7 +864,7 @@ void FullCodeGenerator::SetExpressionPosition(Expression* expr) {
   } else {
     // Check if the expression will be breakable without adding a debug break
     // slot.
-    BreakableStatementChecker checker(zone());
+    BreakableStatementChecker checker(info_->isolate(), 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 c431e10213daf983e44df21549a46a4f2ea183bf..f544b7f29833a11e6748476843c194f553f4f5cc 100644 (file)
@@ -29,8 +29,9 @@ class JumpPatchSite;
 // debugger to piggybag on.
 class BreakableStatementChecker: public AstVisitor {
  public:
-  explicit BreakableStatementChecker(Zone* zone) : is_breakable_(false) {
-    InitializeAstVisitor(zone);
+  BreakableStatementChecker(Isolate* isolate, Zone* zone)
+      : is_breakable_(false) {
+    InitializeAstVisitor(isolate, zone);
   }
 
   void Check(Statement* stmt);
index a19fb51dd7ab49306f50c3e0f26eba9d9f9694ba..69b48d664486fb1a597bdc1d83efb4bec2468bad 100644 (file)
@@ -1918,7 +1918,7 @@ static void UnregisterCodeEntry(JITCodeEntry* entry) {
 
 static JITCodeEntry* CreateELFObject(CodeDescription* desc, Isolate* isolate) {
 #ifdef __MACH_O
-  Zone zone(isolate);
+  Zone zone;
   MachO mach_o(&zone);
   Writer w(&mach_o);
 
@@ -1930,7 +1930,7 @@ static JITCodeEntry* CreateELFObject(CodeDescription* desc, Isolate* isolate) {
 
   mach_o.Write(&w, desc->CodeStart(), desc->CodeSize());
 #else
-  Zone zone(isolate);
+  Zone zone;
   ELF elf(&zone);
   Writer w(&elf);
 
@@ -2127,7 +2127,7 @@ void GDBJITInterface::RemoveCode(Code* code) {
 
 void GDBJITInterface::RemoveCodeRange(Address start, Address end) {
   HashMap* entries = GetEntries();
-  Zone zone(Isolate::Current());
+  Zone zone;
   ZoneList<Code*> dead_codes(1, &zone);
 
   for (HashMap::Entry* e = entries->Start(); e != NULL; e = entries->Next(e)) {
index 2feb1587f8ef6344b6b07072f0a9a3a7966e6ad7..875c18c3f9e9d642a8845a2d2e92c4b6649961f0 100644 (file)
@@ -253,7 +253,7 @@ class InductionVariableBlocksTable BASE_EMBEDDED {
     HValue* context = graph()->GetInvalidContext();
     HValue* limit = data->limit();
     if (has_upper_constant_limit) {
-      HConstant* new_limit = HConstant::New(zone, context,
+      HConstant* new_limit = HConstant::New(graph()->isolate(), zone, context,
                                             upper_constant_limit);
       new_limit->InsertBefore(pre_header->end());
       limit = new_limit;
@@ -263,7 +263,7 @@ class InductionVariableBlocksTable BASE_EMBEDDED {
     if (limit->IsInteger32Constant() &&
         limit->block() != pre_header &&
         !limit->block()->Dominates(pre_header)) {
-      HConstant* new_limit = HConstant::New(zone, context,
+      HConstant* new_limit = HConstant::New(graph()->isolate(), zone, context,
                                             limit->GetInteger32Constant());
       new_limit->InsertBefore(pre_header->end());
       limit = new_limit;
@@ -271,7 +271,7 @@ class InductionVariableBlocksTable BASE_EMBEDDED {
 
     // Do the hoisting.
     HBoundsCheck* hoisted_check = HBoundsCheck::New(
-        zone, context, limit, check->check()->length());
+        graph()->isolate(), zone, context, limit, check->check()->length());
     hoisted_check->InsertBefore(pre_header->end());
     hoisted_check->set_allow_equality(true);
     counters()->bounds_checks_hoisted()->Increment();
index 3b0f15870fa3696320982cacef4fae0add81a0a3..e22dd8883132de89d7a05e483a311303daaa8f30 100644 (file)
@@ -131,8 +131,8 @@ HValue* HEscapeAnalysisPhase::NewMapCheckAndInsert(HCapturedObject* state,
   HValue* value = state->map_value();
   // TODO(mstarzinger): This will narrow a map check against a set of maps
   // down to the first element in the set. Revisit and fix this.
-  HCheckValue* check = HCheckValue::New(
-      zone, NULL, value, mapcheck->maps()->at(0), false);
+  HCheckValue* check = HCheckValue::New(graph()->isolate(), zone, NULL, value,
+                                        mapcheck->maps()->at(0), false);
   check->InsertBefore(mapcheck);
   return check;
 }
@@ -146,8 +146,8 @@ HValue* HEscapeAnalysisPhase::NewLoadReplacement(
   Representation representation = load->representation();
   if (representation.IsSmiOrInteger32() || representation.IsDouble()) {
     Zone* zone = graph()->zone();
-    HInstruction* new_instr =
-        HForceRepresentation::New(zone, NULL, load_value, representation);
+    HInstruction* new_instr = HForceRepresentation::New(
+        graph()->isolate(), zone, NULL, load_value, representation);
     new_instr->InsertAfter(load);
     replacement = new_instr;
   }
index 20d67100552a370305bf73d49e8fa6ca0f51a2b9..26188a2aea7ae8ad943dfdb89728b9e7db3d22ef 100644 (file)
@@ -942,17 +942,15 @@ std::ostream& HCallJSFunction::PrintDataTo(std::ostream& os) const {  // NOLINT
 }
 
 
-HCallJSFunction* HCallJSFunction::New(
-    Zone* zone,
-    HValue* context,
-    HValue* function,
-    int argument_count,
-    bool pass_argument_count) {
+HCallJSFunction* HCallJSFunction::New(Isolate* isolate, Zone* zone,
+                                      HValue* context, HValue* function,
+                                      int argument_count,
+                                      bool pass_argument_count) {
   bool has_stack_check = false;
   if (function->IsConstant()) {
     HConstant* fun_const = HConstant::cast(function);
     Handle<JSFunction> jsfun =
-        Handle<JSFunction>::cast(fun_const->handle(zone->isolate()));
+        Handle<JSFunction>::cast(fun_const->handle(isolate));
     has_stack_check = !jsfun.is_null() &&
         (jsfun->code()->kind() == Code::FUNCTION ||
          jsfun->code()->kind() == Code::OPTIMIZED_FUNCTION);
@@ -989,13 +987,16 @@ void HBoundsCheck::ApplyIndexChange() {
   int actual_offset = decomposition.offset() + offset();
   int actual_scale = decomposition.scale() + scale();
 
-  Zone* zone = block()->graph()->zone();
-  HValue* context = block()->graph()->GetInvalidContext();
+  HGraph* graph = block()->graph();
+  Isolate* isolate = graph->isolate();
+  Zone* zone = graph->zone();
+  HValue* context = graph->GetInvalidContext();
   if (actual_offset != 0) {
-    HConstant* add_offset = HConstant::New(zone, context, actual_offset);
+    HConstant* add_offset =
+        HConstant::New(isolate, zone, context, actual_offset);
     add_offset->InsertBefore(this);
-    HInstruction* add = HAdd::New(zone, context,
-                                  current_index, add_offset);
+    HInstruction* add =
+        HAdd::New(isolate, zone, context, current_index, add_offset);
     add->InsertBefore(this);
     add->AssumeRepresentation(index()->representation());
     add->ClearFlag(kCanOverflow);
@@ -1003,10 +1004,10 @@ void HBoundsCheck::ApplyIndexChange() {
   }
 
   if (actual_scale != 0) {
-    HConstant* sar_scale = HConstant::New(zone, context, actual_scale);
+    HConstant* sar_scale = HConstant::New(isolate, zone, context, actual_scale);
     sar_scale->InsertBefore(this);
-    HInstruction* sar = HSar::New(zone, context,
-                                  current_index, sar_scale);
+    HInstruction* sar =
+        HSar::New(isolate, zone, context, current_index, sar_scale);
     sar->InsertBefore(this);
     sar->AssumeRepresentation(index()->representation());
     current_index = sar;
@@ -1522,8 +1523,9 @@ std::ostream& HTypeof::PrintDataTo(std::ostream& os) const {  // NOLINT
 }
 
 
-HInstruction* HForceRepresentation::New(Zone* zone, HValue* context,
-       HValue* value, Representation representation) {
+HInstruction* HForceRepresentation::New(Isolate* isolate, Zone* zone,
+                                        HValue* context, HValue* value,
+                                        Representation representation) {
   if (FLAG_fold_constants && value->IsConstant()) {
     HConstant* c = HConstant::cast(value);
     c = c->CopyToRepresentation(representation, zone);
@@ -1595,7 +1597,7 @@ HValue* HUnaryMathOperation::Canonicalize() {
     }
 
     return Prepend(HMathFloorOfDiv::New(
-        block()->zone(), context(), left, right));
+        block()->graph()->isolate(), block()->zone(), context(), left, right));
   }
   return this;
 }
@@ -2122,7 +2124,8 @@ void InductionVariableData::ChecksRelatedToLength::UseNewIndexInCurrentBlock(
   DCHECK(context != NULL);
 
   Zone* zone = index_base->block()->graph()->zone();
-  set_added_constant(HConstant::New(zone, context, mask));
+  Isolate* isolate = index_base->block()->graph()->isolate();
+  set_added_constant(HConstant::New(isolate, zone, context, mask));
   if (added_index() != NULL) {
     added_constant()->InsertBefore(added_index());
   } else {
@@ -2131,8 +2134,8 @@ void InductionVariableData::ChecksRelatedToLength::UseNewIndexInCurrentBlock(
 
   if (added_index() == NULL) {
     first_check_in_block()->ReplaceAllUsesWith(first_check_in_block()->index());
-    HInstruction* new_index =  HBitwise::New(zone, context, token, index_base,
-                                             added_constant());
+    HInstruction* new_index = HBitwise::New(isolate, zone, context, token,
+                                            index_base, added_constant());
     DCHECK(new_index->IsBitwise());
     new_index->ClearAllSideEffects();
     new_index->AssumeRepresentation(Representation::Integer32());
@@ -2951,9 +2954,10 @@ Maybe<HConstant*> HConstant::CopyToTruncatedInt32(Zone* zone) {
 }
 
 
-Maybe<HConstant*> HConstant::CopyToTruncatedNumber(Zone* zone) {
+Maybe<HConstant*> HConstant::CopyToTruncatedNumber(Isolate* isolate,
+                                                   Zone* zone) {
   HConstant* res = NULL;
-  Handle<Object> handle = this->handle(zone->isolate());
+  Handle<Object> handle = this->handle(isolate);
   if (handle->IsBoolean()) {
     res = handle->BooleanValue() ?
       new(zone) HConstant(1) : new(zone) HConstant(0);
@@ -3552,18 +3556,14 @@ HValue* HLoadKeyedGeneric::Canonicalize() {
       if (names_cache->enumerable() == object()) {
         HForInCacheArray* index_cache =
             names_cache->index_cache();
-        HCheckMapValue* map_check =
-            HCheckMapValue::New(block()->graph()->zone(),
-                                block()->graph()->GetInvalidContext(),
-                                object(),
-                                names_cache->map());
+        HCheckMapValue* map_check = HCheckMapValue::New(
+            block()->graph()->isolate(), block()->graph()->zone(),
+            block()->graph()->GetInvalidContext(), object(),
+            names_cache->map());
         HInstruction* index = HLoadKeyed::New(
-            block()->graph()->zone(),
-            block()->graph()->GetInvalidContext(),
-            index_cache,
-            key_load->key(),
-            key_load->key(),
-            key_load->elements_kind());
+            block()->graph()->isolate(), block()->graph()->zone(),
+            block()->graph()->GetInvalidContext(), index_cache, key_load->key(),
+            key_load->key(), key_load->elements_kind());
         map_check->InsertBefore(this);
         index->InsertBefore(this);
         return Prepend(new(block()->zone()) HLoadFieldByIndex(
@@ -3726,6 +3726,7 @@ bool HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
                                           HValue* dominator) {
   DCHECK(side_effect == kNewSpacePromotion);
   Zone* zone = block()->zone();
+  Isolate* isolate = block()->isolate();
   if (!FLAG_use_allocation_folding) return false;
 
   // Try to fold allocations together with their dominating allocations.
@@ -3827,25 +3828,19 @@ bool HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
   HInstruction* new_dominator_size_value;
 
   if (current_size->IsInteger32Constant()) {
-    new_dominator_size_value =
-        HConstant::CreateAndInsertBefore(zone,
-                                         context(),
-                                         new_dominator_size,
-                                         Representation::None(),
-                                         dominator_allocate);
+    new_dominator_size_value = HConstant::CreateAndInsertBefore(
+        isolate, zone, context(), new_dominator_size, Representation::None(),
+        dominator_allocate);
   } else {
-    HValue* new_dominator_size_constant =
-        HConstant::CreateAndInsertBefore(zone,
-                                         context(),
-                                         dominator_size_constant,
-                                         Representation::Integer32(),
-                                         dominator_allocate);
+    HValue* new_dominator_size_constant = HConstant::CreateAndInsertBefore(
+        isolate, zone, context(), dominator_size_constant,
+        Representation::Integer32(), dominator_allocate);
 
     // Add old and new size together and insert.
     current_size->ChangeRepresentation(Representation::Integer32());
 
-    new_dominator_size_value = HAdd::New(zone, context(),
-        new_dominator_size_constant, current_size);
+    new_dominator_size_value = HAdd::New(
+        isolate, zone, context(), new_dominator_size_constant, current_size);
     new_dominator_size_value->ClearFlag(HValue::kCanOverflow);
     new_dominator_size_value->ChangeRepresentation(Representation::Integer32());
 
@@ -3877,18 +3872,11 @@ bool HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
 
   // After that replace the dominated allocate instruction.
   HInstruction* inner_offset = HConstant::CreateAndInsertBefore(
-      zone,
-      context(),
-      dominator_size_constant,
-      Representation::None(),
+      isolate, zone, context(), dominator_size_constant, Representation::None(),
       this);
 
-  HInstruction* dominated_allocate_instr =
-      HInnerAllocatedObject::New(zone,
-                                 context(),
-                                 dominator_allocate,
-                                 inner_offset,
-                                 type());
+  HInstruction* dominated_allocate_instr = HInnerAllocatedObject::New(
+      isolate, zone, context(), dominator_allocate, inner_offset, type());
   dominated_allocate_instr->InsertBefore(this);
   DeleteAndReplaceWith(dominated_allocate_instr);
   if (FLAG_trace_allocation_folding) {
@@ -3971,43 +3959,43 @@ void HAllocate::UpdateFreeSpaceFiller(int32_t free_space_size) {
   // would otherwise automatically choose int32, but the actual store
   // requires a Smi-tagged value.
   HConstant* new_free_space_size = HConstant::CreateAndInsertBefore(
-      zone,
-      context(),
+      block()->isolate(), zone, context(),
       filler_free_space_size_->value()->GetInteger32Constant() +
           free_space_size,
-      Representation::Smi(),
-      filler_free_space_size_);
+      Representation::Smi(), filler_free_space_size_);
   filler_free_space_size_->UpdateValue(new_free_space_size);
 }
 
 
 void HAllocate::CreateFreeSpaceFiller(int32_t free_space_size) {
   DCHECK(filler_free_space_size_ == NULL);
+  Isolate* isolate = block()->isolate();
   Zone* zone = block()->zone();
   HInstruction* free_space_instr =
-      HInnerAllocatedObject::New(zone, context(), dominating_allocate_,
-      dominating_allocate_->size(), type());
+      HInnerAllocatedObject::New(isolate, zone, context(), dominating_allocate_,
+                                 dominating_allocate_->size(), type());
   free_space_instr->InsertBefore(this);
   HConstant* filler_map = HConstant::CreateAndInsertAfter(
-      zone, Unique<Map>::CreateImmovable(
-          isolate()->factory()->free_space_map()), true, free_space_instr);
-  HInstruction* store_map = HStoreNamedField::New(zone, context(),
-      free_space_instr, HObjectAccess::ForMap(), filler_map);
+      zone, Unique<Map>::CreateImmovable(isolate->factory()->free_space_map()),
+      true, free_space_instr);
+  HInstruction* store_map =
+      HStoreNamedField::New(isolate, zone, context(), free_space_instr,
+                            HObjectAccess::ForMap(), filler_map);
   store_map->SetFlag(HValue::kHasNoObservableSideEffects);
   store_map->InsertAfter(filler_map);
 
   // We must explicitly force Smi representation here because on x64 we
   // would otherwise automatically choose int32, but the actual store
   // requires a Smi-tagged value.
-  HConstant* filler_size = HConstant::CreateAndInsertAfter(
-      zone, context(), free_space_size, Representation::Smi(), store_map);
+  HConstant* filler_size =
+      HConstant::CreateAndInsertAfter(isolate, zone, context(), free_space_size,
+                                      Representation::Smi(), store_map);
   // Must force Smi representation for x64 (see comment above).
-  HObjectAccess access =
-      HObjectAccess::ForMapAndOffset(isolate()->factory()->free_space_map(),
-                                     FreeSpace::kSizeOffset,
-                                     Representation::Smi());
-  HStoreNamedField* store_size = HStoreNamedField::New(zone, context(),
-      free_space_instr, access, filler_size);
+  HObjectAccess access = HObjectAccess::ForMapAndOffset(
+      isolate->factory()->free_space_map(), FreeSpace::kSizeOffset,
+      Representation::Smi());
+  HStoreNamedField* store_size = HStoreNamedField::New(
+      isolate, zone, context(), free_space_instr, access, filler_size);
   store_size->SetFlag(HValue::kHasNoObservableSideEffects);
   store_size->InsertAfter(filler_size);
   filler_free_space_size_ = store_size;
@@ -4020,8 +4008,8 @@ void HAllocate::ClearNextMapWord(int offset) {
     HObjectAccess access =
         HObjectAccess::ForObservableJSObjectOffset(offset);
     HStoreNamedField* clear_next_map =
-        HStoreNamedField::New(zone, context(), this, access,
-            block()->graph()->GetConstant0());
+        HStoreNamedField::New(block()->isolate(), zone, context(), this, access,
+                              block()->graph()->GetConstant0());
     clear_next_map->ClearAllSideEffects();
     clear_next_map->InsertAfter(this);
   }
@@ -4074,27 +4062,27 @@ bool HStoreKeyed::NeedsCanonicalization() {
 }
 
 
-#define H_CONSTANT_INT(val)                                                    \
-HConstant::New(zone, context, static_cast<int32_t>(val))
-#define H_CONSTANT_DOUBLE(val)                                                 \
-HConstant::New(zone, context, static_cast<double>(val))
+#define H_CONSTANT_INT(val) \
+  HConstant::New(isolate, zone, context, static_cast<int32_t>(val))
+#define H_CONSTANT_DOUBLE(val) \
+  HConstant::New(isolate, zone, context, static_cast<double>(val))
 
-#define DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HInstr, op)                       \
-HInstruction* HInstr::New(                                                     \
-    Zone* zone, HValue* context, HValue* left, HValue* right) {                \
-  if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {      \
-    HConstant* c_left = HConstant::cast(left);                                 \
-    HConstant* c_right = HConstant::cast(right);                               \
-    if ((c_left->HasNumberValue() && c_right->HasNumberValue())) {             \
-      double double_res = c_left->DoubleValue() op c_right->DoubleValue();     \
-      if (IsInt32Double(double_res)) {                                         \
-        return H_CONSTANT_INT(double_res);                                     \
-      }                                                                        \
-      return H_CONSTANT_DOUBLE(double_res);                                    \
-    }                                                                          \
-  }                                                                            \
-  return new(zone) HInstr(context, left, right);                               \
-}
+#define DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HInstr, op)                     \
+  HInstruction* HInstr::New(Isolate* isolate, Zone* zone, HValue* context,   \
+                            HValue* left, HValue* right) {                   \
+    if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {  \
+      HConstant* c_left = HConstant::cast(left);                             \
+      HConstant* c_right = HConstant::cast(right);                           \
+      if ((c_left->HasNumberValue() && c_right->HasNumberValue())) {         \
+        double double_res = c_left->DoubleValue() op c_right->DoubleValue(); \
+        if (IsInt32Double(double_res)) {                                     \
+          return H_CONSTANT_INT(double_res);                                 \
+        }                                                                    \
+        return H_CONSTANT_DOUBLE(double_res);                                \
+      }                                                                      \
+    }                                                                        \
+    return new (zone) HInstr(context, left, right);                          \
+  }
 
 
 DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HAdd, +)
@@ -4104,10 +4092,8 @@ DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR(HSub, -)
 #undef DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR
 
 
-HInstruction* HStringAdd::New(Zone* zone,
-                              HValue* context,
-                              HValue* left,
-                              HValue* right,
+HInstruction* HStringAdd::New(Isolate* isolate, Zone* zone, HValue* context,
+                              HValue* left, HValue* right,
                               PretenureFlag pretenure_flag,
                               StringAddFlags flags,
                               Handle<AllocationSite> allocation_site) {
@@ -4119,9 +4105,9 @@ HInstruction* HStringAdd::New(Zone* zone,
       Handle<String> right_string = c_right->StringValue();
       // Prevent possible exception by invalid string length.
       if (left_string->length() + right_string->length() < String::kMaxLength) {
-        MaybeHandle<String> concat = zone->isolate()->factory()->NewConsString(
+        MaybeHandle<String> concat = isolate->factory()->NewConsString(
             c_left->StringValue(), c_right->StringValue());
-        return HConstant::New(zone, context, concat.ToHandleChecked());
+        return HConstant::New(isolate, zone, context, concat.ToHandleChecked());
       }
     }
   }
@@ -4148,26 +4134,28 @@ std::ostream& HStringAdd::PrintDataTo(std::ostream& os) const {  // NOLINT
 }
 
 
-HInstruction* HStringCharFromCode::New(
-    Zone* zone, HValue* context, HValue* char_code) {
+HInstruction* HStringCharFromCode::New(Isolate* isolate, Zone* zone,
+                                       HValue* context, HValue* char_code) {
   if (FLAG_fold_constants && char_code->IsConstant()) {
     HConstant* c_code = HConstant::cast(char_code);
-    Isolate* isolate = zone->isolate();
     if (c_code->HasNumberValue()) {
       if (std::isfinite(c_code->DoubleValue())) {
         uint32_t code = c_code->NumberValueAsInteger32() & 0xffff;
-        return HConstant::New(zone, context,
+        return HConstant::New(
+            isolate, zone, context,
             isolate->factory()->LookupSingleCharacterStringFromCode(code));
       }
-      return HConstant::New(zone, context, isolate->factory()->empty_string());
+      return HConstant::New(isolate, zone, context,
+                            isolate->factory()->empty_string());
     }
   }
   return new(zone) HStringCharFromCode(context, char_code);
 }
 
 
-HInstruction* HUnaryMathOperation::New(
-    Zone* zone, HValue* context, HValue* value, BuiltinFunctionId op) {
+HInstruction* HUnaryMathOperation::New(Isolate* isolate, Zone* zone,
+                                       HValue* context, HValue* value,
+                                       BuiltinFunctionId op) {
   do {
     if (!FLAG_fold_constants) break;
     if (!value->IsConstant()) break;
@@ -4271,10 +4259,8 @@ Representation HUnaryMathOperation::RepresentationFromUses() {
 }
 
 
-HInstruction* HPower::New(Zone* zone,
-                          HValue* context,
-                          HValue* left,
-                          HValue* right) {
+HInstruction* HPower::New(Isolate* isolate, Zone* zone, HValue* context,
+                          HValue* left, HValue* right) {
   if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
     HConstant* c_left = HConstant::cast(left);
     HConstant* c_right = HConstant::cast(right);
@@ -4290,8 +4276,8 @@ HInstruction* HPower::New(Zone* zone,
 }
 
 
-HInstruction* HMathMinMax::New(
-    Zone* zone, HValue* context, HValue* left, HValue* right, Operation op) {
+HInstruction* HMathMinMax::New(Isolate* isolate, Zone* zone, HValue* context,
+                               HValue* left, HValue* right, Operation op) {
   if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
     HConstant* c_left = HConstant::cast(left);
     HConstant* c_right = HConstant::cast(right);
@@ -4323,10 +4309,8 @@ HInstruction* HMathMinMax::New(
 }
 
 
-HInstruction* HMod::New(Zone* zone,
-                        HValue* context,
-                        HValue* left,
-                        HValue* right) {
+HInstruction* HMod::New(Isolate* isolate, Zone* zone, HValue* context,
+                        HValue* left, HValue* right) {
   if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
     HConstant* c_left = HConstant::cast(left);
     HConstant* c_right = HConstant::cast(right);
@@ -4349,8 +4333,8 @@ HInstruction* HMod::New(Zone* zone,
 }
 
 
-HInstruction* HDiv::New(
-    Zone* zone, HValue* context, HValue* left, HValue* right) {
+HInstruction* HDiv::New(Isolate* isolate, Zone* zone, HValue* context,
+                        HValue* left, HValue* right) {
   // If left and right are constant values, try to return a constant value.
   if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
     HConstant* c_left = HConstant::cast(left);
@@ -4373,8 +4357,8 @@ HInstruction* HDiv::New(
 }
 
 
-HInstruction* HBitwise::New(
-    Zone* zone, HValue* context, Token::Value op, HValue* left, HValue* right) {
+HInstruction* HBitwise::New(Isolate* isolate, Zone* zone, HValue* context,
+                            Token::Value op, HValue* left, HValue* right) {
   if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
     HConstant* c_left = HConstant::cast(left);
     HConstant* c_right = HConstant::cast(right);
@@ -4403,18 +4387,18 @@ HInstruction* HBitwise::New(
 }
 
 
-#define DEFINE_NEW_H_BITWISE_INSTR(HInstr, result)                             \
-HInstruction* HInstr::New(                                                     \
-    Zone* zone, HValue* context, HValue* left, HValue* right) {                \
-  if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {      \
-    HConstant* c_left = HConstant::cast(left);                                 \
-    HConstant* c_right = HConstant::cast(right);                               \
-    if ((c_left->HasNumberValue() && c_right->HasNumberValue())) {             \
-      return H_CONSTANT_INT(result);                                           \
-    }                                                                          \
-  }                                                                            \
-  return new(zone) HInstr(context, left, right);                               \
-}
+#define DEFINE_NEW_H_BITWISE_INSTR(HInstr, result)                          \
+  HInstruction* HInstr::New(Isolate* isolate, Zone* zone, HValue* context,  \
+                            HValue* left, HValue* right) {                  \
+    if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { \
+      HConstant* c_left = HConstant::cast(left);                            \
+      HConstant* c_right = HConstant::cast(right);                          \
+      if ((c_left->HasNumberValue() && c_right->HasNumberValue())) {        \
+        return H_CONSTANT_INT(result);                                      \
+      }                                                                     \
+    }                                                                       \
+    return new (zone) HInstr(context, left, right);                         \
+  }
 
 
 DEFINE_NEW_H_BITWISE_INSTR(HSar,
@@ -4425,8 +4409,8 @@ c_left->NumberValueAsInteger32() << (c_right->NumberValueAsInteger32() & 0x1f))
 #undef DEFINE_NEW_H_BITWISE_INSTR
 
 
-HInstruction* HShr::New(
-    Zone* zone, HValue* context, HValue* left, HValue* right) {
+HInstruction* HShr::New(Isolate* isolate, Zone* zone, HValue* context,
+                        HValue* left, HValue* right) {
   if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
     HConstant* c_left = HConstant::cast(left);
     HConstant* c_right = HConstant::cast(right);
@@ -4443,11 +4427,9 @@ HInstruction* HShr::New(
 }
 
 
-HInstruction* HSeqStringGetChar::New(Zone* zone,
-                                     HValue* context,
-                                     String::Encoding encoding,
-                                     HValue* string,
-                                     HValue* index) {
+HInstruction* HSeqStringGetChar::New(Isolate* isolate, Zone* zone,
+                                     HValue* context, String::Encoding encoding,
+                                     HValue* string, HValue* index) {
   if (FLAG_fold_constants && string->IsConstant() && index->IsConstant()) {
     HConstant* c_string = HConstant::cast(string);
     HConstant* c_index = HConstant::cast(index);
@@ -4486,9 +4468,9 @@ void HPhi::SimplifyConstantInputs() {
     if (operand->HasInteger32Value()) {
       continue;
     } else if (operand->HasDoubleValue()) {
-      HConstant* integer_input =
-          HConstant::New(graph->zone(), graph->GetInvalidContext(),
-                         DoubleToInt32(operand->DoubleValue()));
+      HConstant* integer_input = HConstant::New(
+          graph->isolate(), graph->zone(), graph->GetInvalidContext(),
+          DoubleToInt32(operand->DoubleValue()));
       integer_input->InsertAfter(operand);
       SetOperandAt(i, integer_input);
     } else if (operand->HasBooleanValue()) {
index bfe74693a4e7de1cf62384cd20ce5271f0bf4b8a..9d19b710fe9c5d274156b09edfeda24bd6dff360 100644 (file)
@@ -952,98 +952,76 @@ std::ostream& operator<<(std::ostream& os, const TypeOf& v);
 std::ostream& operator<<(std::ostream& os, const ChangesOf& v);
 
 
-#define DECLARE_INSTRUCTION_FACTORY_P0(I)                                      \
-  static I* New(Zone* zone, HValue* context) {                                 \
-    return new(zone) I();                                                      \
-}
+#define DECLARE_INSTRUCTION_FACTORY_P0(I)                        \
+  static I* New(Isolate* isolate, Zone* zone, HValue* context) { \
+    return new (zone) I();                                       \
+  }
 
-#define DECLARE_INSTRUCTION_FACTORY_P1(I, P1)                                  \
-  static I* New(Zone* zone, HValue* context, P1 p1) {                          \
-    return new(zone) I(p1);                                                    \
+#define DECLARE_INSTRUCTION_FACTORY_P1(I, P1)                           \
+  static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1) { \
+    return new (zone) I(p1);                                            \
   }
 
 #define DECLARE_INSTRUCTION_FACTORY_P2(I, P1, P2)                              \
-  static I* New(Zone* zone, HValue* context, P1 p1, P2 p2) {                   \
-    return new(zone) I(p1, p2);                                                \
+  static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2) { \
+    return new (zone) I(p1, p2);                                               \
   }
 
-#define DECLARE_INSTRUCTION_FACTORY_P3(I, P1, P2, P3)                          \
-  static I* New(Zone* zone, HValue* context, P1 p1, P2 p2, P3 p3) {            \
-    return new(zone) I(p1, p2, p3);                                            \
+#define DECLARE_INSTRUCTION_FACTORY_P3(I, P1, P2, P3)                        \
+  static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \
+                P3 p3) {                                                     \
+    return new (zone) I(p1, p2, p3);                                         \
   }
 
-#define DECLARE_INSTRUCTION_FACTORY_P4(I, P1, P2, P3, P4)                      \
-  static I* New(Zone* zone,                                                    \
-                HValue* context,                                               \
-                P1 p1,                                                         \
-                P2 p2,                                                         \
-                P3 p3,                                                         \
-                P4 p4) {                                                       \
-    return new(zone) I(p1, p2, p3, p4);                                        \
+#define DECLARE_INSTRUCTION_FACTORY_P4(I, P1, P2, P3, P4)                    \
+  static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \
+                P3 p3, P4 p4) {                                              \
+    return new (zone) I(p1, p2, p3, p4);                                     \
   }
 
-#define DECLARE_INSTRUCTION_FACTORY_P5(I, P1, P2, P3, P4, P5)                  \
-  static I* New(Zone* zone,                                                    \
-                HValue* context,                                               \
-                P1 p1,                                                         \
-                P2 p2,                                                         \
-                P3 p3,                                                         \
-                P4 p4,                                                         \
-                P5 p5) {                                                       \
-    return new(zone) I(p1, p2, p3, p4, p5);                                    \
+#define DECLARE_INSTRUCTION_FACTORY_P5(I, P1, P2, P3, P4, P5)                \
+  static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \
+                P3 p3, P4 p4, P5 p5) {                                       \
+    return new (zone) I(p1, p2, p3, p4, p5);                                 \
   }
 
-#define DECLARE_INSTRUCTION_FACTORY_P6(I, P1, P2, P3, P4, P5, P6)              \
-  static I* New(Zone* zone,                                                    \
-                HValue* context,                                               \
-                P1 p1,                                                         \
-                P2 p2,                                                         \
-                P3 p3,                                                         \
-                P4 p4,                                                         \
-                P5 p5,                                                         \
-                P6 p6) {                                                       \
-    return new(zone) I(p1, p2, p3, p4, p5, p6);                                \
+#define DECLARE_INSTRUCTION_FACTORY_P6(I, P1, P2, P3, P4, P5, P6)            \
+  static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \
+                P3 p3, P4 p4, P5 p5, P6 p6) {                                \
+    return new (zone) I(p1, p2, p3, p4, p5, p6);                             \
   }
 
-#define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P0(I)                         \
-  static I* New(Zone* zone, HValue* context) {                                 \
-    return new(zone) I(context);                                               \
+#define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P0(I)           \
+  static I* New(Isolate* isolate, Zone* zone, HValue* context) { \
+    return new (zone) I(context);                                \
   }
 
-#define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(I, P1)                     \
-  static I* New(Zone* zone, HValue* context, P1 p1) {                          \
-    return new(zone) I(context, p1);                                           \
+#define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(I, P1)              \
+  static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1) { \
+    return new (zone) I(context, p1);                                   \
   }
 
 #define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(I, P1, P2)                 \
-  static I* New(Zone* zone, HValue* context, P1 p1, P2 p2) {                   \
-    return new(zone) I(context, p1, p2);                                       \
+  static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2) { \
+    return new (zone) I(context, p1, p2);                                      \
   }
 
-#define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(I, P1, P2, P3)             \
-  static I* New(Zone* zone, HValue* context, P1 p1, P2 p2, P3 p3) {            \
-    return new(zone) I(context, p1, p2, p3);                                   \
+#define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(I, P1, P2, P3)           \
+  static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \
+                P3 p3) {                                                     \
+    return new (zone) I(context, p1, p2, p3);                                \
   }
 
-#define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(I, P1, P2, P3, P4)         \
-  static I* New(Zone* zone,                                                    \
-                HValue* context,                                               \
-                P1 p1,                                                         \
-                P2 p2,                                                         \
-                P3 p3,                                                         \
-                P4 p4) {                                                       \
-    return new(zone) I(context, p1, p2, p3, p4);                               \
+#define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(I, P1, P2, P3, P4)       \
+  static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \
+                P3 p3, P4 p4) {                                              \
+    return new (zone) I(context, p1, p2, p3, p4);                            \
   }
 
-#define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5(I, P1, P2, P3, P4, P5)     \
-  static I* New(Zone* zone,                                                    \
-                HValue* context,                                               \
-                P1 p1,                                                         \
-                P2 p2,                                                         \
-                P3 p3,                                                         \
-                P4 p4,                                                         \
-                P5 p5) {                                                       \
-    return new(zone) I(context, p1, p2, p3, p4, p5);                           \
+#define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5(I, P1, P2, P3, P4, P5)   \
+  static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \
+                P3 p3, P4 p4, P5 p5) {                                       \
+    return new (zone) I(context, p1, p2, p3, p4, p5);                        \
   }
 
 
@@ -1384,10 +1362,8 @@ class HGoto FINAL : public HTemplateControlInstruction<1, 0> {
 
 class HDeoptimize FINAL : public HTemplateControlInstruction<1, 0> {
  public:
-  static HDeoptimize* New(Zone* zone,
-                          HValue* context,
-                          const char* reason,
-                          Deoptimizer::BailoutType type,
+  static HDeoptimize* New(Isolate* isolate, Zone* zone, HValue* context,
+                          const char* reason, Deoptimizer::BailoutType type,
                           HBasicBlock* unreachable_continuation) {
     return new(zone) HDeoptimize(reason, type, unreachable_continuation);
   }
@@ -1637,7 +1613,8 @@ class HUseConst FINAL : public HUnaryOperation {
 
 class HForceRepresentation FINAL : public HTemplateInstruction<1> {
  public:
-  static HInstruction* New(Zone* zone, HValue* context, HValue* value,
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           HValue* value,
                            Representation required_representation);
 
   HValue* value() const { return OperandAt(0); }
@@ -2018,8 +1995,8 @@ class HConstant;
 
 class HEnterInlined FINAL : public HTemplateInstruction<0> {
  public:
-  static HEnterInlined* New(Zone* zone, HValue* context, BailoutId return_id,
-                            Handle<JSFunction> closure,
+  static HEnterInlined* New(Isolate* isolate, Zone* zone, HValue* context,
+                            BailoutId return_id, Handle<JSFunction> closure,
                             HConstant* closure_context, int arguments_count,
                             FunctionLiteral* function,
                             InliningKind inlining_kind, Variable* arguments_var,
@@ -2107,31 +2084,33 @@ class HLeaveInlined FINAL : public HTemplateInstruction<0> {
 
 class HPushArguments FINAL : public HInstruction {
  public:
-  static HPushArguments* New(Zone* zone, HValue* context) {
+  static HPushArguments* New(Isolate* isolate, Zone* zone, HValue* context) {
     return new(zone) HPushArguments(zone);
   }
-  static HPushArguments* New(Zone* zone, HValue* context, HValue* arg1) {
+  static HPushArguments* New(Isolate* isolate, Zone* zone, HValue* context,
+                             HValue* arg1) {
     HPushArguments* instr = new(zone) HPushArguments(zone);
     instr->AddInput(arg1);
     return instr;
   }
-  static HPushArguments* New(Zone* zone, HValue* context, HValue* arg1,
-                             HValue* arg2) {
+  static HPushArguments* New(Isolate* isolate, Zone* zone, HValue* context,
+                             HValue* arg1, HValue* arg2) {
     HPushArguments* instr = new(zone) HPushArguments(zone);
     instr->AddInput(arg1);
     instr->AddInput(arg2);
     return instr;
   }
-  static HPushArguments* New(Zone* zone, HValue* context, HValue* arg1,
-                             HValue* arg2, HValue* arg3) {
+  static HPushArguments* New(Isolate* isolate, Zone* zone, HValue* context,
+                             HValue* arg1, HValue* arg2, HValue* arg3) {
     HPushArguments* instr = new(zone) HPushArguments(zone);
     instr->AddInput(arg1);
     instr->AddInput(arg2);
     instr->AddInput(arg3);
     return instr;
   }
-  static HPushArguments* New(Zone* zone, HValue* context, HValue* arg1,
-                             HValue* arg2, HValue* arg3, HValue* arg4) {
+  static HPushArguments* New(Isolate* isolate, Zone* zone, HValue* context,
+                             HValue* arg1, HValue* arg2, HValue* arg3,
+                             HValue* arg4) {
     HPushArguments* instr = new(zone) HPushArguments(zone);
     instr->AddInput(arg1);
     instr->AddInput(arg2);
@@ -2282,10 +2261,8 @@ class HBinaryCall : public HCall<2> {
 
 class HCallJSFunction FINAL : public HCall<1> {
  public:
-  static HCallJSFunction* New(Zone* zone,
-                              HValue* context,
-                              HValue* function,
-                              int argument_count,
+  static HCallJSFunction* New(Isolate* isolate, Zone* zone, HValue* context,
+                              HValue* function, int argument_count,
                               bool pass_argument_count);
 
   HValue* function() const { return OperandAt(0); }
@@ -2325,8 +2302,8 @@ enum CallMode { NORMAL_CALL, TAIL_CALL };
 
 class HCallWithDescriptor FINAL : public HInstruction {
  public:
-  static HCallWithDescriptor* New(Zone* zone, HValue* context, HValue* target,
-                                  int argument_count,
+  static HCallWithDescriptor* New(Isolate* isolate, Zone* zone, HValue* context,
+                                  HValue* target, int argument_count,
                                   CallInterfaceDescriptor descriptor,
                                   const Vector<HValue*>& operands,
                                   CallMode call_mode = NORMAL_CALL) {
@@ -2422,8 +2399,7 @@ class HInvokeFunction FINAL : public HBinaryCall {
          known_function->code()->kind() == Code::OPTIMIZED_FUNCTION);
   }
 
-  static HInvokeFunction* New(Zone* zone,
-                              HValue* context,
+  static HInvokeFunction* New(Isolate* isolate, Zone* zone, HValue* context,
                               HValue* function,
                               Handle<JSFunction> known_function,
                               int argument_count) {
@@ -2584,10 +2560,8 @@ class HMapEnumLength FINAL : public HUnaryOperation {
 
 class HUnaryMathOperation FINAL : public HTemplateInstruction<2> {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           HValue* value,
-                           BuiltinFunctionId op);
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           HValue* value, BuiltinFunctionId op);
 
   HValue* context() const { return OperandAt(0); }
   HValue* value() const { return OperandAt(1); }
@@ -2728,12 +2702,13 @@ class HLoadRoot FINAL : public HTemplateInstruction<0> {
 
 class HCheckMaps FINAL : public HTemplateInstruction<2> {
  public:
-  static HCheckMaps* New(Zone* zone, HValue* context, HValue* value,
-                         Handle<Map> map, HValue* typecheck = NULL) {
+  static HCheckMaps* New(Isolate* isolate, Zone* zone, HValue* context,
+                         HValue* value, Handle<Map> map,
+                         HValue* typecheck = NULL) {
     return new(zone) HCheckMaps(value, new(zone) UniqueSet<Map>(
             Unique<Map>::CreateImmovable(map), zone), typecheck);
   }
-  static HCheckMaps* New(Zone* zone, HValue* context,
+  static HCheckMaps* New(Isolate* isolate, Zone* zone, HValue* context,
                          HValue* value, SmallMapList* map_list,
                          HValue* typecheck = NULL) {
     UniqueSet<Map>* maps = new(zone) UniqueSet<Map>(map_list->length(), zone);
@@ -2863,9 +2838,9 @@ class HCheckMaps FINAL : public HTemplateInstruction<2> {
 
 class HCheckValue FINAL : public HUnaryOperation {
  public:
-  static HCheckValue* New(Zone* zone, HValue* context,
+  static HCheckValue* New(Isolate* isolate, Zone* zone, HValue* context,
                           HValue* value, Handle<JSFunction> func) {
-    bool in_new_space = zone->isolate()->heap()->InNewSpace(*func);
+    bool in_new_space = isolate->heap()->InNewSpace(*func);
     // NOTE: We create an uninitialized Unique and initialize it later.
     // This is because a JSFunction can move due to GC during graph creation.
     // TODO(titzer): This is a migration crutch. Replace with some kind of
@@ -2874,7 +2849,7 @@ class HCheckValue FINAL : public HUnaryOperation {
     HCheckValue* check = new(zone) HCheckValue(value, target, in_new_space);
     return check;
   }
-  static HCheckValue* New(Zone* zone, HValue* context,
+  static HCheckValue* New(Isolate* isolate, Zone* zone, HValue* context,
                           HValue* value, Unique<HeapObject> target,
                           bool object_in_new_space) {
     return new(zone) HCheckValue(value, target, object_in_new_space);
@@ -3416,7 +3391,8 @@ class HDematerializedObject : public HInstruction {
 
 class HArgumentsObject FINAL : public HDematerializedObject {
  public:
-  static HArgumentsObject* New(Zone* zone, HValue* context, int count) {
+  static HArgumentsObject* New(Isolate* isolate, Zone* zone, HValue* context,
+                               int count) {
     return new(zone) HArgumentsObject(count, zone);
   }
 
@@ -3493,13 +3469,12 @@ class HConstant FINAL : public HTemplateInstruction<0> {
   DECLARE_INSTRUCTION_FACTORY_P1(HConstant, Handle<Object>);
   DECLARE_INSTRUCTION_FACTORY_P1(HConstant, ExternalReference);
 
-  static HConstant* CreateAndInsertAfter(Zone* zone,
-                                         HValue* context,
-                                         int32_t value,
+  static HConstant* CreateAndInsertAfter(Isolate* isolate, Zone* zone,
+                                         HValue* context, int32_t value,
                                          Representation representation,
                                          HInstruction* instruction) {
-    return instruction->Append(HConstant::New(
-        zone, context, value, representation));
+    return instruction->Append(
+        HConstant::New(isolate, zone, context, value, representation));
   }
 
   Handle<Map> GetMonomorphicJSObjectMap() OVERRIDE {
@@ -3510,13 +3485,12 @@ class HConstant FINAL : public HTemplateInstruction<0> {
     return Handle<Map>();
   }
 
-  static HConstant* CreateAndInsertBefore(Zone* zone,
-                                          HValue* context,
-                                          int32_t value,
+  static HConstant* CreateAndInsertBefore(Isolate* isolate, Zone* zone,
+                                          HValue* context, int32_t value,
                                           Representation representation,
                                           HInstruction* instruction) {
-    return instruction->Prepend(HConstant::New(
-        zone, context, value, representation));
+    return instruction->Prepend(
+        HConstant::New(isolate, zone, context, value, representation));
   }
 
   static HConstant* CreateAndInsertBefore(Zone* zone,
@@ -3584,7 +3558,7 @@ class HConstant FINAL : public HTemplateInstruction<0> {
   std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE;  // NOLINT
   HConstant* CopyToRepresentation(Representation r, Zone* zone) const;
   Maybe<HConstant*> CopyToTruncatedInt32(Zone* zone);
-  Maybe<HConstant*> CopyToTruncatedNumber(Zone* zone);
+  Maybe<HConstant*> CopyToTruncatedNumber(Isolate* isolate, Zone* zone);
   bool HasInteger32Value() const {
     return HasInt32ValueField::decode(bit_field_);
   }
@@ -4795,10 +4769,8 @@ class HInstanceOfKnownGlobal FINAL : public HTemplateInstruction<2> {
 
 class HPower FINAL : public HTemplateInstruction<2> {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           HValue* left,
-                           HValue* right);
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           HValue* left, HValue* right);
 
   HValue* left() { return OperandAt(0); }
   HValue* right() const { return OperandAt(1); }
@@ -4834,10 +4806,8 @@ class HPower FINAL : public HTemplateInstruction<2> {
 
 class HAdd FINAL : public HArithmeticBinaryOperation {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           HValue* left,
-                           HValue* right);
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           HValue* left, HValue* right);
 
   // Add is only commutative if two integer values are added and not if two
   // tagged values are added (because it might be a String concatenation).
@@ -4897,10 +4867,8 @@ class HAdd FINAL : public HArithmeticBinaryOperation {
 
 class HSub FINAL : public HArithmeticBinaryOperation {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           HValue* left,
-                           HValue* right);
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           HValue* left, HValue* right);
 
   HValue* Canonicalize() OVERRIDE;
 
@@ -4930,16 +4898,12 @@ class HSub FINAL : public HArithmeticBinaryOperation {
 
 class HMul FINAL : public HArithmeticBinaryOperation {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           HValue* left,
-                           HValue* right);
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           HValue* left, HValue* right);
 
-  static HInstruction* NewImul(Zone* zone,
-                         HValue* context,
-                         HValue* left,
-                         HValue* right) {
-    HInstruction* instr = HMul::New(zone, context, left, right);
+  static HInstruction* NewImul(Isolate* isolate, Zone* zone, HValue* context,
+                               HValue* left, HValue* right) {
+    HInstruction* instr = HMul::New(isolate, zone, context, left, right);
     if (!instr->IsMul()) return instr;
     HMul* mul = HMul::cast(instr);
     // TODO(mstarzinger): Prevent bailout on minus zero for imul.
@@ -4978,10 +4942,8 @@ class HMul FINAL : public HArithmeticBinaryOperation {
 
 class HMod FINAL : public HArithmeticBinaryOperation {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           HValue* left,
-                           HValue* right);
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           HValue* left, HValue* right);
 
   HValue* Canonicalize() OVERRIDE;
 
@@ -5012,10 +4974,8 @@ class HMod FINAL : public HArithmeticBinaryOperation {
 
 class HDiv FINAL : public HArithmeticBinaryOperation {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           HValue* left,
-                           HValue* right);
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           HValue* left, HValue* right);
 
   HValue* Canonicalize() OVERRIDE;
 
@@ -5046,11 +5006,8 @@ class HMathMinMax FINAL : public HArithmeticBinaryOperation {
  public:
   enum Operation { kMathMin, kMathMax };
 
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           HValue* left,
-                           HValue* right,
-                           Operation op);
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           HValue* left, HValue* right, Operation op);
 
   Representation observed_input_representation(int index) OVERRIDE {
     return RequiredInputRepresentation(index);
@@ -5094,11 +5051,8 @@ class HMathMinMax FINAL : public HArithmeticBinaryOperation {
 
 class HBitwise FINAL : public HBitwiseBinaryOperation {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           Token::Value op,
-                           HValue* left,
-                           HValue* right);
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           Token::Value op, HValue* left, HValue* right);
 
   Token::Value op() const { return op_; }
 
@@ -5156,10 +5110,8 @@ class HBitwise FINAL : public HBitwiseBinaryOperation {
 
 class HShl FINAL : public HBitwiseBinaryOperation {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           HValue* left,
-                           HValue* right);
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           HValue* left, HValue* right);
 
   Range* InferRange(Zone* zone) OVERRIDE;
 
@@ -5187,10 +5139,8 @@ class HShl FINAL : public HBitwiseBinaryOperation {
 
 class HShr FINAL : public HBitwiseBinaryOperation {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           HValue* left,
-                           HValue* right);
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           HValue* left, HValue* right);
 
   bool TryDecompose(DecompositionResult* decomposition) OVERRIDE {
     if (right()->IsInteger32Constant()) {
@@ -5226,10 +5176,8 @@ class HShr FINAL : public HBitwiseBinaryOperation {
 
 class HSar FINAL : public HBitwiseBinaryOperation {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           HValue* left,
-                           HValue* right);
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           HValue* left, HValue* right);
 
   bool TryDecompose(DecompositionResult* decomposition) OVERRIDE {
     if (right()->IsInteger32Constant()) {
@@ -5265,10 +5213,8 @@ class HSar FINAL : public HBitwiseBinaryOperation {
 
 class HRor FINAL : public HBitwiseBinaryOperation {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           HValue* left,
-                           HValue* right) {
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           HValue* left, HValue* right) {
     return new(zone) HRor(context, left, right);
   }
 
@@ -5604,14 +5550,10 @@ class HAllocate FINAL : public HTemplateInstruction<2> {
         ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2);
   }
 
-  static HAllocate* New(Zone* zone,
-                        HValue* context,
-                        HValue* size,
-                        HType type,
-                        PretenureFlag pretenure_flag,
-                        InstanceType instance_type,
-                        Handle<AllocationSite> allocation_site =
-                            Handle<AllocationSite>::null()) {
+  static HAllocate* New(
+      Isolate* isolate, Zone* zone, HValue* context, HValue* size, HType type,
+      PretenureFlag pretenure_flag, InstanceType instance_type,
+      Handle<AllocationSite> allocation_site = Handle<AllocationSite>::null()) {
     return new(zone) HAllocate(context, size, type, pretenure_flag,
         instance_type, allocation_site);
   }
@@ -5786,10 +5728,8 @@ class HAllocate FINAL : public HTemplateInstruction<2> {
 
 class HStoreCodeEntry FINAL: public HTemplateInstruction<2> {
  public:
-  static HStoreCodeEntry* New(Zone* zone,
-                              HValue* context,
-                              HValue* function,
-                              HValue* code) {
+  static HStoreCodeEntry* New(Isolate* isolate, Zone* zone, HValue* context,
+                              HValue* function, HValue* code) {
     return new(zone) HStoreCodeEntry(function, code);
   }
 
@@ -5812,11 +5752,9 @@ class HStoreCodeEntry FINAL: public HTemplateInstruction<2> {
 
 class HInnerAllocatedObject FINAL : public HTemplateInstruction<2> {
  public:
-  static HInnerAllocatedObject* New(Zone* zone,
-                                    HValue* context,
-                                    HValue* value,
-                                    HValue* offset,
-                                    HType type) {
+  static HInnerAllocatedObject* New(Isolate* isolate, Zone* zone,
+                                    HValue* context, HValue* value,
+                                    HValue* offset, HType type) {
     return new(zone) HInnerAllocatedObject(value, offset, type);
   }
 
@@ -7353,9 +7291,8 @@ class HStoreKeyedGeneric FINAL : public HTemplateInstruction<4> {
 
 class HTransitionElementsKind FINAL : public HTemplateInstruction<2> {
  public:
-  inline static HTransitionElementsKind* New(Zone* zone,
-                                             HValue* context,
-                                             HValue* object,
+  inline static HTransitionElementsKind* New(Isolate* isolate, Zone* zone,
+                                             HValue* context, HValue* object,
                                              Handle<Map> original_map,
                                              Handle<Map> transitioned_map) {
     return new(zone) HTransitionElementsKind(context, object,
@@ -7415,14 +7352,11 @@ class HTransitionElementsKind FINAL : public HTemplateInstruction<2> {
 
 class HStringAdd FINAL : public HBinaryOperation {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           HValue* left,
-                           HValue* right,
-                           PretenureFlag pretenure_flag = NOT_TENURED,
-                           StringAddFlags flags = STRING_ADD_CHECK_BOTH,
-                           Handle<AllocationSite> allocation_site =
-                               Handle<AllocationSite>::null());
+  static HInstruction* New(
+      Isolate* isolate, Zone* zone, HValue* context, HValue* left,
+      HValue* right, PretenureFlag pretenure_flag = NOT_TENURED,
+      StringAddFlags flags = STRING_ADD_CHECK_BOTH,
+      Handle<AllocationSite> allocation_site = Handle<AllocationSite>::null());
 
   StringAddFlags flags() const { return flags_; }
   PretenureFlag pretenure_flag() const { return pretenure_flag_; }
@@ -7516,8 +7450,7 @@ class HStringCharCodeAt FINAL : public HTemplateInstruction<3> {
 
 class HStringCharFromCode FINAL : public HTemplateInstruction<2> {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
                            HValue* char_code);
 
   Representation RequiredInputRepresentation(int index) OVERRIDE {
@@ -7767,10 +7700,8 @@ class HDateField FINAL : public HUnaryOperation {
 
 class HSeqStringGetChar FINAL : public HTemplateInstruction<2> {
  public:
-  static HInstruction* New(Zone* zone,
-                           HValue* context,
-                           String::Encoding encoding,
-                           HValue* string,
+  static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context,
+                           String::Encoding encoding, HValue* string,
                            HValue* index);
 
   Representation RequiredInputRepresentation(int index) OVERRIDE {
index 9e552a290478e7c96dd63530fc4a2cc830e9b5bf..b59f5c79494117a109f487f0fc09baad83229167 100644 (file)
@@ -653,7 +653,7 @@ HConstant* HGraph::GetConstant(SetOncePointer<HConstant>* pointer,
   if (!pointer->is_set()) {
     // Can't pass GetInvalidContext() to HConstant::New, because that will
     // recursively call GetConstant
-    HConstant* constant = HConstant::New(zone(), NULL, value);
+    HConstant* constant = HConstant::New(isolate(), zone(), NULL, value);
     constant->InsertAfter(entry_block()->first());
     pointer->set(constant);
     return constant;
@@ -1027,8 +1027,9 @@ void HGraphBuilder::IfBuilder::End() {
   current = merge_at_join_blocks_;
   while (current != NULL) {
     if (current->deopt_ && current->block_ != NULL) {
-      current->block_->FinishExit(HAbnormalExit::New(builder()->zone(), NULL),
-                                  HSourcePosition::Unknown());
+      current->block_->FinishExit(
+          HAbnormalExit::New(builder()->isolate(), builder()->zone(), NULL),
+          HSourcePosition::Unknown());
     }
     current = current->next_;
   }
@@ -1098,11 +1099,12 @@ HValue* HGraphBuilder::LoopBuilder::BeginBody(
 
   builder_->set_current_block(body_block_);
   if (direction_ == kPreIncrement || direction_ == kPreDecrement) {
+    Isolate* isolate = builder_->isolate();
     HValue* one = builder_->graph()->GetConstant1();
     if (direction_ == kPreIncrement) {
-      increment_ = HAdd::New(zone(), context_, phi_, one);
+      increment_ = HAdd::New(isolate, zone(), context_, phi_, one);
     } else {
-      increment_ = HSub::New(zone(), context_, phi_, one);
+      increment_ = HSub::New(isolate, zone(), context_, phi_, one);
     }
     increment_->ClearFlag(HValue::kCanOverflow);
     builder_->AddInstruction(increment_);
@@ -1144,10 +1146,13 @@ void HGraphBuilder::LoopBuilder::EndBody() {
   DCHECK(!finished_);
 
   if (direction_ == kPostIncrement || direction_ == kPostDecrement) {
+    Isolate* isolate = builder_->isolate();
     if (direction_ == kPostIncrement) {
-      increment_ = HAdd::New(zone(), context_, phi_, increment_amount_);
+      increment_ =
+          HAdd::New(isolate, zone(), context_, phi_, increment_amount_);
     } else {
-      increment_ = HSub::New(zone(), context_, phi_, increment_amount_);
+      increment_ =
+          HSub::New(isolate, zone(), context_, phi_, increment_amount_);
     }
     increment_->ClearFlag(HValue::kCanOverflow);
     builder_->AddInstruction(increment_);
@@ -2548,9 +2553,9 @@ HValue* HGraphBuilder::BuildCalculateElementsSize(ElementsKind kind,
       : kPointerSize;
 
   HConstant* elements_size_value = Add<HConstant>(elements_size);
-  HInstruction* mul = HMul::NewImul(zone(), context(),
-                                    capacity->ActualValue(),
-                                    elements_size_value);
+  HInstruction* mul =
+      HMul::NewImul(isolate(), zone(), context(), capacity->ActualValue(),
+                    elements_size_value);
   AddInstruction(mul);
   mul->ClearFlag(HValue::kCanOverflow);
 
@@ -3344,7 +3349,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->zone());
+  InitializeAstVisitor(info->isolate(), info->zone());
   if (FLAG_hydrogen_track_positions) {
     SetSourcePosition(info->shared_info()->start_position());
   }
@@ -7522,8 +7527,7 @@ void HOptimizedGraphBuilder::AddCheckPrototypeMaps(Handle<JSObject> holder,
 
 HInstruction* HOptimizedGraphBuilder::NewPlainFunctionCall(
     HValue* fun, int argument_count, bool pass_argument_count) {
-  return New<HCallJSFunction>(
-      fun, argument_count, pass_argument_count);
+  return New<HCallJSFunction>(fun, argument_count, pass_argument_count);
 }
 
 
@@ -8207,7 +8211,8 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinFunctionCall(Call* expr) {
         HValue* right = Pop();
         HValue* left = Pop();
         Drop(2);  // Receiver and function.
-        HInstruction* op = HMul::NewImul(zone(), context(), left, right);
+        HInstruction* op =
+            HMul::NewImul(isolate(), zone(), context(), left, right);
         ast_context()->ReturnInstruction(op, expr->id());
         return true;
       }
@@ -8332,7 +8337,8 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall(
         HValue* right = Pop();
         HValue* left = Pop();
         Drop(2);  // Receiver and function.
-        HInstruction* result = HMul::NewImul(zone(), context(), left, right);
+        HInstruction* result =
+            HMul::NewImul(isolate(), zone(), context(), left, right);
         ast_context()->ReturnInstruction(result, expr->id());
         return true;
       }
@@ -10367,7 +10373,8 @@ HValue* HGraphBuilder::EnforceNumberType(HValue* number,
 HValue* HGraphBuilder::TruncateToNumber(HValue* value, Type** expected) {
   if (value->IsConstant()) {
     HConstant* constant = HConstant::cast(value);
-    Maybe<HConstant*> number = constant->CopyToTruncatedNumber(zone());
+    Maybe<HConstant*> number =
+        constant->CopyToTruncatedNumber(isolate(), zone());
     if (number.has_value) {
       *expected = Type::Number(zone());
       return AddInstruction(number.value);
index 53443595cbfc7860b03ec0041952aca14519809d..2a12edd8c4055bde38aabee71d15779fd494d995 100644 (file)
@@ -1102,11 +1102,15 @@ class HGraphBuilder {
     return AddLeaveInlined(current_block(), return_value, state);
   }
 
-  template<class I>
-  HInstruction* NewUncasted() { return I::New(zone(), context()); }
+  template <class I>
+  HInstruction* NewUncasted() {
+    return I::New(isolate(), zone(), context());
+  }
 
-  template<class I>
-  I* New() { return I::New(zone(), context()); }
+  template <class I>
+  I* New() {
+    return I::New(isolate(), zone(), context());
+  }
 
   template<class I>
   HInstruction* AddUncasted() { return AddInstruction(NewUncasted<I>());}
@@ -1116,11 +1120,13 @@ class HGraphBuilder {
 
   template<class I, class P1>
   HInstruction* NewUncasted(P1 p1) {
-    return I::New(zone(), context(), p1);
+    return I::New(isolate(), zone(), context(), p1);
   }
 
-  template<class I, class P1>
-  I* New(P1 p1) { return I::New(zone(), context(), p1); }
+  template <class I, class P1>
+  I* New(P1 p1) {
+    return I::New(isolate(), zone(), context(), p1);
+  }
 
   template<class I, class P1>
   HInstruction* AddUncasted(P1 p1) {
@@ -1144,12 +1150,12 @@ class HGraphBuilder {
 
   template<class I, class P1, class P2>
   HInstruction* NewUncasted(P1 p1, P2 p2) {
-    return I::New(zone(), context(), p1, p2);
+    return I::New(isolate(), zone(), context(), p1, p2);
   }
 
   template<class I, class P1, class P2>
   I* New(P1 p1, P2 p2) {
-    return I::New(zone(), context(), p1, p2);
+    return I::New(isolate(), zone(), context(), p1, p2);
   }
 
   template<class I, class P1, class P2>
@@ -1172,12 +1178,12 @@ class HGraphBuilder {
 
   template<class I, class P1, class P2, class P3>
   HInstruction* NewUncasted(P1 p1, P2 p2, P3 p3) {
-    return I::New(zone(), context(), p1, p2, p3);
+    return I::New(isolate(), zone(), context(), p1, p2, p3);
   }
 
   template<class I, class P1, class P2, class P3>
   I* New(P1 p1, P2 p2, P3 p3) {
-    return I::New(zone(), context(), p1, p2, p3);
+    return I::New(isolate(), zone(), context(), p1, p2, p3);
   }
 
   template<class I, class P1, class P2, class P3>
@@ -1192,12 +1198,12 @@ class HGraphBuilder {
 
   template<class I, class P1, class P2, class P3, class P4>
   HInstruction* NewUncasted(P1 p1, P2 p2, P3 p3, P4 p4) {
-    return I::New(zone(), context(), p1, p2, p3, p4);
+    return I::New(isolate(), zone(), context(), p1, p2, p3, p4);
   }
 
   template<class I, class P1, class P2, class P3, class P4>
   I* New(P1 p1, P2 p2, P3 p3, P4 p4) {
-    return I::New(zone(), context(), p1, p2, p3, p4);
+    return I::New(isolate(), zone(), context(), p1, p2, p3, p4);
   }
 
   template<class I, class P1, class P2, class P3, class P4>
@@ -1212,12 +1218,12 @@ class HGraphBuilder {
 
   template<class I, class P1, class P2, class P3, class P4, class P5>
   HInstruction* NewUncasted(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {
-    return I::New(zone(), context(), p1, p2, p3, p4, p5);
+    return I::New(isolate(), zone(), context(), p1, p2, p3, p4, p5);
   }
 
   template<class I, class P1, class P2, class P3, class P4, class P5>
   I* New(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {
-    return I::New(zone(), context(), p1, p2, p3, p4, p5);
+    return I::New(isolate(), zone(), context(), p1, p2, p3, p4, p5);
   }
 
   template<class I, class P1, class P2, class P3, class P4, class P5>
@@ -1232,12 +1238,12 @@ class HGraphBuilder {
 
   template<class I, class P1, class P2, class P3, class P4, class P5, class P6>
   HInstruction* NewUncasted(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) {
-    return I::New(zone(), context(), p1, p2, p3, p4, p5, p6);
+    return I::New(isolate(), zone(), context(), p1, p2, p3, p4, p5, p6);
   }
 
   template<class I, class P1, class P2, class P3, class P4, class P5, class P6>
   I* New(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) {
-    return I::New(zone(), context(), p1, p2, p3, p4, p5, p6);
+    return I::New(isolate(), zone(), context(), p1, p2, p3, p4, p5, p6);
   }
 
   template<class I, class P1, class P2, class P3, class P4, class P5, class P6>
@@ -1253,13 +1259,13 @@ class HGraphBuilder {
   template<class I, class P1, class P2, class P3, class P4,
       class P5, class P6, class P7>
   HInstruction* NewUncasted(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) {
-    return I::New(zone(), context(), p1, p2, p3, p4, p5, p6, p7);
+    return I::New(isolate(), zone(), context(), p1, p2, p3, p4, p5, p6, p7);
   }
 
   template<class I, class P1, class P2, class P3, class P4,
       class P5, class P6, class P7>
       I* New(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) {
-    return I::New(zone(), context(), p1, p2, p3, p4, p5, p6, p7);
+    return I::New(isolate(), zone(), context(), p1, p2, p3, p4, p5, p6, p7);
   }
 
   template<class I, class P1, class P2, class P3,
@@ -1278,13 +1284,13 @@ class HGraphBuilder {
       class P5, class P6, class P7, class P8>
   HInstruction* NewUncasted(P1 p1, P2 p2, P3 p3, P4 p4,
                             P5 p5, P6 p6, P7 p7, P8 p8) {
-    return I::New(zone(), context(), p1, p2, p3, p4, p5, p6, p7, p8);
+    return I::New(isolate(), zone(), context(), p1, p2, p3, p4, p5, p6, p7, p8);
   }
 
   template<class I, class P1, class P2, class P3, class P4,
       class P5, class P6, class P7, class P8>
       I* New(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) {
-    return I::New(zone(), context(), p1, p2, p3, p4, p5, p6, p7, p8);
+    return I::New(isolate(), zone(), context(), p1, p2, p3, p4, p5, p6, p7, p8);
   }
 
   template<class I, class P1, class P2, class P3, class P4,
@@ -2508,6 +2514,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
     bool has_holder() { return !holder_.is_null(); }
     bool IsLoad() const { return access_type_ == LOAD; }
 
+    Isolate* isolate() const { return lookup_.isolate(); }
     Handle<JSObject> holder() { return holder_; }
     Handle<JSFunction> accessor() { return accessor_; }
     Handle<Object> constant() { return constant_; }
@@ -2546,7 +2553,6 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
 
     Type* ToType(Handle<Map> map) { return builder_->ToType(map); }
     Zone* zone() { return builder_->zone(); }
-    Isolate* isolate() const { return lookup_.isolate(); }
     CompilationInfo* top_info() { return builder_->top_info(); }
     CompilationInfo* current_info() { return builder_->current_info(); }
 
index 4118db88193e2f09939fa7956263c8762a46abbe..a4095055ea0d5ac1cc75d7f4567cf6d22608541e 100644 (file)
@@ -78,12 +78,11 @@ namespace internal {
 
 #define __ ACCESS_MASM(masm_)
 
-RegExpMacroAssemblerIA32::RegExpMacroAssemblerIA32(
-    Mode mode,
-    int registers_to_save,
-    Zone* zone)
-    : NativeRegExpMacroAssembler(zone),
-      masm_(new MacroAssembler(zone->isolate(), NULL, kRegExpCodeSize)),
+RegExpMacroAssemblerIA32::RegExpMacroAssemblerIA32(Isolate* isolate, Zone* zone,
+                                                   Mode mode,
+                                                   int registers_to_save)
+    : NativeRegExpMacroAssembler(isolate, zone),
+      masm_(new MacroAssembler(isolate, NULL, kRegExpCodeSize)),
       mode_(mode),
       num_registers_(registers_to_save),
       num_saved_registers_(registers_to_save),
index 8f6499cba9285f6a8b02044bf5d57a0a70fa116e..2927a260779110fa5a16d1441c1fe8e050d46625 100644 (file)
@@ -15,7 +15,8 @@ namespace internal {
 #ifndef V8_INTERPRETED_REGEXP
 class RegExpMacroAssemblerIA32: public NativeRegExpMacroAssembler {
  public:
-  RegExpMacroAssemblerIA32(Mode mode, int registers_to_save, Zone* zone);
+  RegExpMacroAssemblerIA32(Isolate* isolate, Zone* zone, Mode mode,
+                           int registers_to_save);
   virtual ~RegExpMacroAssemblerIA32();
   virtual int stack_limit_slack();
   virtual void AdvanceCurrentPosition(int by);
index e0bb09b46f7760480315bcf2d4fdd98041af01d5..ea5e3a95c93eb46aaaccbdf9b74c1c9dc89dfa15 100644 (file)
@@ -1644,7 +1644,6 @@ Isolate::Isolate(bool enable_serializer)
       descriptor_lookup_cache_(NULL),
       handle_scope_implementer_(NULL),
       unicode_cache_(NULL),
-      runtime_zone_(this),
       inner_pointer_to_code_cache_(NULL),
       global_handles_(NULL),
       eternal_handles_(NULL),
index 6d579a74a657e37d54e2e024faca9c45e5aa88c7..61043db307290e5996cda7d5ed98741bba37e74f 100644 (file)
@@ -32,7 +32,6 @@ class JsonParser BASE_EMBEDDED {
         source_length_(source->length()),
         isolate_(source->map()->GetHeap()->isolate()),
         factory_(isolate_->factory()),
-        zone_(isolate_),
         object_constructor_(isolate_->native_context()->object_function(),
                             isolate_),
         position_(-1) {
index d5a7775b8d02dde235b9e41aea8123cf93eae2f3..0813afbe8484772cc28d9c5cd108998fc268526b 100644 (file)
@@ -138,7 +138,7 @@ MaybeHandle<Object> RegExpImpl::Compile(Handle<JSRegExp> re,
                                         Handle<String> pattern,
                                         JSRegExp::Flags flags) {
   Isolate* isolate = re->GetIsolate();
-  Zone zone(isolate);
+  Zone zone;
   CompilationCache* compilation_cache = isolate->compilation_cache();
   MaybeHandle<FixedArray> maybe_cached =
       compilation_cache->LookupRegExp(pattern, flags);
@@ -155,8 +155,9 @@ MaybeHandle<Object> RegExpImpl::Compile(Handle<JSRegExp> re,
   PostponeInterruptsScope postpone(isolate);
   RegExpCompileData parse_result;
   FlatStringReader reader(isolate, pattern);
-  if (!RegExpParser::ParseRegExp(&reader, flags.is_multiline(),
-                                 flags.is_unicode(), &parse_result, &zone)) {
+  if (!RegExpParser::ParseRegExp(re->GetIsolate(), &zone, &reader,
+                                 flags.is_multiline(), flags.is_unicode(),
+                                 &parse_result)) {
     // Throw an exception if we fail to parse the pattern.
     return ThrowRegExpException(re,
                                 pattern,
@@ -371,7 +372,7 @@ bool RegExpImpl::CompileIrregexp(Handle<JSRegExp> re,
                                  bool is_one_byte) {
   // Compile the RegExp.
   Isolate* isolate = re->GetIsolate();
-  Zone zone(isolate);
+  Zone zone;
   PostponeInterruptsScope postpone(isolate);
   // If we had a compilation error the last time this is saved at the
   // saved code index.
@@ -402,8 +403,8 @@ bool RegExpImpl::CompileIrregexp(Handle<JSRegExp> re,
   pattern = String::Flatten(pattern);
   RegExpCompileData compile_data;
   FlatStringReader reader(isolate, pattern);
-  if (!RegExpParser::ParseRegExp(&reader, flags.is_multiline(),
-                                 flags.is_unicode(), &compile_data, &zone)) {
+  if (!RegExpParser::ParseRegExp(isolate, &zone, &reader, flags.is_multiline(),
+                                 flags.is_unicode(), &compile_data)) {
     // Throw an exception if we fail to parse the pattern.
     // THIS SHOULD NOT HAPPEN. We already pre-parsed it successfully once.
     USE(ThrowRegExpException(re,
@@ -413,9 +414,9 @@ bool RegExpImpl::CompileIrregexp(Handle<JSRegExp> re,
     return false;
   }
   RegExpEngine::CompilationResult result = RegExpEngine::Compile(
-      &compile_data, flags.is_ignore_case(), flags.is_global(),
+      isolate, &zone, &compile_data, flags.is_ignore_case(), flags.is_global(),
       flags.is_multiline(), flags.is_sticky(), pattern, sample_subject,
-      is_one_byte, &zone);
+      is_one_byte);
   if (result.error_message != NULL) {
     // Unable to compile regexp.
     Handle<String> error_message = isolate->factory()->NewStringFromUtf8(
@@ -971,8 +972,8 @@ class FrequencyCollator {
 
 class RegExpCompiler {
  public:
-  RegExpCompiler(int capture_count, bool ignore_case, bool is_one_byte,
-                 Zone* zone);
+  RegExpCompiler(Isolate* isolate, Zone* zone, int capture_count,
+                 bool ignore_case, bool is_one_byte);
 
   int AllocateRegister() {
     if (next_register_ >= RegExpMacroAssembler::kMaxRegister) {
@@ -1014,6 +1015,7 @@ class RegExpCompiler {
     current_expansion_factor_ = value;
   }
 
+  Isolate* isolate() const { return isolate_; }
   Zone* zone() const { return zone_; }
 
   static const int kNoRegister = -1;
@@ -1030,6 +1032,7 @@ class RegExpCompiler {
   bool optimize_;
   int current_expansion_factor_;
   FrequencyCollator frequency_collator_;
+  Isolate* isolate_;
   Zone* zone_;
 };
 
@@ -1052,8 +1055,8 @@ static RegExpEngine::CompilationResult IrregexpRegExpTooBig(Isolate* isolate) {
 
 // Attempts to compile the regexp using an Irregexp code generator.  Returns
 // a fixed array or a null handle depending on whether it succeeded.
-RegExpCompiler::RegExpCompiler(int capture_count, bool ignore_case,
-                               bool one_byte, Zone* zone)
+RegExpCompiler::RegExpCompiler(Isolate* isolate, Zone* zone, int capture_count,
+                               bool ignore_case, bool one_byte)
     : next_register_(2 * (capture_count + 1)),
       work_list_(NULL),
       recursion_depth_(0),
@@ -1063,6 +1066,7 @@ RegExpCompiler::RegExpCompiler(int capture_count, bool ignore_case,
       optimize_(FLAG_regexp_optimization),
       current_expansion_factor_(1),
       frequency_collator_(),
+      isolate_(isolate),
       zone_(zone) {
   accept_ = new(zone) EndNode(EndNode::ACCEPT, zone);
   DCHECK(next_register_ - 1 <= RegExpMacroAssembler::kMaxRegister);
@@ -1078,7 +1082,8 @@ RegExpEngine::CompilationResult RegExpCompiler::Assemble(
 
 #ifdef DEBUG
   if (FLAG_trace_regexp_assembler)
-    macro_assembler_ = new RegExpMacroAssemblerTracer(macro_assembler);
+    macro_assembler_ =
+        new RegExpMacroAssemblerTracer(isolate(), macro_assembler);
   else
 #endif
     macro_assembler_ = macro_assembler;
@@ -1094,7 +1099,7 @@ RegExpEngine::CompilationResult RegExpCompiler::Assemble(
   while (!work_list.is_empty()) {
     work_list.RemoveLast()->Emit(this, &new_trace);
   }
-  if (reg_exp_too_big_) return IrregexpRegExpTooBig(zone_->isolate());
+  if (reg_exp_too_big_) return IrregexpRegExpTooBig(isolate_);
 
   Handle<HeapObject> code = macro_assembler_->GetCode(pattern);
   heap->IncreaseTotalRegexpCodeGenerated(code->Size());
@@ -1823,7 +1828,7 @@ static void EmitUseLookupTable(
   for (int i = j; i < kSize; i++) {
     templ[i] = bit;
   }
-  Factory* factory = masm->zone()->isolate()->factory();
+  Factory* factory = masm->isolate()->factory();
   // TODO(erikcorry): Cache these.
   Handle<ByteArray> ba = factory->NewByteArray(kSize, TENURED);
   for (int i = 0; i < kSize; i++) {
@@ -2502,7 +2507,7 @@ void TextNode::GetQuickCheckDetails(QuickCheckDetails* details,
                                     RegExpCompiler* compiler,
                                     int characters_filled_in,
                                     bool not_at_start) {
-  Isolate* isolate = compiler->macro_assembler()->zone()->isolate();
+  Isolate* isolate = compiler->macro_assembler()->isolate();
   DCHECK(characters_filled_in < details->characters());
   int characters = details->characters();
   int char_mask;
@@ -3203,7 +3208,7 @@ void TextNode::TextEmitPass(RegExpCompiler* compiler,
                             bool first_element_checked,
                             int* checked_up_to) {
   RegExpMacroAssembler* assembler = compiler->macro_assembler();
-  Isolate* isolate = assembler->zone()->isolate();
+  Isolate* isolate = assembler->isolate();
   bool one_byte = compiler->one_byte();
   Label* backtrack = trace->backtrack();
   QuickCheckDetails* quick_check = trace->quick_check_performed();
@@ -3364,7 +3369,7 @@ void Trace::AdvanceCurrentPositionInTrace(int by, RegExpCompiler* compiler) {
 }
 
 
-void TextNode::MakeCaseIndependent(bool is_one_byte) {
+void TextNode::MakeCaseIndependent(Isolate* isolate, bool is_one_byte) {
   int element_count = elms_->length();
   for (int i = 0; i < element_count; i++) {
     TextElement elm = elms_->at(i);
@@ -3376,7 +3381,7 @@ void TextNode::MakeCaseIndependent(bool is_one_byte) {
       ZoneList<CharacterRange>* ranges = cc->ranges(zone());
       int range_count = ranges->length();
       for (int j = 0; j < range_count; j++) {
-        ranges->at(j).AddCaseEquivalents(ranges, is_one_byte, zone());
+        ranges->at(j).AddCaseEquivalents(isolate, zone(), ranges, is_one_byte);
       }
     }
   }
@@ -3775,7 +3780,7 @@ void BoyerMooreLookahead::EmitSkipInstructions(RegExpMacroAssembler* masm) {
     return;
   }
 
-  Factory* factory = masm->zone()->isolate()->factory();
+  Factory* factory = masm->isolate()->factory();
   Handle<ByteArray> boolean_skip_table = factory->NewByteArray(kSize, TENURED);
   int skip_distance = GetSkipTable(
       min_lookahead, max_lookahead, boolean_skip_table);
@@ -5303,9 +5308,9 @@ void CharacterRange::Split(ZoneList<CharacterRange>* base,
 }
 
 
-void CharacterRange::AddCaseEquivalents(ZoneList<CharacterRange>* ranges,
-                                        bool is_one_byte, Zone* zone) {
-  Isolate* isolate = zone->isolate();
+void CharacterRange::AddCaseEquivalents(Isolate* isolate, Zone* zone,
+                                        ZoneList<CharacterRange>* ranges,
+                                        bool is_one_byte) {
   uc16 bottom = from();
   uc16 top = to();
   if (is_one_byte && !RangeContainsLatin1Equivalents(*this)) {
@@ -5693,7 +5698,7 @@ OutSet* DispatchTable::Get(uc16 value) {
 
 
 void Analysis::EnsureAnalyzed(RegExpNode* that) {
-  StackLimitCheck check(that->zone()->isolate());
+  StackLimitCheck check(isolate());
   if (check.HasOverflowed()) {
     fail("Stack overflow");
     return;
@@ -5727,7 +5732,7 @@ void TextNode::CalculateOffsets() {
 
 void Analysis::VisitText(TextNode* that) {
   if (ignore_case_) {
-    that->MakeCaseIndependent(is_one_byte_);
+    that->MakeCaseIndependent(isolate(), is_one_byte_);
   }
   EnsureAnalyzed(that->on_success());
   if (!has_failed()) {
@@ -6003,13 +6008,14 @@ void DispatchTableConstructor::VisitAction(ActionNode* that) {
 
 
 RegExpEngine::CompilationResult RegExpEngine::Compile(
-    RegExpCompileData* data, bool ignore_case, bool is_global,
-    bool is_multiline, bool is_sticky, Handle<String> pattern,
-    Handle<String> sample_subject, bool is_one_byte, Zone* zone) {
+    Isolate* isolate, Zone* zone, RegExpCompileData* data, bool ignore_case,
+    bool is_global, bool is_multiline, bool is_sticky, Handle<String> pattern,
+    Handle<String> sample_subject, bool is_one_byte) {
   if ((data->capture_count + 1) * 2 - 1 > RegExpMacroAssembler::kMaxRegister) {
-    return IrregexpRegExpTooBig(zone->isolate());
+    return IrregexpRegExpTooBig(isolate);
   }
-  RegExpCompiler compiler(data->capture_count, ignore_case, is_one_byte, zone);
+  RegExpCompiler compiler(isolate, zone, data->capture_count, ignore_case,
+                          is_one_byte);
 
   compiler.set_optimize(!TooMuchRegExpCode(pattern));
 
@@ -6069,11 +6075,11 @@ RegExpEngine::CompilationResult RegExpEngine::Compile(
 
   if (node == NULL) node = new(zone) EndNode(EndNode::BACKTRACK, zone);
   data->node = node;
-  Analysis analysis(ignore_case, is_one_byte);
+  Analysis analysis(isolate, ignore_case, is_one_byte);
   analysis.EnsureAnalyzed(node);
   if (analysis.has_failed()) {
     const char* error_message = analysis.error_message();
-    return CompilationResult(zone->isolate(), error_message);
+    return CompilationResult(isolate, error_message);
   }
 
   // Create the correct assembler for the architecture.
@@ -6085,29 +6091,29 @@ RegExpEngine::CompilationResult RegExpEngine::Compile(
                   : NativeRegExpMacroAssembler::UC16;
 
 #if V8_TARGET_ARCH_IA32
-  RegExpMacroAssemblerIA32 macro_assembler(mode, (data->capture_count + 1) * 2,
-                                           zone);
+  RegExpMacroAssemblerIA32 macro_assembler(isolate, zone, mode,
+                                           (data->capture_count + 1) * 2);
 #elif V8_TARGET_ARCH_X64
-  RegExpMacroAssemblerX64 macro_assembler(mode, (data->capture_count + 1) * 2,
-                                          zone);
+  RegExpMacroAssemblerX64 macro_assembler(isolate, zone, mode,
+                                          (data->capture_count + 1) * 2);
 #elif V8_TARGET_ARCH_ARM
-  RegExpMacroAssemblerARM macro_assembler(mode, (data->capture_count + 1) * 2,
-                                          zone);
+  RegExpMacroAssemblerARM macro_assembler(isolate, zone, mode,
+                                          (data->capture_count + 1) * 2);
 #elif V8_TARGET_ARCH_ARM64
-  RegExpMacroAssemblerARM64 macro_assembler(mode, (data->capture_count + 1) * 2,
-                                            zone);
+  RegExpMacroAssemblerARM64 macro_assembler(isolate, zone, mode,
+                                            (data->capture_count + 1) * 2);
 #elif V8_TARGET_ARCH_PPC
-  RegExpMacroAssemblerPPC macro_assembler(mode, (data->capture_count + 1) * 2,
-                                          zone);
+  RegExpMacroAssemblerPPC macro_assembler(isolate, zone, mode,
+                                          (data->capture_count + 1) * 2);
 #elif V8_TARGET_ARCH_MIPS
-  RegExpMacroAssemblerMIPS macro_assembler(mode, (data->capture_count + 1) * 2,
-                                           zone);
+  RegExpMacroAssemblerMIPS macro_assembler(isolate, zone, mode,
+                                           (data->capture_count + 1) * 2);
 #elif V8_TARGET_ARCH_MIPS64
-  RegExpMacroAssemblerMIPS macro_assembler(mode, (data->capture_count + 1) * 2,
-                                           zone);
+  RegExpMacroAssemblerMIPS macro_assembler(isolate, zone, mode,
+                                           (data->capture_count + 1) * 2);
 #elif V8_TARGET_ARCH_X87
-  RegExpMacroAssemblerX87 macro_assembler(mode, (data->capture_count + 1) * 2,
-                                          zone);
+  RegExpMacroAssemblerX87 macro_assembler(isolate, zone, mode,
+                                          (data->capture_count + 1) * 2);
 #else
 #error "Unsupported architecture"
 #endif
index 4b84c9558d975b6ccc9b0bace627bbee791c5797..419fd7b8cc449e5f9c0269444ed92145ac4f61fc 100644 (file)
@@ -263,8 +263,8 @@ class CharacterRange {
   bool is_valid() { return from_ <= to_; }
   bool IsEverything(uc16 max) { return from_ == 0 && to_ >= max; }
   bool IsSingleton() { return (from_ == to_); }
-  void AddCaseEquivalents(ZoneList<CharacterRange>* ranges, bool is_one_byte,
-                          Zone* zone);
+  void AddCaseEquivalents(Isolate* isolate, Zone* zone,
+                          ZoneList<CharacterRange>* ranges, bool is_one_byte);
   static void Split(ZoneList<CharacterRange>* base,
                     Vector<const int> overlay,
                     ZoneList<CharacterRange>** included,
@@ -847,7 +847,7 @@ class TextNode: public SeqRegExpNode {
                                     int characters_filled_in,
                                     bool not_at_start);
   ZoneList<TextElement>* elements() { return elms_; }
-  void MakeCaseIndependent(bool is_one_byte);
+  void MakeCaseIndependent(Isolate* isolate, bool is_one_byte);
   virtual int GreedyLoopTextLength();
   virtual RegExpNode* GetSuccessorOfOmnivorousTextNode(
       RegExpCompiler* compiler);
@@ -1598,8 +1598,9 @@ FOR_EACH_NODE_TYPE(DECLARE_VISIT)
 //   +-------+        +------------+
 class Analysis: public NodeVisitor {
  public:
-  Analysis(bool ignore_case, bool is_one_byte)
-      : ignore_case_(ignore_case),
+  Analysis(Isolate* isolate, bool ignore_case, bool is_one_byte)
+      : isolate_(isolate),
+        ignore_case_(ignore_case),
         is_one_byte_(is_one_byte),
         error_message_(NULL) {}
   void EnsureAnalyzed(RegExpNode* node);
@@ -1619,7 +1620,10 @@ FOR_EACH_NODE_TYPE(DECLARE_VISIT)
     error_message_ = error_message;
   }
 
+  Isolate* isolate() const { return isolate_; }
+
  private:
+  Isolate* isolate_;
   bool ignore_case_;
   bool is_one_byte_;
   const char* error_message_;
@@ -1652,19 +1656,18 @@ class RegExpEngine: public AllStatic {
           code(isolate->heap()->the_hole_value()),
           num_registers(0) {}
     CompilationResult(Object* code, int registers)
-      : error_message(NULL),
-        code(code),
-        num_registers(registers) {}
+        : error_message(NULL), code(code), num_registers(registers) {}
     const char* error_message;
     Object* code;
     int num_registers;
   };
 
-  static CompilationResult Compile(RegExpCompileData* input, bool ignore_case,
+  static CompilationResult Compile(Isolate* isolate, Zone* zone,
+                                   RegExpCompileData* input, bool ignore_case,
                                    bool global, bool multiline, bool sticky,
                                    Handle<String> pattern,
                                    Handle<String> sample_subject,
-                                   bool is_one_byte, Zone* zone);
+                                   bool is_one_byte);
 
   static bool TooMuchRegExpCode(Handle<String> pattern);
 
index 5f4f17f16fe1a76029381a414ae732d50f09424e..3b9285689751aba6ea4ab9c4ae6f60605b3a11fb 100644 (file)
@@ -511,8 +511,7 @@ LifetimePosition LiveRange::FirstIntersection(LiveRange* other) {
 
 
 LAllocator::LAllocator(int num_values, HGraph* graph)
-    : zone_(graph->isolate()),
-      chunk_(NULL),
+    : chunk_(NULL),
       live_in_sets_(graph->blocks()->length(), zone()),
       live_ranges_(num_values * 2, zone()),
       fixed_live_ranges_(NULL),
index 29eaa974a6cc002cde618f88443593cd467fd006..8da3d52f555b78e23451bfbfeffacb9454e83f8f 100644 (file)
@@ -1748,13 +1748,12 @@ class MultipleFunctionTarget {
 
 
 // Drops all call frame matched by target and all frames above them.
-template<typename TARGET>
-static const char* DropActivationsInActiveThreadImpl(
-    Isolate* isolate,
-    TARGET& target,  // NOLINT
-    bool do_drop) {
+template <typename TARGET>
+static const char* DropActivationsInActiveThreadImpl(Isolate* isolate,
+                                                     TARGET& target,  // NOLINT
+                                                     bool do_drop) {
   Debug* debug = isolate->debug();
-  Zone zone(isolate);
+  Zone zone;
   Vector<StackFrame*> frames = CreateStackMap(isolate, &zone);
 
 
@@ -1858,14 +1857,14 @@ static const char* DropActivationsInActiveThreadImpl(
 static const char* DropActivationsInActiveThread(
     Handle<JSArray> shared_info_array, Handle<JSArray> result, bool do_drop) {
   MultipleFunctionTarget target(shared_info_array, result);
+  Isolate* isolate = shared_info_array->GetIsolate();
 
-  const char* message = DropActivationsInActiveThreadImpl(
-      shared_info_array->GetIsolate(), target, do_drop);
+  const char* message =
+      DropActivationsInActiveThreadImpl(isolate, target, do_drop);
   if (message) {
     return message;
   }
 
-  Isolate* isolate = shared_info_array->GetIsolate();
   int array_len = GetArrayLength(shared_info_array);
 
   // Replace "blocked on active" with "replaced on active" status.
@@ -2027,8 +2026,8 @@ class SingleFrameTarget {
 const char* LiveEdit::RestartFrame(JavaScriptFrame* frame) {
   SingleFrameTarget target(frame);
 
-  const char* result = DropActivationsInActiveThreadImpl(
-      frame->isolate(), target, true);
+  const char* result =
+      DropActivationsInActiveThreadImpl(frame->isolate(), target, true);
   if (result != NULL) {
     return result;
   }
index dbc12a0797e7841bd85a2e4a7117efec3da757a3..bf3835a842e5a0cf9446e746dadc13352a487a48 100644 (file)
@@ -95,12 +95,11 @@ namespace internal {
 
 #define __ ACCESS_MASM(masm_)
 
-RegExpMacroAssemblerMIPS::RegExpMacroAssemblerMIPS(
-    Mode mode,
-    int registers_to_save,
-    Zone* zone)
-    : NativeRegExpMacroAssembler(zone),
-      masm_(new MacroAssembler(zone->isolate(), NULL, kRegExpCodeSize)),
+RegExpMacroAssemblerMIPS::RegExpMacroAssemblerMIPS(Isolate* isolate, Zone* zone,
+                                                   Mode mode,
+                                                   int registers_to_save)
+    : NativeRegExpMacroAssembler(isolate, zone),
+      masm_(new MacroAssembler(isolate, NULL, kRegExpCodeSize)),
       mode_(mode),
       num_registers_(registers_to_save),
       num_saved_registers_(registers_to_save),
index c7d8f6dcfb49e82de58ec5ad5d3aeba558ac30fc..65ee173b0f31686103bda704654151fe8c409f0c 100644 (file)
@@ -17,7 +17,8 @@ namespace internal {
 #ifndef V8_INTERPRETED_REGEXP
 class RegExpMacroAssemblerMIPS: public NativeRegExpMacroAssembler {
  public:
-  RegExpMacroAssemblerMIPS(Mode mode, int registers_to_save, Zone* zone);
+  RegExpMacroAssemblerMIPS(Isolate* isolate, Zone* zone, Mode mode,
+                           int registers_to_save);
   virtual ~RegExpMacroAssemblerMIPS();
   virtual int stack_limit_slack();
   virtual void AdvanceCurrentPosition(int by);
index cb7b78f69dac90e13b9297c33a9040fee2811d58..332d1ed92c42f4e3f75f759cc9d2d7ce7f76ecd4 100644 (file)
@@ -4260,7 +4260,7 @@ class ScopeInfo : public FixedArray {
                                              Handle<JSObject> scope_object);
 
 
-  static Handle<ScopeInfo> Create(Scope* scope, Zone* zone);
+  static Handle<ScopeInfo> Create(Isolate* isolate, Zone* zone, Scope* scope);
 
   // Serializes empty scope info.
   static ScopeInfo* Empty(Isolate* isolate);
index ec9832111aa9306ccf124ebc62237cd091fbcf1a..51e79bb14cf1c6519de925d6bb1434e06ccc225f 100644 (file)
@@ -265,8 +265,8 @@ void Parser::SetCachedData() {
 
 Scope* Parser::NewScope(Scope* parent, ScopeType scope_type) {
   DCHECK(ast_value_factory());
-  Scope* result =
-      new (zone()) Scope(parent, scope_type, ast_value_factory(), zone());
+  Scope* result = new (zone())
+      Scope(isolate(), zone(), parent, scope_type, ast_value_factory());
   result->Initialize();
   return result;
 }
@@ -778,8 +778,9 @@ ClassLiteral* ParserTraits::ParseClassLiteral(
 
 
 Parser::Parser(CompilationInfo* info, ParseInfo* parse_info)
-    : ParserBase<ParserTraits>(&scanner_, parse_info->stack_limit,
-                               info->extension(), NULL, info->zone(), this),
+    : ParserBase<ParserTraits>(info->isolate(), info->zone(), &scanner_,
+                               parse_info->stack_limit, info->extension(), NULL,
+                               this),
       scanner_(parse_info->unicode_cache),
       reusable_preparser_(NULL),
       original_scope_(NULL),
@@ -897,7 +898,8 @@ FunctionLiteral* Parser::DoParseProgram(CompilationInfo* info, Scope** scope,
     *scope = NewScope(scope_, SCRIPT_SCOPE);
     info->SetScriptScope(*scope);
     if (!info->context().is_null() && !info->context()->IsNativeContext()) {
-      *scope = Scope::DeserializeScopeChain(*info->context(), *scope, zone());
+      *scope = Scope::DeserializeScopeChain(info->isolate(), zone(),
+                                            *info->context(), *scope);
       // The Scope is backed up by ScopeInfo (which is in the V8 heap); this
       // means the Parser cannot operate independent of the V8 heap. Tell the
       // string table to internalize strings and values right after they're
@@ -1031,8 +1033,8 @@ FunctionLiteral* Parser::ParseLazy(Utf16CharacterStream* source) {
     Scope* scope = NewScope(scope_, SCRIPT_SCOPE);
     info()->SetScriptScope(scope);
     if (!info()->closure().is_null()) {
-      scope = Scope::DeserializeScopeChain(info()->closure()->context(), scope,
-                                           zone());
+      scope = Scope::DeserializeScopeChain(isolate(), zone(),
+                                           info()->closure()->context(), scope);
     }
     original_scope_ = scope;
     AstNodeFactory function_factory(ast_value_factory());
@@ -3941,7 +3943,8 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
   DCHECK_EQ(Token::LBRACE, scanner()->current_token());
 
   if (reusable_preparser_ == NULL) {
-    reusable_preparser_ = new PreParser(&scanner_, NULL, stack_limit_);
+    reusable_preparser_ =
+        new PreParser(isolate(), &scanner_, NULL, stack_limit_);
     reusable_preparser_->set_allow_lazy(true);
     reusable_preparser_->set_allow_natives(allow_natives());
     reusable_preparser_->set_allow_harmony_scoping(allow_harmony_scoping());
@@ -4250,8 +4253,9 @@ void Parser::Internalize() {
 
 
 RegExpParser::RegExpParser(FlatStringReader* in, Handle<String>* error,
-                           bool multiline, bool unicode, Zone* zone)
-    : isolate_(zone->isolate()),
+                           bool multiline, bool unicode, Isolate* isolate,
+                           Zone* zone)
+    : isolate_(isolate),
       zone_(zone),
       error_(error),
       captures_(NULL),
@@ -5134,11 +5138,11 @@ RegExpTree* RegExpParser::ParseCharacterClass() {
 // ----------------------------------------------------------------------------
 // The Parser interface.
 
-bool RegExpParser::ParseRegExp(FlatStringReader* input, bool multiline,
-                               bool unicode, RegExpCompileData* result,
-                               Zone* zone) {
+bool RegExpParser::ParseRegExp(Isolate* isolate, Zone* zone,
+                               FlatStringReader* input, bool multiline,
+                               bool unicode, RegExpCompileData* result) {
   DCHECK(result != NULL);
-  RegExpParser parser(input, &result->error, multiline, unicode, zone);
+  RegExpParser parser(input, &result->error, multiline, unicode, isolate, zone);
   RegExpTree* tree = parser.ParsePattern();
   if (parser.failed()) {
     DCHECK(tree == NULL);
index 26190b832874835b8553c695a4c4aabe44d3aeca..8540a159d7e4714fe8e9bd7a48a4b1d201c21513 100644 (file)
@@ -223,10 +223,11 @@ class RegExpBuilder: public ZoneObject {
 class RegExpParser BASE_EMBEDDED {
  public:
   RegExpParser(FlatStringReader* in, Handle<String>* error, bool multiline_mode,
-               bool unicode, Zone* zone);
+               bool unicode, Isolate* isolate, Zone* zone);
 
-  static bool ParseRegExp(FlatStringReader* input, bool multiline, bool unicode,
-                          RegExpCompileData* result, Zone* zone);
+  static bool ParseRegExp(Isolate* isolate, Zone* zone, FlatStringReader* input,
+                          bool multiline, bool unicode,
+                          RegExpCompileData* result);
 
   RegExpTree* ParsePattern();
   RegExpTree* ParseDisjunction();
index 5e37d632fdb8bffbf9e767da466a1eff34ec3c1e..e2929b827d238d120528f2393a0160b1b3c4aaa0 100644 (file)
@@ -68,9 +68,9 @@ class ParserBase : public Traits {
   typedef typename Traits::Type::Literal LiteralT;
   typedef typename Traits::Type::ObjectLiteralProperty ObjectLiteralPropertyT;
 
-  ParserBase(Scanner* scanner, uintptr_t stack_limit, v8::Extension* extension,
-             ParserRecorder* log, typename Traits::Type::Zone* zone,
-             typename Traits::Type::Parser this_object)
+  ParserBase(Isolate* isolate, typename Traits::Type::Zone* zone,
+             Scanner* scanner, uintptr_t stack_limit, v8::Extension* extension,
+             ParserRecorder* log, typename Traits::Type::Parser this_object)
       : Traits(this_object),
         parenthesized_function_(false),
         scope_(NULL),
@@ -80,6 +80,8 @@ class ParserBase : public Traits {
         log_(log),
         mode_(PARSE_EAGERLY),  // Lazy mode must be set explicitly.
         stack_limit_(stack_limit),
+        isolate_(isolate),
+        zone_(zone),
         scanner_(scanner),
         stack_overflow_(false),
         allow_lazy_(false),
@@ -87,8 +89,7 @@ class ParserBase : public Traits {
         allow_harmony_arrow_functions_(false),
         allow_harmony_object_literals_(false),
         allow_harmony_sloppy_(false),
-        allow_harmony_computed_property_names_(false),
-        zone_(zone) {}
+        allow_harmony_computed_property_names_(false) {}
 
   // Getters that indicate whether certain syntactical constructs are
   // allowed to be parsed by this instance of the parser.
@@ -296,6 +297,7 @@ class ParserBase : public Traits {
     Mode old_mode_;
   };
 
+  Isolate* isolate() const { return isolate_; }
   Scanner* scanner() const { return scanner_; }
   int position() { return scanner_->location().beg_pos; }
   int peek_position() { return scanner_->peek_location().beg_pos; }
@@ -608,6 +610,9 @@ class ParserBase : public Traits {
   uintptr_t stack_limit_;
 
  private:
+  Isolate* isolate_;
+  typename Traits::Type::Zone* zone_;  // Only used by Parser.
+
   Scanner* scanner_;
   bool stack_overflow_;
 
@@ -617,8 +622,6 @@ class ParserBase : public Traits {
   bool allow_harmony_object_literals_;
   bool allow_harmony_sloppy_;
   bool allow_harmony_computed_property_names_;
-
-  typename Traits::Type::Zone* zone_;  // Only used by Parser.
 };
 
 
@@ -1494,9 +1497,10 @@ class PreParser : public ParserBase<PreParserTraits> {
     kPreParseSuccess
   };
 
-  PreParser(Scanner* scanner, ParserRecorder* log, uintptr_t stack_limit)
-      : ParserBase<PreParserTraits>(scanner, stack_limit, NULL, log, NULL,
-                                    this) {}
+  PreParser(Isolate* isolate, Scanner* scanner, ParserRecorder* log,
+            uintptr_t stack_limit)
+      : ParserBase<PreParserTraits>(isolate, NULL, scanner, stack_limit, NULL,
+                                    log, this) {}
 
   // Pre-parse the program from the character stream; returns true on
   // success (even if parsing failed, the pre-parse data successfully
@@ -2807,9 +2811,10 @@ ParserBase<Traits>::ParseMemberExpressionContinuation(ExpressionT expression,
 
 
 template <class Traits>
-typename ParserBase<Traits>::ExpressionT ParserBase<
-    Traits>::ParseArrowFunctionLiteral(int start_pos, ExpressionT params_ast,
-                                       bool* ok) {
+typename ParserBase<Traits>::ExpressionT
+ParserBase<Traits>::ParseArrowFunctionLiteral(int start_pos,
+                                              ExpressionT params_ast,
+                                              bool* ok) {
   typename Traits::Type::ScopePtr scope = this->NewScope(scope_, ARROW_SCOPE);
   typename Traits::Type::StatementList body;
   int num_parameters = -1;
index 305adbf17a206f3cbb320c2d2a4595ad7ef93ae6..8a260bd6514d891ccaba432139b26e1db6e9663a 100644 (file)
 namespace v8 {
 namespace internal {
 
-CallPrinter::CallPrinter(Zone* zone) {
+CallPrinter::CallPrinter(Isolate* isolate, Zone* zone) {
   output_ = NULL;
   size_ = 0;
   pos_ = 0;
   position_ = 0;
   found_ = false;
   done_ = false;
-  InitializeAstVisitor(zone);
+  InitializeAstVisitor(isolate, zone);
 }
 
 
@@ -436,11 +436,11 @@ void CallPrinter::PrintLiteral(const AstRawString* value, bool quote) {
 
 #ifdef DEBUG
 
-PrettyPrinter::PrettyPrinter(Zone* zone) {
+PrettyPrinter::PrettyPrinter(Isolate* isolate, Zone* zone) {
   output_ = NULL;
   size_ = 0;
   pos_ = 0;
-  InitializeAstVisitor(zone);
+  InitializeAstVisitor(isolate, zone);
 }
 
 
@@ -917,8 +917,8 @@ const char* PrettyPrinter::PrintProgram(FunctionLiteral* program) {
 }
 
 
-void PrettyPrinter::PrintOut(Zone* zone, AstNode* node) {
-  PrettyPrinter printer(zone);
+void PrettyPrinter::PrintOut(Isolate* isolate, Zone* zone, AstNode* node) {
+  PrettyPrinter printer(isolate, zone);
   PrintF("%s", printer.Print(node));
 }
 
@@ -1086,8 +1086,8 @@ class IndentedScope BASE_EMBEDDED {
 //-----------------------------------------------------------------------------
 
 
-AstPrinter::AstPrinter(Zone* zone) : PrettyPrinter(zone), indent_(0) {
-}
+AstPrinter::AstPrinter(Isolate* isolate, Zone* zone)
+    : PrettyPrinter(isolate, zone), indent_(0) {}
 
 
 AstPrinter::~AstPrinter() {
index c07421a05ad94a1932460c3e8140b2fb26a67749..d1943bcc790fef226f26de5ccf4755ed05c894af 100644 (file)
@@ -13,7 +13,7 @@ namespace internal {
 
 class CallPrinter : public AstVisitor {
  public:
-  explicit CallPrinter(Zone* zone);
+  CallPrinter(Isolate* isolate, Zone* zone);
   virtual ~CallPrinter();
 
   // The following routine prints the node with position |position| into a
@@ -52,7 +52,7 @@ class CallPrinter : public AstVisitor {
 
 class PrettyPrinter: public AstVisitor {
  public:
-  explicit PrettyPrinter(Zone* zone);
+  PrettyPrinter(Isolate* isolate, Zone* zone);
   virtual ~PrettyPrinter();
 
   // The following routines print a node into a string.
@@ -64,7 +64,7 @@ class PrettyPrinter: public AstVisitor {
   void Print(const char* format, ...);
 
   // Print a node to stdout.
-  static void PrintOut(Zone* zone, AstNode* node);
+  static void PrintOut(Isolate* isolate, Zone* zone, AstNode* node);
 
   // Individual nodes
 #define DECLARE_VISIT(type) void Visit##type(type* node) OVERRIDE;
@@ -98,7 +98,7 @@ class PrettyPrinter: public AstVisitor {
 // Prints the AST structure
 class AstPrinter: public PrettyPrinter {
  public:
-  explicit AstPrinter(Zone* zone);
+  AstPrinter(Isolate* isolate, Zone* zone);
   virtual ~AstPrinter();
 
   const char* PrintProgram(FunctionLiteral* program);
index 14da2da895b814977fbb7a2da209a23bb594cf56..71d0b9b0f7ec5a767d654b2a00df1cf81f32f1b1 100644 (file)
@@ -12,9 +12,8 @@ namespace v8 {
 namespace internal {
 
 RegExpMacroAssemblerTracer::RegExpMacroAssemblerTracer(
-    RegExpMacroAssembler* assembler) :
-  RegExpMacroAssembler(assembler->zone()),
-  assembler_(assembler) {
+    Isolate* isolate, RegExpMacroAssembler* assembler)
+    : RegExpMacroAssembler(isolate, assembler->zone()), assembler_(assembler) {
   unsigned int type = assembler->Implementation();
   DCHECK(type < 6);
   const char* impl_names[] = {"IA32", "ARM", "ARM64",
index ac76cfdb0674189906a59882c4183371ef5ae4fb..67b1710e45782b4408c4f61a8eadfac84b6f2c43 100644 (file)
@@ -11,7 +11,7 @@ namespace internal {
 // Decorator on a RegExpMacroAssembler that write all calls.
 class RegExpMacroAssemblerTracer: public RegExpMacroAssembler {
  public:
-  explicit RegExpMacroAssemblerTracer(RegExpMacroAssembler* assembler);
+  RegExpMacroAssemblerTracer(Isolate* isolate, RegExpMacroAssembler* assembler);
   virtual ~RegExpMacroAssemblerTracer();
   virtual int stack_limit_slack() { return assembler_->stack_limit_slack(); }
   virtual bool CanReadUnaligned() { return assembler_->CanReadUnaligned(); }
index 52df648d9a512455ea03bbec556b5248a9aff7b3..90ac1b9fa34f61e1b0a3210e043fc7e838d851d5 100644 (file)
 namespace v8 {
 namespace internal {
 
-RegExpMacroAssembler::RegExpMacroAssembler(Zone* zone)
-  : slow_safe_compiler_(false),
-    global_mode_(NOT_GLOBAL),
-    zone_(zone) {
-}
+RegExpMacroAssembler::RegExpMacroAssembler(Isolate* isolate, Zone* zone)
+    : slow_safe_compiler_(false),
+      global_mode_(NOT_GLOBAL),
+      isolate_(isolate),
+      zone_(zone) {}
 
 
 RegExpMacroAssembler::~RegExpMacroAssembler() {
@@ -26,9 +26,9 @@ RegExpMacroAssembler::~RegExpMacroAssembler() {
 
 #ifndef V8_INTERPRETED_REGEXP  // Avoid unused code, e.g., on ARM.
 
-NativeRegExpMacroAssembler::NativeRegExpMacroAssembler(Zone* zone)
-    : RegExpMacroAssembler(zone) {
-}
+NativeRegExpMacroAssembler::NativeRegExpMacroAssembler(Isolate* isolate,
+                                                       Zone* zone)
+    : RegExpMacroAssembler(isolate, zone) {}
 
 
 NativeRegExpMacroAssembler::~NativeRegExpMacroAssembler() {
index c2f8f4297fda571dcbc9ecbd6c7699ce00973936..60b83a4347f1cc28694b72eef541033d44d4c3c5 100644 (file)
@@ -43,7 +43,7 @@ class RegExpMacroAssembler {
     kCheckStackLimit = true
   };
 
-  explicit RegExpMacroAssembler(Zone* zone);
+  RegExpMacroAssembler(Isolate* isolate, Zone* zone);
   virtual ~RegExpMacroAssembler();
   // The maximal number of pushes between stack checks. Users must supply
   // kCheckStackLimit flag to push operations (instead of kNoStackLimitCheck)
@@ -158,11 +158,13 @@ class RegExpMacroAssembler {
     return global_mode_ == GLOBAL;
   }
 
+  Isolate* isolate() const { return isolate_; }
   Zone* zone() const { return zone_; }
 
  private:
   bool slow_safe_compiler_;
   bool global_mode_;
+  Isolate* isolate_;
   Zone* zone_;
 };
 
@@ -185,7 +187,7 @@ class NativeRegExpMacroAssembler: public RegExpMacroAssembler {
   //        capture positions.
   enum Result { RETRY = -2, EXCEPTION = -1, FAILURE = 0, SUCCESS = 1 };
 
-  explicit NativeRegExpMacroAssembler(Zone* zone);
+  NativeRegExpMacroAssembler(Isolate* isolate, Zone* zone);
   virtual ~NativeRegExpMacroAssembler();
   virtual bool CanReadUnaligned();
 
index c52051aba367d2a4ac7299353ccbf586d7a87c4e..66961278a76f0161e5152b7f5ce10aea7efc22b5 100644 (file)
@@ -15,13 +15,14 @@ namespace internal {
 
 class Processor: public AstVisitor {
  public:
-  Processor(Variable* result, AstValueFactory* ast_value_factory)
+  Processor(Isolate* isolate, Variable* result,
+            AstValueFactory* ast_value_factory)
       : result_(result),
         result_assigned_(false),
         is_set_(false),
         in_try_(false),
         factory_(ast_value_factory) {
-    InitializeAstVisitor(ast_value_factory->zone());
+    InitializeAstVisitor(isolate, ast_value_factory->zone());
   }
 
   virtual ~Processor() { }
@@ -235,7 +236,7 @@ bool Rewriter::Rewrite(CompilationInfo* info) {
         scope->NewTemporary(info->ast_value_factory()->dot_result_string());
     // The name string must be internalized at this point.
     DCHECK(!result->name().is_null());
-    Processor processor(result, info->ast_value_factory());
+    Processor processor(info->isolate(), result, info->ast_value_factory());
     processor.Process(body);
     if (processor.HasStackOverflow()) return false;
 
index 38f238b1cdd76e7fc90f21b7689c33b7201ac268..370b190107fa6be6e99a8635e88d15b331d88a1b 100644 (file)
@@ -163,18 +163,18 @@ RUNTIME_FUNCTION(Runtime_RenderCallSite) {
   isolate->ComputeLocation(&location);
   if (location.start_pos() == -1) return isolate->heap()->empty_string();
 
-  Zone zone(isolate);
+  Zone zone;
   if (location.function()->shared()->is_function()) {
     CompilationInfo info(location.function(), &zone);
     if (!Parser::Parse(&info)) return isolate->heap()->empty_string();
-    CallPrinter printer(&zone);
+    CallPrinter printer(isolate, &zone);
     const char* string = printer.Print(info.function(), location.start_pos());
     return *isolate->factory()->NewStringFromAsciiChecked(string);
   }
 
   CompilationInfo info(location.script(), &zone);
   if (!Parser::Parse(&info)) return isolate->heap()->empty_string();
-  CallPrinter printer(&zone);
+  CallPrinter printer(isolate, &zone);
   const char* string = printer.Print(info.function(), location.start_pos());
   return *isolate->factory()->NewStringFromAsciiChecked(string);
 }
index b9cb6f3ba5e2ace1eaad5cfc4378011c8ae27385..0338b348d142e13e62524338957515516c7e61c6 100644 (file)
@@ -13,7 +13,8 @@ namespace v8 {
 namespace internal {
 
 
-Handle<ScopeInfo> ScopeInfo::Create(Scope* scope, Zone* zone) {
+Handle<ScopeInfo> ScopeInfo::Create(Isolate* isolate, Zone* zone,
+                                    Scope* scope) {
   // Collect stack and context locals.
   ZoneList<Variable*> stack_locals(scope->StackLocalCount(), zone);
   ZoneList<Variable*> context_locals(scope->ContextLocalCount(), zone);
@@ -49,7 +50,7 @@ Handle<ScopeInfo> ScopeInfo::Create(Scope* scope, Zone* zone) {
       + parameter_count + stack_local_count + 2 * context_local_count
       + (has_function_name ? 2 : 0);
 
-  Factory* factory = zone->isolate()->factory();
+  Factory* factory = isolate->factory();
   Handle<ScopeInfo> scope_info = factory->NewScopeInfo(length);
 
   // Encode the flags.
index 39b67a886444fe1db46a54e4006d37abd68d447a..7687a4cbb6dc69fe12dcf5e6285a4321100d5052 100644 (file)
@@ -67,9 +67,9 @@ Variable* VariableMap::Lookup(const AstRawString* name) {
 // ----------------------------------------------------------------------------
 // Implementation of Scope
 
-Scope::Scope(Scope* outer_scope, ScopeType scope_type,
-             AstValueFactory* ast_value_factory, Zone* zone)
-    : isolate_(zone->isolate()),
+Scope::Scope(Isolate* isolate, Zone* zone, Scope* outer_scope,
+             ScopeType scope_type, AstValueFactory* ast_value_factory)
+    : isolate_(isolate),
       inner_scopes_(4, zone),
       variables_(zone),
       internals_(4, zone),
@@ -77,9 +77,10 @@ Scope::Scope(Scope* outer_scope, ScopeType scope_type,
       params_(4, zone),
       unresolved_(16, zone),
       decls_(4, zone),
-      interface_(FLAG_harmony_modules &&
-                 (scope_type == MODULE_SCOPE || scope_type == SCRIPT_SCOPE)
-                     ? Interface::NewModule(zone) : NULL),
+      interface_(FLAG_harmony_modules && (scope_type == MODULE_SCOPE ||
+                                          scope_type == SCRIPT_SCOPE)
+                     ? Interface::NewModule(zone)
+                     : NULL),
       already_resolved_(false),
       ast_value_factory_(ast_value_factory),
       zone_(zone) {
@@ -90,12 +91,10 @@ Scope::Scope(Scope* outer_scope, ScopeType scope_type,
 }
 
 
-Scope::Scope(Scope* inner_scope,
-             ScopeType scope_type,
-             Handle<ScopeInfo> scope_info,
-             AstValueFactory* value_factory,
-             Zone* zone)
-    : isolate_(zone->isolate()),
+Scope::Scope(Isolate* isolate, Zone* zone, Scope* inner_scope,
+             ScopeType scope_type, Handle<ScopeInfo> scope_info,
+             AstValueFactory* value_factory)
+    : isolate_(isolate),
       inner_scopes_(4, zone),
       variables_(zone),
       internals_(4, zone),
@@ -118,9 +117,10 @@ Scope::Scope(Scope* inner_scope,
 }
 
 
-Scope::Scope(Scope* inner_scope, const AstRawString* catch_variable_name,
-             AstValueFactory* value_factory, Zone* zone)
-    : isolate_(zone->isolate()),
+Scope::Scope(Isolate* isolate, Zone* zone, Scope* inner_scope,
+             const AstRawString* catch_variable_name,
+             AstValueFactory* value_factory)
+    : isolate_(isolate),
       inner_scopes_(1, zone),
       variables_(zone),
       internals_(0, zone),
@@ -192,19 +192,17 @@ void Scope::SetDefaults(ScopeType scope_type,
 }
 
 
-Scope* Scope::DeserializeScopeChain(Context* context, Scope* script_scope,
-                                    Zone* zone) {
+Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone,
+                                    Context* context, Scope* script_scope) {
   // Reconstruct the outer scope chain from a closure's context chain.
   Scope* current_scope = NULL;
   Scope* innermost_scope = NULL;
   bool contains_with = false;
   while (!context->IsNativeContext()) {
     if (context->IsWithContext()) {
-      Scope* with_scope = new(zone) Scope(current_scope,
-                                          WITH_SCOPE,
-                                          Handle<ScopeInfo>::null(),
-                                          script_scope->ast_value_factory_,
-                                          zone);
+      Scope* with_scope = new (zone)
+          Scope(isolate, zone, current_scope, WITH_SCOPE,
+                Handle<ScopeInfo>::null(), script_scope->ast_value_factory_);
       current_scope = with_scope;
       // All the inner scopes are inside a with.
       contains_with = true;
@@ -213,41 +211,33 @@ Scope* Scope::DeserializeScopeChain(Context* context, Scope* script_scope,
       }
     } else if (context->IsScriptContext()) {
       ScopeInfo* scope_info = ScopeInfo::cast(context->extension());
-      current_scope = new(zone) Scope(current_scope,
-                                      SCRIPT_SCOPE,
-                                      Handle<ScopeInfo>(scope_info),
-                                      script_scope->ast_value_factory_,
-                                      zone);
+      current_scope = new (zone) Scope(
+          isolate, zone, current_scope, SCRIPT_SCOPE,
+          Handle<ScopeInfo>(scope_info), script_scope->ast_value_factory_);
     } else if (context->IsModuleContext()) {
       ScopeInfo* scope_info = ScopeInfo::cast(context->module()->scope_info());
-      current_scope = new(zone) Scope(current_scope,
-                                      MODULE_SCOPE,
-                                      Handle<ScopeInfo>(scope_info),
-                                      script_scope->ast_value_factory_,
-                                      zone);
+      current_scope = new (zone) Scope(
+          isolate, zone, current_scope, MODULE_SCOPE,
+          Handle<ScopeInfo>(scope_info), script_scope->ast_value_factory_);
     } else if (context->IsFunctionContext()) {
       ScopeInfo* scope_info = context->closure()->shared()->scope_info();
-      current_scope = new(zone) Scope(current_scope,
-                                      FUNCTION_SCOPE,
-                                      Handle<ScopeInfo>(scope_info),
-                                      script_scope->ast_value_factory_,
-                                      zone);
+      current_scope = new (zone) Scope(
+          isolate, zone, current_scope, FUNCTION_SCOPE,
+          Handle<ScopeInfo>(scope_info), script_scope->ast_value_factory_);
       if (scope_info->IsAsmFunction()) current_scope->asm_function_ = true;
       if (scope_info->IsAsmModule()) current_scope->asm_module_ = true;
     } else if (context->IsBlockContext()) {
       ScopeInfo* scope_info = ScopeInfo::cast(context->extension());
-      current_scope = new(zone) Scope(current_scope,
-                                      BLOCK_SCOPE,
-                                      Handle<ScopeInfo>(scope_info),
-                                      script_scope->ast_value_factory_,
-                                      zone);
+      current_scope = new (zone) Scope(
+          isolate, zone, current_scope, BLOCK_SCOPE,
+          Handle<ScopeInfo>(scope_info), script_scope->ast_value_factory_);
     } else {
       DCHECK(context->IsCatchContext());
       String* name = String::cast(context->extension());
       current_scope = new (zone) Scope(
-          current_scope,
+          isolate, zone, current_scope,
           script_scope->ast_value_factory_->GetString(Handle<String>(name)),
-          script_scope->ast_value_factory_, zone);
+          script_scope->ast_value_factory_);
     }
     if (contains_with) current_scope->RecordWithStatement();
     if (innermost_scope == NULL) innermost_scope = current_scope;
@@ -758,7 +748,7 @@ Scope* Scope::DeclarationScope() {
 
 Handle<ScopeInfo> Scope::GetScopeInfo() {
   if (scope_info_.is_null()) {
-    scope_info_ = ScopeInfo::Create(this, zone());
+    scope_info_ = ScopeInfo::Create(isolate(), zone(), this);
   }
   return scope_info_;
 }
index 8d790068783c20e681248972c91dbce176d1848f..98a3014dbcbcad75ee4b9080c9c20ab89888c5e7 100644 (file)
@@ -72,16 +72,16 @@ class Scope: public ZoneObject {
   // ---------------------------------------------------------------------------
   // Construction
 
-  Scope(Scope* outer_scope, ScopeType scope_type,
-        AstValueFactory* value_factory, Zone* zone);
+  Scope(Isolate* isolate, Zone* zone, Scope* outer_scope, ScopeType scope_type,
+        AstValueFactory* value_factory);
 
   // Compute top scope and allocate variables. For lazy compilation the top
   // scope only contains the single lazily compiled function, so this
   // doesn't re-allocate variables repeatedly.
   static bool Analyze(CompilationInfo* info);
 
-  static Scope* DeserializeScopeChain(Context* context, Scope* script_scope,
-                                      Zone* zone);
+  static Scope* DeserializeScopeChain(Isolate* isolate, Zone* zone,
+                                      Context* context, Scope* script_scope);
 
   // The scope name is only used for printing/debugging.
   void SetScopeName(const AstRawString* scope_name) {
@@ -95,6 +95,7 @@ class Scope: public ZoneObject {
   // tree and its children are reparented.
   Scope* FinalizeBlockScope();
 
+  Isolate* isolate() const { return isolate_; }
   Zone* zone() const { return zone_; }
 
   // ---------------------------------------------------------------------------
@@ -651,13 +652,13 @@ class Scope: public ZoneObject {
 
  private:
   // Construct a scope based on the scope info.
-  Scope(Scope* inner_scope, ScopeType type, Handle<ScopeInfo> scope_info,
-        AstValueFactory* value_factory, Zone* zone);
+  Scope(Isolate* isolate, Zone* zone, Scope* inner_scope, ScopeType type,
+        Handle<ScopeInfo> scope_info, AstValueFactory* value_factory);
 
   // Construct a catch scope with a binding for the name.
-  Scope(Scope* inner_scope,
+  Scope(Isolate* isolate, Zone* zone, Scope* inner_scope,
         const AstRawString* catch_variable_name,
-        AstValueFactory* value_factory, Zone* zone);
+        AstValueFactory* value_factory);
 
   void AddInnerScope(Scope* inner_scope) {
     if (inner_scope != NULL) {
index 611373f86547dbcdbc7a6dea9fd12b1baae4fb8d..096e383c94f8e918cc15dbc6f21639f6d40d943c 100644 (file)
@@ -16,16 +16,16 @@ namespace internal {
 
 
 TypeFeedbackOracle::TypeFeedbackOracle(
-    Handle<Code> code, Handle<TypeFeedbackVector> feedback_vector,
-    Handle<Context> native_context, Zone* zone)
-    : native_context_(native_context), zone_(zone) {
+    Isolate* isolate, Zone* zone, Handle<Code> code,
+    Handle<TypeFeedbackVector> feedback_vector, Handle<Context> native_context)
+    : native_context_(native_context), isolate_(isolate), zone_(zone) {
   BuildDictionary(code);
   DCHECK(dictionary_->IsDictionary());
   // We make a copy of the feedback vector because a GC could clear
   // the type feedback info contained therein.
   // TODO(mvstanton): revisit the decision to copy when we weakly
   // traverse the feedback vector at GC time.
-  feedback_vector_ = TypeFeedbackVector::Copy(isolate(), feedback_vector);
+  feedback_vector_ = TypeFeedbackVector::Copy(isolate, feedback_vector);
 }
 
 
index 60f156f5f3da7dc980c28c7fd8dad3c4b6212c15..e9653d5833129c24065cbb03774bc4b879f49092 100644 (file)
@@ -19,9 +19,9 @@ class SmallMapList;
 
 class TypeFeedbackOracle: public ZoneObject {
  public:
-  TypeFeedbackOracle(Handle<Code> code,
+  TypeFeedbackOracle(Isolate* isolate, Zone* zone, Handle<Code> code,
                      Handle<TypeFeedbackVector> feedback_vector,
-                     Handle<Context> native_context, Zone* zone);
+                     Handle<Context> native_context);
 
   bool LoadIsUninitialized(TypeFeedbackId id);
   bool LoadIsUninitialized(FeedbackVectorICSlot slot);
@@ -101,7 +101,7 @@ class TypeFeedbackOracle: public ZoneObject {
   Type* CountType(TypeFeedbackId id);
 
   Zone* zone() const { return zone_; }
-  Isolate* isolate() const { return zone_->isolate(); }
+  Isolate* isolate() const { return isolate_; }
 
  private:
   void CollectReceiverTypes(TypeFeedbackId id,
@@ -137,6 +137,7 @@ class TypeFeedbackOracle: public ZoneObject {
 
  private:
   Handle<Context> native_context_;
+  Isolate* isolate_;
   Zone* zone_;
   Handle<UnseededNumberDictionary> dictionary_;
   Handle<TypeFeedbackVector> feedback_vector_;
index d4147039e0b114221d2c1d5aad58f3959a49fe91..ec0196e8c0c2fbc129b32b33c830d398c129a227 100644 (file)
@@ -16,13 +16,12 @@ namespace internal {
 
 AstTyper::AstTyper(CompilationInfo* info)
     : info_(info),
-      oracle_(
-          handle(info->closure()->shared()->code()),
-          handle(info->closure()->shared()->feedback_vector()),
-          handle(info->closure()->context()->native_context()),
-          info->zone()),
+      oracle_(info->isolate(), info->zone(),
+              handle(info->closure()->shared()->code()),
+              handle(info->closure()->shared()->feedback_vector()),
+              handle(info->closure()->context()->native_context())),
       store_(info->zone()) {
-  InitializeAstVisitor(info->zone());
+  InitializeAstVisitor(info->isolate(), info->zone());
 }
 
 
index 82a3735d77e9ea1c4e3b9f7f4539f6d950419545..1818dbb72c7444658666bb20640bbea6bda6d8a4 100644 (file)
@@ -93,12 +93,11 @@ namespace internal {
 
 #define __ ACCESS_MASM((&masm_))
 
-RegExpMacroAssemblerX64::RegExpMacroAssemblerX64(
-    Mode mode,
-    int registers_to_save,
-    Zone* zone)
-    : NativeRegExpMacroAssembler(zone),
-      masm_(zone->isolate(), NULL, kRegExpCodeSize),
+RegExpMacroAssemblerX64::RegExpMacroAssemblerX64(Isolate* isolate, Zone* zone,
+                                                 Mode mode,
+                                                 int registers_to_save)
+    : NativeRegExpMacroAssembler(isolate, zone),
+      masm_(isolate, NULL, kRegExpCodeSize),
       no_root_array_scope_(&masm_),
       code_relative_fixup_positions_(4, zone),
       mode_(mode),
index e3733775dec6995b679c5fe48a087e9681421c6f..70a6709b5455ec55463a2d175f3b9f0409f4963c 100644 (file)
@@ -17,7 +17,8 @@ namespace internal {
 
 class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
  public:
-  RegExpMacroAssemblerX64(Mode mode, int registers_to_save, Zone* zone);
+  RegExpMacroAssemblerX64(Isolate* isolate, Zone* zone, Mode mode,
+                          int registers_to_save);
   virtual ~RegExpMacroAssemblerX64();
   virtual int stack_limit_slack();
   virtual void AdvanceCurrentPosition(int by);
index eb2e532a228d0390dd6ea62cf545aee428ac7bf0..e52523dd96d11fae0af557491e301d5ecb2730bd 100644 (file)
@@ -44,14 +44,12 @@ class Segment {
 };
 
 
-Zone::Zone(Isolate* isolate)
+Zone::Zone()
     : allocation_size_(0),
       segment_bytes_allocated_(0),
       position_(0),
       limit_(0),
-      segment_head_(NULL),
-      isolate_(isolate) {
-}
+      segment_head_(NULL) {}
 
 
 Zone::~Zone() {
index 6f552b6524413c08172d25e6fd8c70ca2b27f85a..2a730f9ee078c478a912cbe584bcf2c263828af5 100644 (file)
@@ -36,7 +36,7 @@ class Isolate;
 
 class Zone {
  public:
-  explicit Zone(Isolate* isolate);
+  Zone();
   ~Zone();
   // Allocate 'size' bytes of memory in the Zone; expands the Zone by
   // allocating new segments of memory on demand using malloc().
@@ -65,8 +65,6 @@ class Zone {
 
   inline unsigned allocation_size() const { return allocation_size_; }
 
-  inline Isolate* isolate() const { return isolate_; }
-
  private:
   friend class Isolate;
 
@@ -120,7 +118,6 @@ class Zone {
   Address limit_;
 
   Segment* segment_head_;
-  Isolate* isolate_;
 };
 
 
index af0f666a89c1466d0fdcb2cdf97ad67c27b246d6..e3e7607479bed4e6d7afb0d19a3924bd3c4d2d35 100644 (file)
@@ -577,7 +577,7 @@ class InitializedHandleScope {
 
 class HandleAndZoneScope : public InitializedHandleScope {
  public:
-  HandleAndZoneScope() : main_zone_(main_isolate()) {}
+  HandleAndZoneScope() {}
 
   // Prefixing the below with main_ reduces a lot of naming clashes.
   i::Zone* main_zone() { return &main_zone_; }
index 283d5339740cc5d53a65b2ce62a3d61cff61774f..18903fd85ef0e604c93b22bc2b652b3cb93234f3 100644 (file)
@@ -32,7 +32,7 @@ class MachineAssemblerTester : public HandleAndZoneScope,
             main_isolate(),
             MakeMachineSignature(main_zone(), return_type, p0, p1, p2, p3, p4)),
         MachineAssembler(
-            new (main_zone()) Graph(main_zone()),
+            main_isolate(), new (main_zone()) Graph(main_zone()),
             MakeMachineSignature(main_zone(), return_type, p0, p1, p2, p3, p4),
             kMachPtr, flags) {}
 
@@ -68,8 +68,8 @@ class MachineAssemblerTester : public HandleAndZoneScope,
       Schedule* schedule = this->Export();
       CallDescriptor* call_descriptor = this->call_descriptor();
       Graph* graph = this->graph();
-      code_ =
-          Pipeline::GenerateCodeForTesting(call_descriptor, graph, schedule);
+      code_ = Pipeline::GenerateCodeForTesting(this->isolate(), call_descriptor,
+                                               graph, schedule);
     }
     return this->code_.ToHandleChecked()->entry();
   }
index b0f470b01df6dd8efbf0edfa9d17c7d58c5607db..de39410d32188116f1daba547b3a92e67c886f7d 100644 (file)
@@ -11,9 +11,11 @@ namespace v8 {
 namespace internal {
 namespace compiler {
 
-MachineCallHelper::MachineCallHelper(Zone* zone, MachineSignature* machine_sig)
-    : CallHelper(zone->isolate(), machine_sig),
+MachineCallHelper::MachineCallHelper(Isolate* isolate,
+                                     MachineSignature* machine_sig)
+    : CallHelper(isolate, machine_sig),
       parameters_(NULL),
+      isolate_(isolate),
       graph_(NULL) {}
 
 
@@ -37,7 +39,7 @@ byte* MachineCallHelper::Generate() {
     Zone* zone = graph_->zone();
     CallDescriptor* desc =
         Linkage::GetSimplifiedCDescriptor(zone, machine_sig_);
-    code_ = Pipeline::GenerateCodeForTesting(desc, graph_);
+    code_ = Pipeline::GenerateCodeForTesting(isolate_, desc, graph_);
   }
   return code_.ToHandleChecked()->entry();
 }
index 772de4d11c366f991096211416a4413c7dfb6f06..9d71c85018291c3fc13c816bec57ca78990ae815 100644 (file)
@@ -22,7 +22,8 @@ namespace compiler {
 // A class that just passes node creation on to the Graph.
 class DirectGraphBuilder : public GraphBuilder {
  public:
-  explicit DirectGraphBuilder(Graph* graph) : GraphBuilder(graph) {}
+  DirectGraphBuilder(Isolate* isolate, Graph* graph)
+      : GraphBuilder(isolate, graph) {}
   virtual ~DirectGraphBuilder() {}
 
  protected:
@@ -35,7 +36,7 @@ class DirectGraphBuilder : public GraphBuilder {
 
 class MachineCallHelper : public CallHelper {
  public:
-  MachineCallHelper(Zone* zone, MachineSignature* machine_sig);
+  MachineCallHelper(Isolate* isolate, MachineSignature* machine_sig);
 
   Node* Parameter(size_t index);
 
@@ -51,6 +52,7 @@ class MachineCallHelper : public CallHelper {
  private:
   Node** parameters_;
   // TODO(dcarney): shouldn't need graph stored.
+  Isolate* isolate_;
   Graph* graph_;
   MaybeHandle<Code> code_;
 };
@@ -88,12 +90,12 @@ class GraphBuilderTester
                               MachineType p4 = kMachNone)
       : GraphAndBuilders(main_zone()),
         MachineCallHelper(
-            main_zone(),
+            main_isolate(),
             MakeMachineSignature(
                 main_zone(), ReturnValueTraits<ReturnType>::Representation(),
                 p0, p1, p2, p3, p4)),
-        SimplifiedGraphBuilder(main_graph_, &main_common_, &main_machine_,
-                               &main_simplified_) {
+        SimplifiedGraphBuilder(main_isolate(), main_graph_, &main_common_,
+                               &main_machine_, &main_simplified_) {
     Begin(static_cast<int>(parameter_count()));
     InitParameters(this, &main_common_);
   }
index baa03fbb8fc453ad37dcdda3c63be0f01ddd95ee..e65ba2e0df48f60bbae08d62979274354efc7b75 100644 (file)
@@ -11,9 +11,9 @@ namespace internal {
 namespace compiler {
 
 SimplifiedGraphBuilder::SimplifiedGraphBuilder(
-    Graph* graph, CommonOperatorBuilder* common,
+    Isolate* isolate, Graph* graph, CommonOperatorBuilder* common,
     MachineOperatorBuilder* machine, SimplifiedOperatorBuilder* simplified)
-    : GraphBuilder(graph),
+    : GraphBuilder(isolate, graph),
       effect_(NULL),
       return_(NULL),
       common_(common),
index 537094a3b68e621b01a2a073c1377018c398ec51..c1a8b9be4ccd25a7e2d10442f0af42d58efa1b63 100644 (file)
@@ -18,13 +18,13 @@ namespace compiler {
 
 class SimplifiedGraphBuilder : public GraphBuilder {
  public:
-  SimplifiedGraphBuilder(Graph* graph, CommonOperatorBuilder* common,
+  SimplifiedGraphBuilder(Isolate* isolate, Graph* graph,
+                         CommonOperatorBuilder* common,
                          MachineOperatorBuilder* machine,
                          SimplifiedOperatorBuilder* simplified);
   virtual ~SimplifiedGraphBuilder() {}
 
   Zone* zone() const { return graph()->zone(); }
-  Isolate* isolate() const { return zone()->isolate(); }
   CommonOperatorBuilder* common() const { return common_; }
   MachineOperatorBuilder* machine() const { return machine_; }
   SimplifiedOperatorBuilder* simplified() const { return simplified_; }
index 5795754c455f2aba945f228f6cbc06933b87ad14..c69d917c46b5a36a206797c82c62013043adf628 100644 (file)
@@ -33,7 +33,8 @@ class ChangesLoweringTester : public GraphBuilderTester<ReturnType> {
   explicit ChangesLoweringTester(MachineType p0 = kMachNone)
       : GraphBuilderTester<ReturnType>(p0),
         javascript(this->zone()),
-        jsgraph(this->graph(), this->common(), &javascript, this->machine()),
+        jsgraph(this->isolate(), this->graph(), this->common(), &javascript,
+                this->machine()),
         function(Handle<JSFunction>::null()) {}
 
   JSOperatorBuilder javascript;
@@ -127,7 +128,7 @@ class ChangesLoweringTester : public GraphBuilderTester<ReturnType> {
     // Run the graph reducer with changes lowering on a single node.
     CompilationInfo info(this->isolate(), this->zone());
     Linkage linkage(this->zone(), &info);
-    Typer typer(this->graph(), info.context());
+    Typer typer(this->isolate(), this->graph(), info.context());
     typer.Run();
     ChangeLowering change_lowering(&jsgraph, &linkage);
     SelectLowering select_lowering(this->graph(), this->common());
index 56afe7b6dd399df2049bbc43f3dbbb17c63cba65..e017cd6c4ac6163bc2ba1bf87e1cc54055302b94 100644 (file)
@@ -72,6 +72,7 @@ class DeoptCodegenTester {
   }
 
   Zone* zone() { return scope_->main_zone(); }
+  Isolate* isolate() { return scope_->main_isolate(); }
 
   HandleAndZoneScope* scope_;
   Handle<JSFunction> function;
@@ -102,7 +103,7 @@ class TrivialDeoptCodegenTester : public DeoptCodegenTester {
     // }
 
     CSignature1<Object*, Object*> sig;
-    RawMachineAssembler m(graph, &sig);
+    RawMachineAssembler m(isolate(), graph, &sig);
 
     Handle<JSFunction> deopt_function =
         NewFunction("function deopt() { %DeoptimizeFunction(foo); }; deopt");
@@ -220,7 +221,7 @@ class TrivialRuntimeDeoptCodegenTester : public DeoptCodegenTester {
     // }
 
     CSignature1<Object*, Object*> sig;
-    RawMachineAssembler m(graph, &sig);
+    RawMachineAssembler m(isolate(), graph, &sig);
 
     Unique<HeapObject> this_fun_constant =
         Unique<HeapObject>::CreateUninitialized(function);
index 61dad29f11e31d0054720d6ac01e06d3426fbae8..13e60bc13cd80aca4957db4c198bb12e61c8a3d7 100644 (file)
@@ -64,7 +64,7 @@ class ControlReducerTester : HandleAndZoneScope {
       : isolate(main_isolate()),
         common(main_zone()),
         graph(main_zone()),
-        jsgraph(&graph, &common, NULL, NULL),
+        jsgraph(main_isolate(), &graph, &common, NULL, NULL),
         start(graph.NewNode(common.Start(1))),
         end(graph.NewNode(common.End(), start)),
         p0(graph.NewNode(common.Parameter(0), start)),
index e6e44ea1748c587d6db835d1d2e47e2a4cb0159b..5d0043896551a3881337d487ae45fd6a3420d0c3 100644 (file)
@@ -55,7 +55,8 @@ class InstructionTester : public HandleAndZoneScope {
     }
     InstructionBlocks* instruction_blocks =
         TestInstrSeq::InstructionBlocksFor(main_zone(), &schedule);
-    code = new (main_zone()) TestInstrSeq(main_zone(), instruction_blocks);
+    code = new (main_zone())
+        TestInstrSeq(main_isolate(), main_zone(), instruction_blocks);
   }
 
   Node* Int32Constant(int32_t val) {
@@ -288,7 +289,7 @@ TEST(InstructionAddGapMove) {
 
 
 TEST(InstructionOperands) {
-  Zone zone(CcTest::InitIsolateOnce());
+  Zone zone;
 
   {
     TestInstr* i = TestInstr::New(&zone, 101);
index 5a389c2df1b098b40754ccf31551832100af3b09..5a4e700c4638c21b47e5690993995cd1b5db3654 100644 (file)
@@ -17,11 +17,11 @@ using namespace v8::internal::compiler;
 
 class JSCacheTesterHelper {
  protected:
-  explicit JSCacheTesterHelper(Zone* zone)
+  JSCacheTesterHelper(Isolate* isolate, Zone* zone)
       : main_graph_(zone),
         main_common_(zone),
         main_javascript_(zone),
-        main_typer_(&main_graph_, MaybeHandle<Context>()),
+        main_typer_(isolate, &main_graph_, MaybeHandle<Context>()),
         main_machine_(zone) {}
   Graph main_graph_;
   CommonOperatorBuilder main_common_;
@@ -37,8 +37,8 @@ class JSConstantCacheTester : public HandleAndZoneScope,
                               public JSGraph {
  public:
   JSConstantCacheTester()
-      : JSCacheTesterHelper(main_zone()),
-        JSGraph(&main_graph_, &main_common_, &main_javascript_,
+      : JSCacheTesterHelper(main_isolate(), main_zone()),
+        JSGraph(main_isolate(), &main_graph_, &main_common_, &main_javascript_,
                 &main_machine_) {
     main_graph_.SetStart(main_graph_.NewNode(common()->Start(0)));
     main_graph_.SetEnd(main_graph_.NewNode(common()->End()));
index fb7bd946f2dc57ade0db28f9f8c27613fa63f3bc..16099692730120c4f6e503b1163385c42c90ae50 100644 (file)
@@ -18,12 +18,13 @@ class ContextSpecializationTester : public HandleAndZoneScope,
                                     public DirectGraphBuilder {
  public:
   ContextSpecializationTester()
-      : DirectGraphBuilder(new (main_zone()) Graph(main_zone())),
+      : DirectGraphBuilder(main_isolate(),
+                           new (main_zone()) Graph(main_zone())),
         common_(main_zone()),
         javascript_(main_zone()),
         machine_(main_zone()),
         simplified_(main_zone()),
-        jsgraph_(graph(), common(), &javascript_, &machine_),
+        jsgraph_(main_isolate(), graph(), common(), &javascript_, &machine_),
         info_(main_isolate(), main_zone()) {}
 
   Factory* factory() { return main_isolate()->factory(); }
index 38867866ef518691dcdfe98f111e40b1c46f00e1..614bd686d97f49311043349a200ae9bfa0d9861c 100644 (file)
@@ -25,7 +25,7 @@ class JSTypedLoweringTester : public HandleAndZoneScope {
         simplified(main_zone()),
         common(main_zone()),
         graph(main_zone()),
-        typer(&graph, MaybeHandle<Context>()),
+        typer(main_isolate(), &graph, MaybeHandle<Context>()),
         context_node(NULL) {
     graph.SetStart(graph.NewNode(common.Start(num_parameters)));
     graph.SetEnd(graph.NewNode(common.End()));
@@ -75,7 +75,7 @@ class JSTypedLoweringTester : public HandleAndZoneScope {
   }
 
   Node* reduce(Node* node) {
-    JSGraph jsgraph(&graph, &common, &javascript, &machine);
+    JSGraph jsgraph(main_isolate(), &graph, &common, &javascript, &machine);
     JSTypedLowering reducer(&jsgraph, main_zone());
     Reduction reduction = reducer.Reduce(node);
     if (reduction.Changed()) return reduction.replacement();
index 4365170395161ea54b00774bb87ee1cbfc5013db..894c9c7e3ebec8f7c95b10aa919624f5e87c2670 100644 (file)
@@ -20,7 +20,7 @@ class TestCode : public HandleAndZoneScope {
   TestCode()
       : HandleAndZoneScope(),
         blocks_(main_zone()),
-        sequence_(main_zone(), &blocks_),
+        sequence_(main_isolate(), main_zone(), &blocks_),
         rpo_number_(RpoNumber::FromInt(0)),
         current_(NULL) {}
 
@@ -102,7 +102,7 @@ class TestCode : public HandleAndZoneScope {
 
 
 void VerifyForwarding(TestCode& code, int count, int* expected) {
-  Zone local_zone(code.main_isolate());
+  Zone local_zone;
   ZoneVector<RpoNumber> result(&local_zone);
   JumpThreading::ComputeForwarding(&local_zone, result, &code.sequence_);
 
index 3a8614412d3f31fe4617a9cf99d83eeb2fb04d95..71708aad810b000905933a02afa964b093c99115 100644 (file)
@@ -39,7 +39,7 @@ class LoopFinderTester : HandleAndZoneScope {
       : isolate(main_isolate()),
         common(main_zone()),
         graph(main_zone()),
-        jsgraph(&graph, &common, NULL, NULL),
+        jsgraph(main_isolate(), &graph, &common, NULL, NULL),
         start(graph.NewNode(common.Start(1))),
         end(graph.NewNode(common.End(), start)),
         p0(graph.NewNode(common.Parameter(0), start)),
@@ -127,7 +127,7 @@ class LoopFinderTester : HandleAndZoneScope {
         OFStream os(stdout);
         os << AsRPO(graph);
       }
-      Zone zone(isolate);
+      Zone zone;
       loop_tree = LoopFinder::BuildLoopTree(&graph, &zone);
     }
     return loop_tree;
index e582f26d70da7e69a66be51a628212da6bb2439e..c46045635d2354eb88cabdbded9e3ce7c1c9be9e 100644 (file)
@@ -61,8 +61,8 @@ class ReducerTester : public HandleAndZoneScope {
         common(main_zone()),
         graph(main_zone()),
         javascript(main_zone()),
-        typer(&graph, MaybeHandle<Context>()),
-        jsgraph(&graph, &common, &javascript, &machine),
+        typer(isolate, &graph, MaybeHandle<Context>()),
+        jsgraph(isolate, &graph, &common, &javascript, &machine),
         maxuint32(Constant<int32_t>(kMaxUInt32)) {
     Node* s = graph.NewNode(common.Start(num_parameters));
     graph.SetStart(s);
index 92b61164887bf80d84709cdae7f1ac875ebc78a9..b3af6bea09a113726fad075abc245060e09edb51 100644 (file)
@@ -45,7 +45,7 @@ class OsrDeconstructorTester : public HandleAndZoneScope {
       : isolate(main_isolate()),
         common(main_zone()),
         graph(main_zone()),
-        jsgraph(&graph, &common, NULL, NULL),
+        jsgraph(main_isolate(), &graph, &common, NULL, NULL),
         start(graph.NewNode(common.Start(1))),
         p0(graph.NewNode(common.Parameter(0), start)),
         end(graph.NewNode(common.End(), start)),
index a96859b0493f55cd262f7a429952240a12a7aed9..f44648e651594577d67067f885ad3024ac2d85b4 100644 (file)
@@ -25,7 +25,8 @@ class RepresentationChangerTester : public HandleAndZoneScope,
   explicit RepresentationChangerTester(int num_parameters = 0)
       : GraphAndBuilders(main_zone()),
         javascript_(main_zone()),
-        jsgraph_(main_graph_, &main_common_, &javascript_, &main_machine_),
+        jsgraph_(main_isolate(), main_graph_, &main_common_, &javascript_,
+                 &main_machine_),
         changer_(&jsgraph_, &main_simplified_, main_isolate()) {
     Node* s = graph()->NewNode(common()->Start(num_parameters));
     graph()->SetStart(s);
index c4f497ccca4b1c5d53a4baaea2144deadd99f029..d770aa3e32275fc86ffc74936911c3e3d263a586 100644 (file)
@@ -36,9 +36,10 @@ class SimplifiedLoweringTester : public GraphBuilderTester<ReturnType> {
                            MachineType p3 = kMachNone,
                            MachineType p4 = kMachNone)
       : GraphBuilderTester<ReturnType>(p0, p1, p2, p3, p4),
-        typer(this->graph(), MaybeHandle<Context>()),
+        typer(this->isolate(), this->graph(), MaybeHandle<Context>()),
         javascript(this->zone()),
-        jsgraph(this->graph(), this->common(), &javascript, this->machine()),
+        jsgraph(this->isolate(), this->graph(), this->common(), &javascript,
+                this->machine()),
         lowering(&jsgraph, this->zone()) {}
 
   Typer typer;
@@ -58,9 +59,9 @@ class SimplifiedLoweringTester : public GraphBuilderTester<ReturnType> {
     lowering.LowerAllNodes();
 
     Zone* zone = this->zone();
-    CompilationInfo info(zone->isolate(), zone);
-    Linkage linkage(
-        zone, Linkage::GetSimplifiedCDescriptor(zone, this->machine_sig_));
+    CompilationInfo info(this->isolate(), zone);
+    Linkage linkage(this->isolate(), zone, Linkage::GetSimplifiedCDescriptor(
+                                               zone, this->machine_sig_));
     ChangeLowering lowering(&jsgraph, &linkage);
     GraphReducer reducer(this->graph(), this->zone());
     reducer.AddReducer(&lowering);
@@ -666,9 +667,9 @@ class TestingGraph : public HandleAndZoneScope, public GraphAndBuilders {
   explicit TestingGraph(Type* p0_type, Type* p1_type = Type::None(),
                         Type* p2_type = Type::None())
       : GraphAndBuilders(main_zone()),
-        typer(graph(), MaybeHandle<Context>()),
+        typer(main_isolate(), graph(), MaybeHandle<Context>()),
         javascript(main_zone()),
-        jsgraph(graph(), common(), &javascript, machine()) {
+        jsgraph(main_isolate(), graph(), common(), &javascript, machine()) {
     start = graph()->NewNode(common()->Start(2));
     graph()->SetStart(start);
     ret =
@@ -971,7 +972,7 @@ TEST(LowerNumberCmp_to_float64) {
 
 TEST(LowerNumberAddSub_to_int32) {
   HandleAndZoneScope scope;
-  Factory* f = scope.main_zone()->isolate()->factory();
+  Factory* f = scope.main_isolate()->factory();
   Type* small_range =
       Type::Range(f->NewNumber(1), f->NewNumber(10), scope.main_zone());
   Type* large_range =
@@ -995,7 +996,7 @@ TEST(LowerNumberAddSub_to_int32) {
 
 TEST(LowerNumberAddSub_to_uint32) {
   HandleAndZoneScope scope;
-  Factory* f = scope.main_zone()->isolate()->factory();
+  Factory* f = scope.main_isolate()->factory();
   Type* small_range =
       Type::Range(f->NewNumber(1), f->NewNumber(10), scope.main_zone());
   Type* large_range =
index 5f7f55afaaf23094ec843d049055510751783356..eb5e540881c0e4a331a3f7619eb1bf9fa9a42c2f 100644 (file)
@@ -22,7 +22,7 @@ class TyperTester : public HandleAndZoneScope, public GraphAndBuilders {
   TyperTester()
       : GraphAndBuilders(main_zone()),
         types_(main_zone(), isolate()),
-        typer_(graph(), MaybeHandle<Context>()),
+        typer_(isolate(), graph(), MaybeHandle<Context>()),
         javascript_(main_zone()) {
     Node* s = graph()->NewNode(common()->Start(3));
     graph()->SetStart(s);
index 096d5c788f9e03735f70461f9965793e794db3b0..7d8b4059f581c4d9f60ea1d7648986147e117fba 100644 (file)
@@ -38,8 +38,7 @@ TEST(List) {
   List<AstNode*>* list = new List<AstNode*>(0);
   CHECK_EQ(0, list->length());
 
-  Isolate* isolate = CcTest::i_isolate();
-  Zone zone(isolate);
+  Zone zone;
   AstValueFactory value_factory(&zone, 0);
   AstNodeFactory factory(&value_factory);
   AstNode* node = factory.NewEmptyStatement(RelocInfo::kNoPosition);
index ac00fabb926226401b36fdc62e1b4e872afa5dad..e8571d965e9f69444c64d6cc176ed60be4e28916 100644 (file)
@@ -35,7 +35,7 @@
 using namespace v8::internal;
 
 TEST(BitVector) {
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   {
     BitVector v(15, &zone);
     v.Add(1);
index 6a5f0b29970578491fe8947e1beea0f17963c533..8419dc5a4393351022a434db2326c7605a38514c 100644 (file)
@@ -95,7 +95,7 @@ void CompareStringsOneWay(const char* s1, const char* s2,
                           int expected_diff_parameter = -1) {
   StringCompareInput input(s1, s2);
 
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
 
   DiffChunkStruct* first_chunk;
   ListDiffOutputWriter writer(&first_chunk, &zone);
index 24da4c7a06bc06164895dda8ab62462d111e117d..f2b82ccf9811107ef798d3666b9c897a515f8aff 100644 (file)
@@ -157,7 +157,7 @@ TEST(ScanHTMLEndComments) {
     i::CompleteParserRecorder log;
     i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
     scanner.Initialize(&stream);
-    i::PreParser preparser(&scanner, &log, stack_limit);
+    i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, stack_limit);
     preparser.set_allow_lazy(true);
     i::PreParser::PreParseResult result = preparser.PreParseProgram();
     CHECK_EQ(i::PreParser::kPreParseSuccess, result);
@@ -171,7 +171,7 @@ TEST(ScanHTMLEndComments) {
     i::CompleteParserRecorder log;
     i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
     scanner.Initialize(&stream);
-    i::PreParser preparser(&scanner, &log, stack_limit);
+    i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, stack_limit);
     preparser.set_allow_lazy(true);
     i::PreParser::PreParseResult result = preparser.PreParseProgram();
     // Even in the case of a syntax error, kPreParseSuccess is returned.
@@ -317,7 +317,7 @@ TEST(StandAlonePreParser) {
     i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
     scanner.Initialize(&stream);
 
-    i::PreParser preparser(&scanner, &log, stack_limit);
+    i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, stack_limit);
     preparser.set_allow_lazy(true);
     preparser.set_allow_natives(true);
     preparser.set_allow_harmony_arrow_functions(true);
@@ -351,7 +351,7 @@ TEST(StandAlonePreParserNoNatives) {
     scanner.Initialize(&stream);
 
     // Preparser defaults to disallowing natives syntax.
-    i::PreParser preparser(&scanner, &log, stack_limit);
+    i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, stack_limit);
     preparser.set_allow_lazy(true);
     i::PreParser::PreParseResult result = preparser.PreParseProgram();
     CHECK_EQ(i::PreParser::kPreParseSuccess, result);
@@ -416,7 +416,7 @@ TEST(RegressChromium62639) {
   i::CompleteParserRecorder log;
   i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
   scanner.Initialize(&stream);
-  i::PreParser preparser(&scanner, &log,
+  i::PreParser preparser(CcTest::i_isolate(), &scanner, &log,
                          CcTest::i_isolate()->stack_guard()->real_climit());
   preparser.set_allow_lazy(true);
   i::PreParser::PreParseResult result = preparser.PreParseProgram();
@@ -448,7 +448,7 @@ TEST(Regress928) {
   i::CompleteParserRecorder log;
   i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
   scanner.Initialize(&stream);
-  i::PreParser preparser(&scanner, &log,
+  i::PreParser preparser(CcTest::i_isolate(), &scanner, &log,
                          CcTest::i_isolate()->stack_guard()->real_climit());
   preparser.set_allow_lazy(true);
   i::PreParser::PreParseResult result = preparser.PreParseProgram();
@@ -497,7 +497,7 @@ TEST(PreParseOverflow) {
   i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
   scanner.Initialize(&stream);
 
-  i::PreParser preparser(&scanner, &log, stack_limit);
+  i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, stack_limit);
   preparser.set_allow_lazy(true);
   preparser.set_allow_harmony_arrow_functions(true);
   i::PreParser::PreParseResult result = preparser.PreParseProgram();
@@ -805,7 +805,7 @@ void TestScanRegExp(const char* re_source, const char* expected) {
   CHECK(start == i::Token::DIV || start == i::Token::ASSIGN_DIV);
   CHECK(scanner.ScanRegExpPattern(start == i::Token::ASSIGN_DIV));
   scanner.Next();  // Current token is now the regexp literal.
-  i::Zone zone(CcTest::i_isolate());
+  i::Zone zone;
   i::AstValueFactory ast_value_factory(&zone,
                                        CcTest::i_isolate()->heap()->HashSeed());
   ast_value_factory.Internalize(CcTest::i_isolate());
@@ -1406,7 +1406,7 @@ void TestParserSyncWithFlags(i::Handle<i::String> source,
   {
     i::Scanner scanner(isolate->unicode_cache());
     i::GenericStringUtf16CharacterStream stream(source, 0, source->length());
-    i::PreParser preparser(&scanner, &log, stack_limit);
+    i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, stack_limit);
     SetParserFlags(&preparser, flags);
     scanner.Initialize(&stream);
     i::PreParser::PreParseResult result = preparser.PreParseProgram(
@@ -3096,7 +3096,7 @@ TEST(SerializationOfMaybeAssignmentFlag) {
   i::Handle<i::String> source = factory->InternalizeUtf8String(program.start());
   source->PrintOn(stdout);
   printf("\n");
-  i::Zone zone(isolate);
+  i::Zone zone;
   v8::Local<v8::Value> v = CompileRun(src);
   i::Handle<i::Object> o = v8::Utils::OpenHandle(*v);
   i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o);
@@ -3107,9 +3107,10 @@ TEST(SerializationOfMaybeAssignmentFlag) {
   i::Handle<i::String> str = name->string();
   CHECK(str->IsInternalizedString());
   i::Scope* script_scope =
-      new (&zone) i::Scope(NULL, i::SCRIPT_SCOPE, &avf, &zone);
+      new (&zone) i::Scope(isolate, &zone, NULL, i::SCRIPT_SCOPE, &avf);
   script_scope->Initialize();
-  i::Scope* s = i::Scope::DeserializeScopeChain(context, script_scope, &zone);
+  i::Scope* s =
+      i::Scope::DeserializeScopeChain(isolate, &zone, context, script_scope);
   DCHECK(s != script_scope);
   DCHECK(name != NULL);
 
@@ -3145,7 +3146,7 @@ TEST(IfArgumentsArrayAccessedThenParametersMaybeAssigned) {
   i::Handle<i::String> source = factory->InternalizeUtf8String(program.start());
   source->PrintOn(stdout);
   printf("\n");
-  i::Zone zone(isolate);
+  i::Zone zone;
   v8::Local<v8::Value> v = CompileRun(src);
   i::Handle<i::Object> o = v8::Utils::OpenHandle(*v);
   i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o);
@@ -3154,9 +3155,10 @@ TEST(IfArgumentsArrayAccessedThenParametersMaybeAssigned) {
   avf.Internalize(isolate);
 
   i::Scope* script_scope =
-      new (&zone) i::Scope(NULL, i::SCRIPT_SCOPE, &avf, &zone);
+      new (&zone) i::Scope(isolate, &zone, NULL, i::SCRIPT_SCOPE, &avf);
   script_scope->Initialize();
-  i::Scope* s = i::Scope::DeserializeScopeChain(context, script_scope, &zone);
+  i::Scope* s =
+      i::Scope::DeserializeScopeChain(isolate, &zone, context, script_scope);
   DCHECK(s != script_scope);
   const i::AstRawString* name_x = avf.GetOneByteString("x");
 
@@ -3192,7 +3194,7 @@ TEST(ExportsMaybeAssigned) {
   i::Handle<i::String> source = factory->InternalizeUtf8String(program.start());
   source->PrintOn(stdout);
   printf("\n");
-  i::Zone zone(isolate);
+  i::Zone zone;
   v8::Local<v8::Value> v = CompileRun(src);
   i::Handle<i::Object> o = v8::Utils::OpenHandle(*v);
   i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o);
@@ -3201,9 +3203,10 @@ TEST(ExportsMaybeAssigned) {
   avf.Internalize(isolate);
 
   i::Scope* script_scope =
-      new (&zone) i::Scope(NULL, i::SCRIPT_SCOPE, &avf, &zone);
+      new (&zone) i::Scope(isolate, &zone, NULL, i::SCRIPT_SCOPE, &avf);
   script_scope->Initialize();
-  i::Scope* s = i::Scope::DeserializeScopeChain(context, script_scope, &zone);
+  i::Scope* s =
+      i::Scope::DeserializeScopeChain(isolate, &zone, context, script_scope);
   DCHECK(s != script_scope);
   const i::AstRawString* name_x = avf.GetOneByteString("x");
   const i::AstRawString* name_f = avf.GetOneByteString("f");
index 8afde463598787103b0abd3917938b9494e5a7f2..8aa9ffb015909ee2e283e85c8938241e72c453a8 100644 (file)
@@ -91,21 +91,21 @@ using namespace v8::internal;
 
 static bool CheckParse(const char* input) {
   v8::HandleScope scope(CcTest::isolate());
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
   RegExpCompileData result;
-  return v8::internal::RegExpParser::ParseRegExp(&reader, false, false, &result,
-                                                 &zone);
+  return v8::internal::RegExpParser::ParseRegExp(
+      CcTest::i_isolate(), &zone, &reader, false, false, &result);
 }
 
 
 static void CheckParseEq(const char* input, const char* expected) {
   v8::HandleScope scope(CcTest::isolate());
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
   RegExpCompileData result;
-  CHECK(v8::internal::RegExpParser::ParseRegExp(&reader, false, false, &result,
-                                                &zone));
+  CHECK(v8::internal::RegExpParser::ParseRegExp(
+      CcTest::i_isolate(), &zone, &reader, false, false, &result));
   CHECK(result.tree != NULL);
   CHECK(result.error.is_null());
   std::ostringstream os;
@@ -116,11 +116,11 @@ static void CheckParseEq(const char* input, const char* expected) {
 
 static bool CheckSimple(const char* input) {
   v8::HandleScope scope(CcTest::isolate());
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
   RegExpCompileData result;
-  CHECK(v8::internal::RegExpParser::ParseRegExp(&reader, false, false, &result,
-                                                &zone));
+  CHECK(v8::internal::RegExpParser::ParseRegExp(
+      CcTest::i_isolate(), &zone, &reader, false, false, &result));
   CHECK(result.tree != NULL);
   CHECK(result.error.is_null());
   return result.simple;
@@ -134,11 +134,11 @@ struct MinMaxPair {
 
 static MinMaxPair CheckMinMaxMatch(const char* input) {
   v8::HandleScope scope(CcTest::isolate());
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
   RegExpCompileData result;
-  CHECK(v8::internal::RegExpParser::ParseRegExp(&reader, false, false, &result,
-                                                &zone));
+  CHECK(v8::internal::RegExpParser::ParseRegExp(
+      CcTest::i_isolate(), &zone, &reader, false, false, &result));
   CHECK(result.tree != NULL);
   CHECK(result.error.is_null());
   int min_match = result.tree->min_match();
@@ -407,11 +407,11 @@ TEST(ParserRegression) {
 static void ExpectError(const char* input,
                         const char* expected) {
   v8::HandleScope scope(CcTest::isolate());
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
   RegExpCompileData result;
-  CHECK(!v8::internal::RegExpParser::ParseRegExp(&reader, false, false, &result,
-                                                 &zone));
+  CHECK(!v8::internal::RegExpParser::ParseRegExp(
+            CcTest::i_isolate(), &zone, &reader, false, false, &result));
   CHECK(result.tree == NULL);
   CHECK(!result.error.is_null());
   SmartArrayPointer<char> str = result.error->ToCString(ALLOW_NULLS);
@@ -476,7 +476,7 @@ static bool NotWord(uc16 c) {
 
 
 static void TestCharacterClassEscapes(uc16 c, bool (pred)(uc16 c)) {
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   ZoneList<CharacterRange>* ranges =
       new(&zone) ZoneList<CharacterRange>(2, &zone);
   CharacterRange::AddClassEscape(c, ranges, &zone);
@@ -507,16 +507,17 @@ static RegExpNode* Compile(const char* input, bool multiline, bool unicode,
   Isolate* isolate = CcTest::i_isolate();
   FlatStringReader reader(isolate, CStrVector(input));
   RegExpCompileData compile_data;
-  if (!v8::internal::RegExpParser::ParseRegExp(&reader, multiline, unicode,
-                                               &compile_data, zone))
+  if (!v8::internal::RegExpParser::ParseRegExp(CcTest::i_isolate(), zone,
+                                               &reader, multiline, unicode,
+                                               &compile_data))
     return NULL;
   Handle<String> pattern = isolate->factory()
                                ->NewStringFromUtf8(CStrVector(input))
                                .ToHandleChecked();
   Handle<String> sample_subject =
       isolate->factory()->NewStringFromUtf8(CStrVector("")).ToHandleChecked();
-  RegExpEngine::Compile(&compile_data, false, false, multiline, false, pattern,
-                        sample_subject, is_one_byte, zone);
+  RegExpEngine::Compile(isolate, zone, &compile_data, false, false, multiline,
+                        false, pattern, sample_subject, is_one_byte);
   return compile_data.node;
 }
 
@@ -524,7 +525,7 @@ static RegExpNode* Compile(const char* input, bool multiline, bool unicode,
 static void Execute(const char* input, bool multiline, bool unicode,
                     bool is_one_byte, bool dot_output = false) {
   v8::HandleScope scope(CcTest::isolate());
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   RegExpNode* node = Compile(input, multiline, unicode, is_one_byte, &zone);
   USE(node);
 #ifdef DEBUG
@@ -562,7 +563,7 @@ static unsigned PseudoRandom(int i, int j) {
 
 TEST(SplayTreeSimple) {
   static const unsigned kLimit = 1000;
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   ZoneSplayTree<TestConfig> tree(&zone);
   bool seen[kLimit];
   for (unsigned i = 0; i < kLimit; i++) seen[i] = false;
@@ -629,7 +630,7 @@ TEST(DispatchTableConstruction) {
     }
   }
   // Enter test data into dispatch table.
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   DispatchTable table(&zone);
   for (int i = 0; i < kRangeCount; i++) {
     uc16* range = ranges[i];
@@ -741,9 +742,10 @@ TEST(MacroAssemblerNativeSuccess) {
   ContextInitializer initializer;
   Isolate* isolate = CcTest::i_isolate();
   Factory* factory = isolate->factory();
-  Zone zone(isolate);
+  Zone zone;
 
-  ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::LATIN1, 4, &zone);
+  ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
+                             4);
 
   m.Succeed();
 
@@ -778,9 +780,10 @@ TEST(MacroAssemblerNativeSimple) {
   ContextInitializer initializer;
   Isolate* isolate = CcTest::i_isolate();
   Factory* factory = isolate->factory();
-  Zone zone(isolate);
+  Zone zone;
 
-  ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::LATIN1, 4, &zone);
+  ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
+                             4);
 
   Label fail, backtrack;
   m.PushBacktrack(&fail);
@@ -844,9 +847,10 @@ TEST(MacroAssemblerNativeSimpleUC16) {
   ContextInitializer initializer;
   Isolate* isolate = CcTest::i_isolate();
   Factory* factory = isolate->factory();
-  Zone zone(isolate);
+  Zone zone;
 
-  ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::UC16, 4, &zone);
+  ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::UC16,
+                             4);
 
   Label fail, backtrack;
   m.PushBacktrack(&fail);
@@ -916,9 +920,10 @@ TEST(MacroAssemblerNativeBacktrack) {
   ContextInitializer initializer;
   Isolate* isolate = CcTest::i_isolate();
   Factory* factory = isolate->factory();
-  Zone zone(isolate);
+  Zone zone;
 
-  ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::LATIN1, 0, &zone);
+  ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
+                             0);
 
   Label fail;
   Label backtrack;
@@ -956,9 +961,10 @@ TEST(MacroAssemblerNativeBackReferenceLATIN1) {
   ContextInitializer initializer;
   Isolate* isolate = CcTest::i_isolate();
   Factory* factory = isolate->factory();
-  Zone zone(isolate);
+  Zone zone;
 
-  ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::LATIN1, 4, &zone);
+  ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
+                             4);
 
   m.WriteCurrentPositionToRegister(0, 0);
   m.AdvanceCurrentPosition(2);
@@ -1005,9 +1011,10 @@ TEST(MacroAssemblerNativeBackReferenceUC16) {
   ContextInitializer initializer;
   Isolate* isolate = CcTest::i_isolate();
   Factory* factory = isolate->factory();
-  Zone zone(isolate);
+  Zone zone;
 
-  ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::UC16, 4, &zone);
+  ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::UC16,
+                             4);
 
   m.WriteCurrentPositionToRegister(0, 0);
   m.AdvanceCurrentPosition(2);
@@ -1057,9 +1064,10 @@ TEST(MacroAssemblernativeAtStart) {
   ContextInitializer initializer;
   Isolate* isolate = CcTest::i_isolate();
   Factory* factory = isolate->factory();
-  Zone zone(isolate);
+  Zone zone;
 
-  ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::LATIN1, 0, &zone);
+  ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
+                             0);
 
   Label not_at_start, newline, fail;
   m.CheckNotAtStart(&not_at_start);
@@ -1116,9 +1124,10 @@ TEST(MacroAssemblerNativeBackRefNoCase) {
   ContextInitializer initializer;
   Isolate* isolate = CcTest::i_isolate();
   Factory* factory = isolate->factory();
-  Zone zone(isolate);
+  Zone zone;
 
-  ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::LATIN1, 4, &zone);
+  ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
+                             4);
 
   Label fail, succ;
 
@@ -1174,9 +1183,10 @@ TEST(MacroAssemblerNativeRegisters) {
   ContextInitializer initializer;
   Isolate* isolate = CcTest::i_isolate();
   Factory* factory = isolate->factory();
-  Zone zone(isolate);
+  Zone zone;
 
-  ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::LATIN1, 6, &zone);
+  ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
+                             6);
 
   uc16 foo_chars[3] = {'f', 'o', 'o'};
   Vector<const uc16> foo(foo_chars, 3);
@@ -1275,9 +1285,10 @@ TEST(MacroAssemblerStackOverflow) {
   ContextInitializer initializer;
   Isolate* isolate = CcTest::i_isolate();
   Factory* factory = isolate->factory();
-  Zone zone(isolate);
+  Zone zone;
 
-  ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::LATIN1, 0, &zone);
+  ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
+                             0);
 
   Label loop;
   m.Bind(&loop);
@@ -1313,9 +1324,10 @@ TEST(MacroAssemblerNativeLotsOfRegisters) {
   ContextInitializer initializer;
   Isolate* isolate = CcTest::i_isolate();
   Factory* factory = isolate->factory();
-  Zone zone(isolate);
+  Zone zone;
 
-  ArchRegExpMacroAssembler m(NativeRegExpMacroAssembler::LATIN1, 2, &zone);
+  ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
+                             2);
 
   // At least 2048, to ensure the allocated space for registers
   // span one full page.
@@ -1427,7 +1439,7 @@ TEST(AddInverseToTable) {
   static const int kLimit = 1000;
   static const int kRangeCount = 16;
   for (int t = 0; t < 10; t++) {
-    Zone zone(CcTest::i_isolate());
+    Zone zone;
     ZoneList<CharacterRange>* ranges =
         new(&zone) ZoneList<CharacterRange>(kRangeCount, &zone);
     for (int i = 0; i < kRangeCount; i++) {
@@ -1448,7 +1460,7 @@ TEST(AddInverseToTable) {
       CHECK_EQ(is_on, set->Get(0) == false);
     }
   }
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   ZoneList<CharacterRange>* ranges =
       new(&zone) ZoneList<CharacterRange>(1, &zone);
   ranges->Add(CharacterRange(0xFFF0, 0xFFFE), &zone);
@@ -1559,13 +1571,13 @@ TEST(UncanonicalizeEquivalence) {
 }
 
 
-static void TestRangeCaseIndependence(CharacterRange input,
+static void TestRangeCaseIndependence(Isolate* isolate, CharacterRange input,
                                       Vector<CharacterRange> expected) {
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   int count = expected.length();
   ZoneList<CharacterRange>* list =
       new(&zone) ZoneList<CharacterRange>(count, &zone);
-  input.AddCaseEquivalents(list, false, &zone);
+  input.AddCaseEquivalents(isolate, &zone, list, false);
   CHECK_EQ(count, list->length());
   for (int i = 0; i < list->length(); i++) {
     CHECK_EQ(expected[i].from(), list->at(i).from());
@@ -1574,39 +1586,41 @@ static void TestRangeCaseIndependence(CharacterRange input,
 }
 
 
-static void TestSimpleRangeCaseIndependence(CharacterRange input,
+static void TestSimpleRangeCaseIndependence(Isolate* isolate,
+                                            CharacterRange input,
                                             CharacterRange expected) {
   EmbeddedVector<CharacterRange, 1> vector;
   vector[0] = expected;
-  TestRangeCaseIndependence(input, vector);
+  TestRangeCaseIndependence(isolate, input, vector);
 }
 
 
 TEST(CharacterRangeCaseIndependence) {
-  TestSimpleRangeCaseIndependence(CharacterRange::Singleton('a'),
+  Isolate* isolate = CcTest::i_isolate();
+  TestSimpleRangeCaseIndependence(isolate, CharacterRange::Singleton('a'),
                                   CharacterRange::Singleton('A'));
-  TestSimpleRangeCaseIndependence(CharacterRange::Singleton('z'),
+  TestSimpleRangeCaseIndependence(isolate, CharacterRange::Singleton('z'),
                                   CharacterRange::Singleton('Z'));
-  TestSimpleRangeCaseIndependence(CharacterRange('a', 'z'),
+  TestSimpleRangeCaseIndependence(isolate, CharacterRange('a', 'z'),
                                   CharacterRange('A', 'Z'));
-  TestSimpleRangeCaseIndependence(CharacterRange('c', 'f'),
+  TestSimpleRangeCaseIndependence(isolate, CharacterRange('c', 'f'),
                                   CharacterRange('C', 'F'));
-  TestSimpleRangeCaseIndependence(CharacterRange('a', 'b'),
+  TestSimpleRangeCaseIndependence(isolate, CharacterRange('a', 'b'),
                                   CharacterRange('A', 'B'));
-  TestSimpleRangeCaseIndependence(CharacterRange('y', 'z'),
+  TestSimpleRangeCaseIndependence(isolate, CharacterRange('y', 'z'),
                                   CharacterRange('Y', 'Z'));
-  TestSimpleRangeCaseIndependence(CharacterRange('a' - 1, 'z' + 1),
+  TestSimpleRangeCaseIndependence(isolate, CharacterRange('a' - 1, 'z' + 1),
                                   CharacterRange('A', 'Z'));
-  TestSimpleRangeCaseIndependence(CharacterRange('A', 'Z'),
+  TestSimpleRangeCaseIndependence(isolate, CharacterRange('A', 'Z'),
                                   CharacterRange('a', 'z'));
-  TestSimpleRangeCaseIndependence(CharacterRange('C', 'F'),
+  TestSimpleRangeCaseIndependence(isolate, CharacterRange('C', 'F'),
                                   CharacterRange('c', 'f'));
-  TestSimpleRangeCaseIndependence(CharacterRange('A' - 1, 'Z' + 1),
+  TestSimpleRangeCaseIndependence(isolate, CharacterRange('A' - 1, 'Z' + 1),
                                   CharacterRange('a', 'z'));
   // Here we need to add [l-z] to complete the case independence of
   // [A-Za-z] but we expect [a-z] to be added since we always add a
   // whole block at a time.
-  TestSimpleRangeCaseIndependence(CharacterRange('A', 'k'),
+  TestSimpleRangeCaseIndependence(isolate, CharacterRange('A', 'k'),
                                   CharacterRange('a', 'z'));
 }
 
@@ -1624,7 +1638,7 @@ static bool InClass(uc16 c, ZoneList<CharacterRange>* ranges) {
 
 
 TEST(CharClassDifference) {
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   ZoneList<CharacterRange>* base =
       new(&zone) ZoneList<CharacterRange>(1, &zone);
   base->Add(CharacterRange::Everything(), &zone);
@@ -1651,7 +1665,7 @@ TEST(CharClassDifference) {
 
 
 TEST(CanonicalizeCharacterSets) {
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   ZoneList<CharacterRange>* list =
       new(&zone) ZoneList<CharacterRange>(4, &zone);
   CharacterSet set(list);
@@ -1712,7 +1726,7 @@ TEST(CanonicalizeCharacterSets) {
 
 
 TEST(CharacterRangeMerge) {
-  Zone zone(CcTest::i_isolate());
+  Zone zone;
   ZoneList<CharacterRange> l1(4, &zone);
   ZoneList<CharacterRange> l2(4, &zone);
   // Create all combinations of intersections of ranges, both singletons and
index b84520121991017b0d672106d663a8cda75e9ed8..95ef9eb4822e5cb2f11ce5353c828e3820c885c2 100644 (file)
@@ -103,12 +103,11 @@ struct Tests : Rep {
   Zone zone;
   TypesInstance T;
 
-  Tests() :
-      isolate(CcTest::i_isolate()),
-      scope(isolate),
-      zone(isolate),
-      T(Rep::ToRegion(&zone, isolate), isolate) {
-  }
+  Tests()
+      : isolate(CcTest::i_isolate()),
+        scope(isolate),
+        zone(),
+        T(Rep::ToRegion(&zone, isolate), isolate) {}
 
   bool Equal(TypeHandle type1, TypeHandle type2) {
     return
index 302539a96d02d8c85d4275ea5af335acffd45e95..15b800dc052d316c4376517927d04c3063450056 100644 (file)
@@ -143,7 +143,7 @@ TEST(UniqueSet_Add) {
   MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
   MAKE_UNIQUES_A_B_C;
 
-  Zone zone(isolate);
+  Zone zone;
 
   UniqueSet<String>* set = new(&zone) UniqueSet<String>();
 
@@ -170,7 +170,7 @@ TEST(UniqueSet_Remove) {
   MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
   MAKE_UNIQUES_A_B_C;
 
-  Zone zone(isolate);
+  Zone zone;
 
   UniqueSet<String>* set = new(&zone) UniqueSet<String>();
 
@@ -210,7 +210,7 @@ TEST(UniqueSet_Contains) {
   MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
   MAKE_UNIQUES_A_B_C;
 
-  Zone zone(isolate);
+  Zone zone;
 
   UniqueSet<String>* set = new(&zone) UniqueSet<String>();
 
@@ -241,7 +241,7 @@ TEST(UniqueSet_At) {
   MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
   MAKE_UNIQUES_A_B_C;
 
-  Zone zone(isolate);
+  Zone zone;
 
   UniqueSet<String>* set = new(&zone) UniqueSet<String>();
 
@@ -278,7 +278,7 @@ TEST(UniqueSet_Equals) {
   MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
   MAKE_UNIQUES_A_B_C;
 
-  Zone zone(isolate);
+  Zone zone;
 
   UniqueSet<String>* set1 = new(&zone) UniqueSet<String>();
   UniqueSet<String>* set2 = new(&zone) UniqueSet<String>();
@@ -316,7 +316,7 @@ TEST(UniqueSet_IsSubset1) {
   MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
   MAKE_UNIQUES_A_B_C;
 
-  Zone zone(isolate);
+  Zone zone;
 
   UniqueSet<String>* set1 = new(&zone) UniqueSet<String>();
   UniqueSet<String>* set2 = new(&zone) UniqueSet<String>();
@@ -351,7 +351,7 @@ TEST(UniqueSet_IsSubset2) {
   MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
   MAKE_UNIQUES_A_B_C_D_E_F_G;
 
-  Zone zone(isolate);
+  Zone zone;
 
   UniqueSet<String>* set1 = new(&zone) UniqueSet<String>();
   UniqueSet<String>* set2 = new(&zone) UniqueSet<String>();
@@ -394,7 +394,7 @@ TEST(UniqueSet_IsSubsetExhaustive) {
   MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
   MAKE_UNIQUES_A_B_C_D_E_F_G;
 
-  Zone zone(isolate);
+  Zone zone;
 
   Unique<String> elements[] = {
     A, B, C, D, E, F, G
@@ -417,7 +417,7 @@ TEST(UniqueSet_Intersect1) {
   MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
   MAKE_UNIQUES_A_B_C;
 
-  Zone zone(isolate);
+  Zone zone;
 
   UniqueSet<String>* set1 = new(&zone) UniqueSet<String>();
   UniqueSet<String>* set2 = new(&zone) UniqueSet<String>();
@@ -458,7 +458,7 @@ TEST(UniqueSet_IntersectExhaustive) {
   MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
   MAKE_UNIQUES_A_B_C_D_E_F_G;
 
-  Zone zone(isolate);
+  Zone zone;
 
   Unique<String> elements[] = {
     A, B, C, D, E, F, G
@@ -485,7 +485,7 @@ TEST(UniqueSet_Union1) {
   MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
   MAKE_UNIQUES_A_B_C;
 
-  Zone zone(isolate);
+  Zone zone;
 
   UniqueSet<String>* set1 = new(&zone) UniqueSet<String>();
   UniqueSet<String>* set2 = new(&zone) UniqueSet<String>();
@@ -526,7 +526,7 @@ TEST(UniqueSet_UnionExhaustive) {
   MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
   MAKE_UNIQUES_A_B_C_D_E_F_G;
 
-  Zone zone(isolate);
+  Zone zone;
 
   Unique<String> elements[] = {
     A, B, C, D, E, F, G
index 060b1c1842fb663a1a598923297cc5c962e29599..f752884573061b6a787a66ddef8aee5198f256dd 100644 (file)
@@ -66,7 +66,7 @@ class ChangeLoweringTest : public GraphTest {
   Reduction Reduce(Node* node) {
     MachineOperatorBuilder machine(zone(), WordRepresentation());
     JSOperatorBuilder javascript(zone());
-    JSGraph jsgraph(graph(), common(), &javascript, &machine);
+    JSGraph jsgraph(isolate(), graph(), common(), &javascript, &machine);
     CompilationInfo info(isolate(), zone());
     Linkage linkage(zone(), &info);
     ChangeLowering reducer(&jsgraph, &linkage);
index 960ff92293946a71100908a37faebab7e47fc08c..8c77ef14d14c4da32308e0d96c4ed130929227b6 100644 (file)
@@ -93,7 +93,8 @@ Matcher<Node*> GraphTest::IsTrueConstant() {
 
 
 TypedGraphTest::TypedGraphTest(int num_parameters)
-    : GraphTest(num_parameters), typer_(graph(), MaybeHandle<Context>()) {}
+    : GraphTest(num_parameters),
+      typer_(isolate(), graph(), MaybeHandle<Context>()) {}
 
 
 TypedGraphTest::~TypedGraphTest() {}
index b1c9073164d8c18e6061b493bfe08ce71cb1e12d..c9ade528b790e37ac037ae32d2d4db9c792bc624 100644 (file)
@@ -36,10 +36,11 @@ InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build(
   }
   size_t const node_count = graph()->NodeCount();
   EXPECT_NE(0u, node_count);
-  Linkage linkage(test_->zone(), call_descriptor());
+  Linkage linkage(test_->isolate(), test_->zone(), call_descriptor());
   InstructionBlocks* instruction_blocks =
       InstructionSequence::InstructionBlocksFor(test_->zone(), schedule);
-  InstructionSequence sequence(test_->zone(), instruction_blocks);
+  InstructionSequence sequence(test_->isolate(), test_->zone(),
+                               instruction_blocks);
   SourcePositionTable source_position_table(graph());
   InstructionSelector selector(test_->zone(), node_count, &linkage, &sequence,
                                schedule, &source_position_table, features);
index e65d68bcca885b2a8fc0145f2c07897d189ffa34..408f32611aae59d68b3655050a946bdf36adbd99 100644 (file)
@@ -36,19 +36,20 @@ class InstructionSelectorTest : public TestWithContext, public TestWithZone {
   class StreamBuilder FINAL : public RawMachineAssembler {
    public:
     StreamBuilder(InstructionSelectorTest* test, MachineType return_type)
-        : RawMachineAssembler(new (test->zone()) Graph(test->zone()),
+        : RawMachineAssembler(test->isolate(),
+                              new (test->zone()) Graph(test->zone()),
                               MakeMachineSignature(test->zone(), return_type)),
           test_(test) {}
     StreamBuilder(InstructionSelectorTest* test, MachineType return_type,
                   MachineType parameter0_type)
         : RawMachineAssembler(
-              new (test->zone()) Graph(test->zone()),
+              test->isolate(), new (test->zone()) Graph(test->zone()),
               MakeMachineSignature(test->zone(), return_type, parameter0_type)),
           test_(test) {}
     StreamBuilder(InstructionSelectorTest* test, MachineType return_type,
                   MachineType parameter0_type, MachineType parameter1_type)
         : RawMachineAssembler(
-              new (test->zone()) Graph(test->zone()),
+              test->isolate(), new (test->zone()) Graph(test->zone()),
               MakeMachineSignature(test->zone(), return_type, parameter0_type,
                                    parameter1_type)),
           test_(test) {}
@@ -56,7 +57,7 @@ class InstructionSelectorTest : public TestWithContext, public TestWithZone {
                   MachineType parameter0_type, MachineType parameter1_type,
                   MachineType parameter2_type)
         : RawMachineAssembler(
-              new (test->zone()) Graph(test->zone()),
+              test->isolate(), new (test->zone()) Graph(test->zone()),
               MakeMachineSignature(test->zone(), return_type, parameter0_type,
                                    parameter1_type, parameter2_type)),
           test_(test) {}
index 9546376ee8ad250dd31a73e1bf21866818584461..91ab5ee0041af768591bbdc9736af1efb289e047 100644 (file)
@@ -69,7 +69,8 @@ RegisterConfiguration* InstructionSequenceTest::config() {
 
 InstructionSequence* InstructionSequenceTest::sequence() {
   if (sequence_ == nullptr) {
-    sequence_ = new (zone()) InstructionSequence(zone(), &instruction_blocks_);
+    sequence_ = new (zone())
+        InstructionSequence(isolate(), zone(), &instruction_blocks_);
   }
   return sequence_;
 }
index 9c572820e7131e475370c3e31110aa28ad502938..6123238c39420e1a9cb58fac8a16ea00354872fb 100644 (file)
@@ -25,7 +25,7 @@ class JSBuiltinReducerTest : public TypedGraphTest {
   Reduction Reduce(Node* node, MachineOperatorBuilder::Flags flags =
                                    MachineOperatorBuilder::Flag::kNoFlags) {
     MachineOperatorBuilder machine(zone(), kMachPtr, flags);
-    JSGraph jsgraph(graph(), common(), javascript(), &machine);
+    JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine);
     JSBuiltinReducer reducer(&jsgraph);
     return reducer.Reduce(node);
   }
index 9886c267b82fc387eba046f122395f83255acfb7..57ed6fd80ff27ae6e14a39479e8c749f6c5941d0 100644 (file)
@@ -75,14 +75,14 @@ class JSTypedLoweringTest : public TypedGraphTest {
  protected:
   Reduction Reduce(Node* node) {
     MachineOperatorBuilder machine(zone());
-    JSGraph jsgraph(graph(), common(), javascript(), &machine);
+    JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine);
     JSTypedLowering reducer(&jsgraph, zone());
     return reducer.Reduce(node);
   }
 
   Node* EmptyFrameState() {
     MachineOperatorBuilder machine(zone());
-    JSGraph jsgraph(graph(), common(), javascript(), &machine);
+    JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine);
     return jsgraph.EmptyFrameState();
   }
 
index 5a0d0c552a8806b04656efaa6d623f549c4eb807..3799bc26230ae1bccf3a17d9352e66aa145ee403 100644 (file)
@@ -64,7 +64,7 @@ class LoopPeelingTest : public GraphTest {
       OFStream os(stdout);
       os << AsRPO(*graph());
     }
-    Zone zone(isolate());
+    Zone zone;
     return LoopFinder::BuildLoopTree(graph(), &zone);
   }
 
index 3037ff7307871341a73c60d43c1223ca374d1a39..f63e70da5a0e75ed8d106176f20d019f70c5e6b7 100644 (file)
@@ -28,7 +28,7 @@ class MachineOperatorReducerTest : public TypedGraphTest {
  protected:
   Reduction Reduce(Node* node) {
     JSOperatorBuilder javascript(zone());
-    JSGraph jsgraph(graph(), common(), &javascript, &machine_);
+    JSGraph jsgraph(isolate(), graph(), common(), &javascript, &machine_);
     MachineOperatorReducer reducer(&jsgraph);
     return reducer.Reduce(node);
   }
index fad9df0ed514d5d6d272d1f679ae0e48c24527cd..8b8a24a4e59147d27ba7a45a8ad3909260af4b07 100644 (file)
@@ -30,7 +30,7 @@ class SimplifiedOperatorReducerTest : public TypedGraphTest {
   Reduction Reduce(Node* node) {
     MachineOperatorBuilder machine(zone());
     JSOperatorBuilder javascript(zone());
-    JSGraph jsgraph(graph(), common(), &javascript, &machine);
+    JSGraph jsgraph(isolate(), graph(), common(), &javascript, &machine);
     SimplifiedOperatorReducer reducer(&jsgraph);
     return reducer.Reduce(node);
   }
index e23557adc4efa8faba12beb4d00502c8122d91ae..b005d2cbaf1bb19c7adf5ebf222d5ffc261c1c31 100644 (file)
@@ -12,7 +12,7 @@ namespace compiler {
 
 class ZonePoolTest : public TestWithIsolate {
  public:
-  ZonePoolTest() : zone_pool_(isolate()) {}
+  ZonePoolTest() {}
 
  protected:
   ZonePool* zone_pool() { return &zone_pool_; }
index 511e3574c869ba064c207476ac5e3b679f16a4a4..718fd5ac5977e8e6cc999418264af31de1cfb9e3 100644 (file)
@@ -92,7 +92,7 @@ class TestWithIsolate : public virtual ::v8::TestWithIsolate {
 
 class TestWithZone : public TestWithIsolate {
  public:
-  TestWithZone() : zone_(isolate()) {}
+  TestWithZone() {}
   virtual ~TestWithZone();
 
   Zone* zone() { return &zone_; }