#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),
#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);
#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),
#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);
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);
}
-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);
}
}
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
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);
}
class AstThisAccessVisitor : public AstVisitor {
public:
- explicit AstThisAccessVisitor(Zone* zone);
+ AstThisAccessVisitor(Isolate* isolate, Zone* zone);
bool UsesThis() { return uses_this_; }
\
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_
#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
}
// 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.
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());
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;
// 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);
}
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());
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());
// 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();
}
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();
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
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);
}
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);
}
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);
}
ALAA::AstLoopAssignmentAnalyzer(Zone* zone, CompilationInfo* info)
: info_(info), loop_stack_(zone) {
- InitializeAstVisitor(zone);
+ InitializeAstVisitor(info->isolate(), zone);
}
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()),
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()]; }
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);
}
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);
}
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);
}
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),
// 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) {
return MakeNode(op, value_input_count, value_inputs, incomplete);
}
+ Isolate* isolate() const { return isolate_; }
Graph* graph() const { return graph_; }
protected:
Node** value_inputs, bool incomplete) = 0;
private:
+ Isolate* isolate_;
Graph* graph_;
};
// StubGraphBuilder).
class StructuredGraphBuilder : public GraphBuilder {
public:
- StructuredGraphBuilder(Zone* zone, Graph* graph,
+ StructuredGraphBuilder(Isolate* isolate, Zone* zone, Graph* graph,
CommonOperatorBuilder* common);
~StructuredGraphBuilder() OVERRIDE {}
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>.
template <class Visitor>
void Graph::VisitNodeInputsFromEnd(Visitor* visitor) {
- Zone tmp_zone(zone()->isolate());
+ Zone tmp_zone;
GenericGraphVisit::Visit<Visitor>(this, &tmp_zone, end(), visitor);
}
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\":[";
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;
}
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;
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;
}
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);
// 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;
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);
}
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:
}
-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(),
// 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_; }
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_; }
typedef std::set<int, std::less<int>, ZoneIntAllocator> VirtualRegisterSet;
+ Isolate* isolate_;
Zone* const zone_;
InstructionBlocks* const instruction_blocks_;
IntVector block_starts_;
}
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;
}
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_; }
// 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),
// 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_;
}
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();
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.
// 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 =
properties, // properties
kNoCalleeSaved, // callee-saved registers
flags, // flags
- descriptor.DebugName(zone->isolate()));
+ descriptor.DebugName(isolate));
}
static CallDescriptor* GetSimplifiedCDescriptor(Zone* zone,
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): ?
}
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);
}
// 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;
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);
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
LinkageLocation GetOsrValueLocation(int index) const;
private:
+ Isolate* isolate_;
Zone* const zone_;
CallDescriptor* const incoming_;
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);
}
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()),
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),
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();
}
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,
return Handle<Code>::null();
}
- ZonePool zone_pool(isolate());
+ ZonePool zone_pool;
SmartPointer<PipelineStatistics> pipeline_statistics;
if (FLAG_turbo_stats) {
}
-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);
}
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;
TraceSchedule(schedule);
}
- Linkage linkage(info->zone(), call_descriptor);
+ Linkage linkage(info->isolate(), info->zone(), call_descriptor);
pipeline.GenerateCode(&linkage);
Handle<Code> code = data.code();
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);
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());
}
// 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);
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()),
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);
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);
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(
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_; }
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);
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);
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()));
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()));
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);
}
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()));
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),
// 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_));
}
}
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_;
};
};
-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);
class Typer {
public:
- explicit Typer(Graph* graph, MaybeHandle<Context> context);
+ Typer(Isolate* isolate, Graph* graph, MaybeHandle<Context> context);
~Typer();
void Run();
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_;
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();
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);
}
}
-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() {
zone = unused_.back();
unused_.pop_back();
} else {
- zone = new Zone(isolate_);
+ zone = new Zone();
}
used_.push_back(zone);
DCHECK_EQ(0, zone->allocation_size());
DISALLOW_COPY_AND_ASSIGN(StatsScope);
};
- explicit ZonePool(Isolate* isolate);
+ ZonePool();
~ZonePool();
size_t GetMaxAllocatedBytes();
typedef std::vector<Zone*> Used;
typedef std::vector<StatsScope*> Stats;
- Isolate* const isolate_;
Unused unused_;
Used used_;
Stats stats_;
// 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.
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
} 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
} 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
// 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);
static JITCodeEntry* CreateELFObject(CodeDescription* desc, Isolate* isolate) {
#ifdef __MACH_O
- Zone zone(isolate);
+ Zone zone;
MachO mach_o(&zone);
Writer w(&mach_o);
mach_o.Write(&w, desc->CodeStart(), desc->CodeSize());
#else
- Zone zone(isolate);
+ Zone zone;
ELF elf(&zone);
Writer w(&elf);
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)) {
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;
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;
// 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();
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;
}
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;
}
}
-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);
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);
}
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;
}
-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);
}
return Prepend(HMathFloorOfDiv::New(
- block()->zone(), context(), left, right));
+ block()->graph()->isolate(), block()->zone(), context(), left, right));
}
return this;
}
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 {
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());
}
-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);
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(
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.
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());
// 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) {
// 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;
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);
}
}
-#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, +)
#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) {
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());
}
}
}
}
-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;
}
-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);
}
-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);
}
-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);
}
-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);
}
-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);
}
-#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,
#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);
}
-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);
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()) {
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); \
}
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);
}
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); }
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,
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);
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); }
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) {
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) {
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); }
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);
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
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);
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);
}
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 {
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,
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_);
}
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); }
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).
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;
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.
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;
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;
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);
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_; }
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;
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()) {
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()) {
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);
}
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);
}
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);
}
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);
}
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,
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_; }
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 {
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 {
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;
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_;
}
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_);
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_);
: 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);
// 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());
}
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);
}
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;
}
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;
}
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);
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>());}
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) {
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>
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>
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>
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>
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>
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,
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,
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_; }
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(); }
#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),
#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);
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),
source_length_(source->length()),
isolate_(source->map()->GetHeap()->isolate()),
factory_(isolate_->factory()),
- zone_(isolate_),
object_constructor_(isolate_->native_context()->object_function(),
isolate_),
position_(-1) {
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);
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,
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.
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,
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(
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) {
current_expansion_factor_ = value;
}
+ Isolate* isolate() const { return isolate_; }
Zone* zone() const { return zone_; }
static const int kNoRegister = -1;
bool optimize_;
int current_expansion_factor_;
FrequencyCollator frequency_collator_;
+ Isolate* isolate_;
Zone* zone_;
};
// 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),
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);
#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;
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());
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++) {
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;
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();
}
-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);
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);
}
}
}
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);
}
-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)) {
void Analysis::EnsureAnalyzed(RegExpNode* that) {
- StackLimitCheck check(that->zone()->isolate());
+ StackLimitCheck check(isolate());
if (check.HasOverflowed()) {
fail("Stack overflow");
return;
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()) {
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));
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.
: 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
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,
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);
// +-------+ +------------+
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);
error_message_ = error_message;
}
+ Isolate* isolate() const { return isolate_; }
+
private:
+ Isolate* isolate_;
bool ignore_case_;
bool is_one_byte_;
const char* error_message_;
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);
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),
// 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);
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.
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;
}
#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),
#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);
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);
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;
}
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),
*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
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());
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());
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),
// ----------------------------------------------------------------------------
// 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);
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();
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),
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),
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.
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; }
uintptr_t stack_limit_;
private:
+ Isolate* isolate_;
+ typename Traits::Type::Zone* zone_; // Only used by Parser.
+
Scanner* scanner_;
bool stack_overflow_;
bool allow_harmony_object_literals_;
bool allow_harmony_sloppy_;
bool allow_harmony_computed_property_names_;
-
- typename Traits::Type::Zone* zone_; // Only used by Parser.
};
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
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;
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);
}
#ifdef DEBUG
-PrettyPrinter::PrettyPrinter(Zone* zone) {
+PrettyPrinter::PrettyPrinter(Isolate* isolate, Zone* zone) {
output_ = NULL;
size_ = 0;
pos_ = 0;
- InitializeAstVisitor(zone);
+ InitializeAstVisitor(isolate, zone);
}
}
-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));
}
//-----------------------------------------------------------------------------
-AstPrinter::AstPrinter(Zone* zone) : PrettyPrinter(zone), indent_(0) {
-}
+AstPrinter::AstPrinter(Isolate* isolate, Zone* zone)
+ : PrettyPrinter(isolate, zone), indent_(0) {}
AstPrinter::~AstPrinter() {
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
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.
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;
// 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);
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",
// 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(); }
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() {
#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() {
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)
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_;
};
// 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();
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() { }
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;
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);
}
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);
+ 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.
// ----------------------------------------------------------------------------
// 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),
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) {
}
-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),
}
-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),
}
-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;
}
} 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;
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_;
}
// ---------------------------------------------------------------------------
// 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) {
// tree and its children are reparented.
Scope* FinalizeBlockScope();
+ Isolate* isolate() const { return isolate_; }
Zone* zone() const { return zone_; }
// ---------------------------------------------------------------------------
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) {
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);
}
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);
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,
private:
Handle<Context> native_context_;
+ Isolate* isolate_;
Zone* zone_;
Handle<UnseededNumberDictionary> dictionary_;
Handle<TypeFeedbackVector> feedback_vector_;
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());
}
#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),
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);
};
-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() {
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().
inline unsigned allocation_size() const { return allocation_size_; }
- inline Isolate* isolate() const { return isolate_; }
-
private:
friend class Isolate;
Address limit_;
Segment* segment_head_;
- Isolate* isolate_;
};
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_; }
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) {}
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();
}
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) {}
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();
}
// 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:
class MachineCallHelper : public CallHelper {
public:
- MachineCallHelper(Zone* zone, MachineSignature* machine_sig);
+ MachineCallHelper(Isolate* isolate, MachineSignature* machine_sig);
Node* Parameter(size_t index);
private:
Node** parameters_;
// TODO(dcarney): shouldn't need graph stored.
+ Isolate* isolate_;
Graph* graph_;
MaybeHandle<Code> code_;
};
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_);
}
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),
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_; }
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;
// 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());
}
Zone* zone() { return scope_->main_zone(); }
+ Isolate* isolate() { return scope_->main_isolate(); }
HandleAndZoneScope* scope_;
Handle<JSFunction> function;
// }
CSignature1<Object*, Object*> sig;
- RawMachineAssembler m(graph, &sig);
+ RawMachineAssembler m(isolate(), graph, &sig);
Handle<JSFunction> deopt_function =
NewFunction("function deopt() { %DeoptimizeFunction(foo); }; deopt");
// }
CSignature1<Object*, Object*> sig;
- RawMachineAssembler m(graph, &sig);
+ RawMachineAssembler m(isolate(), graph, &sig);
Unique<HeapObject> this_fun_constant =
Unique<HeapObject>::CreateUninitialized(function);
: 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)),
}
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) {
TEST(InstructionOperands) {
- Zone zone(CcTest::InitIsolateOnce());
+ Zone zone;
{
TestInstr* i = TestInstr::New(&zone, 101);
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_;
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()));
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(); }
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()));
}
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();
TestCode()
: HandleAndZoneScope(),
blocks_(main_zone()),
- sequence_(main_zone(), &blocks_),
+ sequence_(main_isolate(), main_zone(), &blocks_),
rpo_number_(RpoNumber::FromInt(0)),
current_(NULL) {}
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_);
: 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)),
OFStream os(stdout);
os << AsRPO(graph);
}
- Zone zone(isolate);
+ Zone zone;
loop_tree = LoopFinder::BuildLoopTree(&graph, &zone);
}
return loop_tree;
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);
: 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)),
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);
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;
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);
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 =
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 =
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 =
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);
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);
using namespace v8::internal;
TEST(BitVector) {
- Zone zone(CcTest::i_isolate());
+ Zone zone;
{
BitVector v(15, &zone);
v.Add(1);
int expected_diff_parameter = -1) {
StringCompareInput input(s1, s2);
- Zone zone(CcTest::i_isolate());
+ Zone zone;
DiffChunkStruct* first_chunk;
ListDiffOutputWriter writer(&first_chunk, &zone);
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);
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.
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);
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);
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();
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();
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();
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());
{
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(
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);
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);
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);
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");
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);
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");
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;
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;
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();
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);
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);
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;
}
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
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;
}
}
// 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];
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();
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);
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);
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;
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);
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);
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(¬_at_start);
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;
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);
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);
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.
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++) {
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);
}
-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());
}
-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'));
}
TEST(CharClassDifference) {
- Zone zone(CcTest::i_isolate());
+ Zone zone;
ZoneList<CharacterRange>* base =
new(&zone) ZoneList<CharacterRange>(1, &zone);
base->Add(CharacterRange::Everything(), &zone);
TEST(CanonicalizeCharacterSets) {
- Zone zone(CcTest::i_isolate());
+ Zone zone;
ZoneList<CharacterRange>* list =
new(&zone) ZoneList<CharacterRange>(4, &zone);
CharacterSet set(list);
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
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
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
MAKE_UNIQUES_A_B_C;
- Zone zone(isolate);
+ Zone zone;
UniqueSet<String>* set = new(&zone) UniqueSet<String>();
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
MAKE_UNIQUES_A_B_C;
- Zone zone(isolate);
+ Zone zone;
UniqueSet<String>* set = new(&zone) UniqueSet<String>();
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
MAKE_UNIQUES_A_B_C;
- Zone zone(isolate);
+ Zone zone;
UniqueSet<String>* set = new(&zone) UniqueSet<String>();
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
MAKE_UNIQUES_A_B_C;
- Zone zone(isolate);
+ Zone zone;
UniqueSet<String>* set = new(&zone) UniqueSet<String>();
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>();
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>();
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>();
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
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>();
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
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>();
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
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);
TypedGraphTest::TypedGraphTest(int num_parameters)
- : GraphTest(num_parameters), typer_(graph(), MaybeHandle<Context>()) {}
+ : GraphTest(num_parameters),
+ typer_(isolate(), graph(), MaybeHandle<Context>()) {}
TypedGraphTest::~TypedGraphTest() {}
}
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);
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) {}
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) {}
InstructionSequence* InstructionSequenceTest::sequence() {
if (sequence_ == nullptr) {
- sequence_ = new (zone()) InstructionSequence(zone(), &instruction_blocks_);
+ sequence_ = new (zone())
+ InstructionSequence(isolate(), zone(), &instruction_blocks_);
}
return sequence_;
}
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);
}
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();
}
OFStream os(stdout);
os << AsRPO(*graph());
}
- Zone zone(isolate());
+ Zone zone;
return LoopFinder::BuildLoopTree(graph(), &zone);
}
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);
}
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);
}
class ZonePoolTest : public TestWithIsolate {
public:
- ZonePoolTest() : zone_pool_(isolate()) {}
+ ZonePoolTest() {}
protected:
ZonePool* zone_pool() { return &zone_pool_; }
class TestWithZone : public TestWithIsolate {
public:
- TestWithZone() : zone_(isolate()) {}
+ TestWithZone() {}
virtual ~TestWithZone();
Zone* zone() { return &zone_; }