Commit d1b5aa07 authored by svenpanne's avatar svenpanne Committed by Commit bot

Removed most of the bogus CompilationInfo constructor calls.

A CompilationInfo constructed from just an Isolate* and a Zone* is in
weird an inconsistent state (calling e.g. flags() on it will crash),
so we need to avoid them. This CL removes almost all of them, the
remaining 2 call sites in (for testing only) will be handled in a
separate CL. Things which have been changed:

  * Linkage is basically a decorator for CallDescriptor now.

  * ChangeLowering doesn't need Linkage at all.

  * JSGenericLowering doesn't need a full CompilationInfo*, just a
    single flag.

  * JSContextSpecializer doesn't need the full CompilationInfo, just a
    Context.

  * Removed unused CompilationInfo from SimplifiedLoweringTester.

This nicely decouples things already a bit more, but there's still
work to do...

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

Cr-Commit-Position: refs/heads/master@{#26580}
parent 505b6020
......@@ -73,8 +73,9 @@ Node* ChangeLowering::AllocateHeapNumberWithValue(Node* value, Node* control) {
// The AllocateHeapNumberStub does not use the context, so we can safely pass
// in Smi zero here.
Callable callable = CodeFactory::AllocateHeapNumber(isolate());
CallDescriptor* descriptor = linkage()->GetStubCallDescriptor(
callable.descriptor(), 0, CallDescriptor::kNoFlags);
CallDescriptor* descriptor = Linkage::GetStubCallDescriptor(
isolate(), jsgraph()->zone(), callable.descriptor(), 0,
CallDescriptor::kNoFlags);
Node* target = jsgraph()->HeapConstant(callable.code());
Node* context = jsgraph()->NoContextConstant();
Node* effect = graph()->NewNode(common()->ValueEffect(1), value);
......
......@@ -19,8 +19,7 @@ class MachineOperatorBuilder;
class ChangeLowering FINAL : public Reducer {
public:
ChangeLowering(JSGraph* jsgraph, Linkage* linkage)
: jsgraph_(jsgraph), linkage_(linkage) {}
explicit ChangeLowering(JSGraph* jsgraph) : jsgraph_(jsgraph) {}
~ChangeLowering() FINAL;
Reduction Reduce(Node* node) FINAL;
......@@ -52,12 +51,10 @@ class ChangeLowering FINAL : public Reducer {
Graph* graph() const;
Isolate* isolate() const;
JSGraph* jsgraph() const { return jsgraph_; }
Linkage* linkage() const { return linkage_; }
CommonOperatorBuilder* common() const;
MachineOperatorBuilder* machine() const;
JSGraph* jsgraph_;
Linkage* linkage_;
};
} // namespace compiler
......
......@@ -16,7 +16,7 @@ namespace compiler {
Reduction JSContextSpecializer::Reduce(Node* node) {
if (node == context_) {
Node* constant = jsgraph_->Constant(info_->context());
Node* constant = jsgraph_->Constant(ctx_);
NodeProperties::ReplaceWithValue(node, constant);
return Replace(constant);
}
......@@ -56,12 +56,13 @@ Reduction JSContextSpecializer::ReduceJSLoadContext(Node* node) {
const Operator* op = jsgraph_->javascript()->LoadContext(
0, access.index(), access.immutable());
node->set_op(op);
Handle<Object> context_handle = Handle<Object>(context, info_->isolate());
Handle<Object> context_handle =
Handle<Object>(context, jsgraph_->isolate());
node->ReplaceInput(0, jsgraph_->Constant(context_handle));
return Changed(node);
}
Handle<Object> value = Handle<Object>(
context->get(static_cast<int>(access.index())), info_->isolate());
context->get(static_cast<int>(access.index())), jsgraph_->isolate());
// Even though the context slot is immutable, the context might have escaped
// before the function to which it belongs has initialized the slot.
......@@ -104,7 +105,8 @@ Reduction JSContextSpecializer::ReduceJSStoreContext(Node* node) {
const Operator* op = jsgraph_->javascript()->StoreContext(0, access.index());
node->set_op(op);
Handle<Object> new_context_handle = Handle<Object>(context, info_->isolate());
Handle<Object> new_context_handle =
Handle<Object>(context, jsgraph_->isolate());
node->ReplaceInput(0, jsgraph_->Constant(new_context_handle));
return Changed(node);
......
......@@ -9,6 +9,8 @@
#include "src/compiler/js-graph.h"
#include "src/contexts.h"
#include "src/compiler.h"
namespace v8 {
namespace internal {
namespace compiler {
......@@ -17,8 +19,8 @@ namespace compiler {
// some {LoadContext} nodes or strength reducing some {StoreContext} nodes.
class JSContextSpecializer : public Reducer {
public:
JSContextSpecializer(CompilationInfo* info, JSGraph* jsgraph, Node* context)
: info_(info), jsgraph_(jsgraph), context_(context) {}
JSContextSpecializer(Handle<Context> ctx, JSGraph* jsgraph, Node* context)
: ctx_(ctx), jsgraph_(jsgraph), context_(context) {}
Reduction Reduce(Node* node) OVERRIDE;
......@@ -27,7 +29,7 @@ class JSContextSpecializer : public Reducer {
Reduction ReduceJSStoreContext(Node* node);
private:
CompilationInfo* info_;
Handle<Context> ctx_;
JSGraph* jsgraph_;
Node* context_;
};
......
......@@ -17,10 +17,8 @@ namespace v8 {
namespace internal {
namespace compiler {
JSGenericLowering::JSGenericLowering(CompilationInfo* info, JSGraph* jsgraph)
: info_(info),
jsgraph_(jsgraph),
linkage_(new (jsgraph->zone()) Linkage(jsgraph->zone(), info)) {}
JSGenericLowering::JSGenericLowering(bool is_typing_enabled, JSGraph* jsgraph)
: is_typing_enabled_(is_typing_enabled), jsgraph_(jsgraph) {}
void JSGenericLowering::PatchOperator(Node* node, const Operator* op) {
......@@ -45,7 +43,7 @@ Reduction JSGenericLowering::Reduce(Node* node) {
// TODO(mstarzinger): If typing is enabled then simplified lowering will
// have inserted the correct ChangeBoolToBit, otherwise we need to perform
// poor-man's representation inference here and insert manual change.
if (!info()->is_typing_enabled()) {
if (!is_typing_enabled_) {
Node* condition = node->InputAt(0);
if (condition->opcode() != IrOpcode::kAlways) {
Node* test = graph()->NewNode(machine()->WordEqual(), condition,
......@@ -130,8 +128,8 @@ static CallDescriptor::Flags FlagsForNode(Node* node) {
void JSGenericLowering::ReplaceWithCompareIC(Node* node, Token::Value token) {
Callable callable = CodeFactory::CompareIC(isolate(), token);
bool has_frame_state = OperatorProperties::HasFrameStateInput(node->op());
CallDescriptor* desc_compare = linkage()->GetStubCallDescriptor(
callable.descriptor(), 0,
CallDescriptor* desc_compare = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), 0,
CallDescriptor::kPatchableCallSiteWithNop | FlagsForNode(node));
NodeVector inputs(zone());
inputs.reserve(node->InputCount() + 1);
......@@ -172,8 +170,9 @@ void JSGenericLowering::ReplaceWithCompareIC(Node* node, Token::Value token) {
void JSGenericLowering::ReplaceWithStubCall(Node* node, Callable callable,
CallDescriptor::Flags flags) {
Operator::Properties properties = node->op()->properties();
CallDescriptor* desc = linkage()->GetStubCallDescriptor(
callable.descriptor(), 0, flags | FlagsForNode(node), properties);
CallDescriptor* desc =
Linkage::GetStubCallDescriptor(isolate(), zone(), callable.descriptor(),
0, flags | FlagsForNode(node), properties);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
PatchInsertInput(node, 0, stub_code);
PatchOperator(node, common()->Call(desc));
......@@ -186,8 +185,9 @@ void JSGenericLowering::ReplaceWithBuiltinCall(Node* node,
Operator::Properties properties = node->op()->properties();
Callable callable =
CodeFactory::CallFunction(isolate(), nargs - 1, NO_CALL_FUNCTION_FLAGS);
CallDescriptor* desc = linkage()->GetStubCallDescriptor(
callable.descriptor(), nargs, FlagsForNode(node), properties);
CallDescriptor* desc =
Linkage::GetStubCallDescriptor(isolate(), zone(), callable.descriptor(),
nargs, FlagsForNode(node), properties);
Node* global_object = graph()->NewNode(
machine()->Load(kMachAnyTagged), NodeProperties::GetContextInput(node),
jsgraph()->IntPtrConstant(
......@@ -216,7 +216,7 @@ void JSGenericLowering::ReplaceWithRuntimeCall(Node* node,
const Runtime::Function* fun = Runtime::FunctionForId(f);
int nargs = (nargs_override < 0) ? fun->nargs : nargs_override;
CallDescriptor* desc =
linkage()->GetRuntimeCallDescriptor(f, nargs, properties);
Linkage::GetRuntimeCallDescriptor(zone(), f, nargs, properties);
Node* ref = jsgraph()->ExternalConstant(ExternalReference(f, isolate()));
Node* arity = jsgraph()->Int32Constant(nargs);
PatchInsertInput(node, 0, jsgraph()->CEntryStubConstant(fun->result_size));
......@@ -318,8 +318,8 @@ void JSGenericLowering::LowerJSInstanceOf(Node* node) {
InstanceofStub::kArgsInRegisters);
InstanceofStub stub(isolate(), flags);
CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
CallDescriptor* desc =
linkage()->GetStubCallDescriptor(d, 0, FlagsForNode(node));
CallDescriptor* desc = Linkage::GetStubCallDescriptor(isolate(), zone(), d, 0,
FlagsForNode(node));
Node* stub_code = jsgraph()->HeapConstant(stub.GetCode());
PatchInsertInput(node, 0, stub_code);
PatchOperator(node, common()->Call(desc));
......@@ -374,8 +374,8 @@ void JSGenericLowering::LowerJSCallConstruct(Node* node) {
int arity = OpParameter<int>(node);
CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
CallDescriptor* desc =
linkage()->GetStubCallDescriptor(d, arity, FlagsForNode(node));
CallDescriptor* desc = Linkage::GetStubCallDescriptor(
isolate(), zone(), d, arity, FlagsForNode(node));
Node* stub_code = jsgraph()->HeapConstant(stub.GetCode());
Node* construct = NodeProperties::GetValueInput(node, 0);
PatchInsertInput(node, 0, stub_code);
......@@ -418,8 +418,8 @@ bool JSGenericLowering::TryLowerDirectJSCall(Node* node) {
context = jsgraph()->HeapConstant(Handle<Context>(function->context()));
}
node->ReplaceInput(index, context);
CallDescriptor* desc =
linkage()->GetJSCallDescriptor(1 + arg_count, FlagsForNode(node));
CallDescriptor* desc = Linkage::GetJSCallDescriptor(
zone(), false, 1 + arg_count, FlagsForNode(node));
PatchOperator(node, common()->Call(desc));
return true;
}
......@@ -434,8 +434,9 @@ void JSGenericLowering::LowerJSCallFunction(Node* node) {
int arg_count = static_cast<int>(p.arity() - 2);
CallFunctionStub stub(isolate(), arg_count, p.flags());
CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
CallDescriptor* desc = linkage()->GetStubCallDescriptor(
d, static_cast<int>(p.arity() - 1), FlagsForNode(node));
CallDescriptor* desc = Linkage::GetStubCallDescriptor(
isolate(), zone(), d, static_cast<int>(p.arity() - 1),
FlagsForNode(node));
Node* stub_code = jsgraph()->HeapConstant(stub.GetCode());
PatchInsertInput(node, 0, stub_code);
PatchOperator(node, common()->Call(desc));
......
......@@ -26,7 +26,7 @@ class Linkage;
// Lowers JS-level operators to runtime and IC calls in the "generic" case.
class JSGenericLowering FINAL : public Reducer {
public:
JSGenericLowering(CompilationInfo* info, JSGraph* graph);
JSGenericLowering(bool is_typing_enabled, JSGraph* graph);
~JSGenericLowering() FINAL {}
Reduction Reduce(Node* node) FINAL;
......@@ -51,18 +51,15 @@ class JSGenericLowering FINAL : public Reducer {
bool TryLowerDirectJSCall(Node* node);
Zone* zone() const { return graph()->zone(); }
Isolate* isolate() const { return info_->isolate(); }
Isolate* isolate() const { return jsgraph()->isolate(); }
JSGraph* jsgraph() const { return jsgraph_; }
Graph* graph() const { return jsgraph()->graph(); }
Linkage* linkage() const { return linkage_; }
CompilationInfo* info() const { return info_; }
CommonOperatorBuilder* common() const { return jsgraph()->common(); }
MachineOperatorBuilder* machine() const { return jsgraph()->machine(); }
private:
CompilationInfo* info_;
bool is_typing_enabled_;
JSGraph* jsgraph_;
Linkage* linkage_;
};
} // namespace compiler
......
......@@ -94,27 +94,6 @@ FrameOffset Linkage::GetFrameOffset(int spill_slot, Frame* frame,
}
CallDescriptor* Linkage::GetJSCallDescriptor(
int parameter_count, CallDescriptor::Flags flags) const {
return GetJSCallDescriptor(zone_, false, parameter_count, flags);
}
CallDescriptor* Linkage::GetRuntimeCallDescriptor(
Runtime::FunctionId function, int parameter_count,
Operator::Properties properties) const {
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(isolate_, zone_, descriptor,
stack_parameter_count, flags, properties);
}
// static
bool Linkage::NeedsFrameState(Runtime::FunctionId function) {
if (!FLAG_turbo_deoptimization) {
......
......@@ -172,38 +172,24 @@ std::ostream& operator<<(std::ostream& os, const CallDescriptor::Kind& k);
// Call[Runtime] CEntryStub, arg 1, arg 2, arg 3, [...], fun, #arg, context
class Linkage : public ZoneObject {
public:
Linkage(Zone* zone, CompilationInfo* info)
: isolate_(info->isolate()),
zone_(zone),
incoming_(ComputeIncoming(zone, info)) {}
Linkage(Isolate* isolate, Zone* zone, CallDescriptor* incoming)
: isolate_(isolate), zone_(zone), incoming_(incoming) {}
explicit Linkage(CallDescriptor* incoming) : incoming_(incoming) {}
static CallDescriptor* ComputeIncoming(Zone* zone, CompilationInfo* info);
// The call descriptor for this compilation unit describes the locations
// of incoming parameters and the outgoing return value(s).
CallDescriptor* GetIncomingDescriptor() const { return incoming_; }
CallDescriptor* GetJSCallDescriptor(int parameter_count,
CallDescriptor::Flags flags) const;
static CallDescriptor* GetJSCallDescriptor(Zone* zone, bool is_osr,
int parameter_count,
CallDescriptor::Flags flags);
CallDescriptor* GetRuntimeCallDescriptor(
Runtime::FunctionId function, int parameter_count,
Operator::Properties properties) const;
static CallDescriptor* GetRuntimeCallDescriptor(
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(
Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
int stack_parameter_count, CallDescriptor::Flags flags,
Operator::Properties properties);
Operator::Properties properties = Operator::kNoProperties);
// Creates a call descriptor for simplified C calls that is appropriate
// for the host platform. This simplified calling convention only supports
......@@ -246,8 +232,6 @@ class Linkage : public ZoneObject {
static const int kJSFunctionCallClosureParamIndex = -1;
private:
Isolate* isolate_;
Zone* const zone_;
CallDescriptor* const incoming_;
DISALLOW_COPY_AND_ASSIGN(Linkage);
......
......@@ -415,7 +415,7 @@ struct ContextSpecializerPhase {
void Run(PipelineData* data, Zone* temp_zone) {
SourcePositionTable::Scope pos(data->source_positions(),
SourcePosition::Unknown());
JSContextSpecializer spec(data->info(), data->jsgraph(),
JSContextSpecializer spec(data->info()->context(), data->jsgraph(),
data->context_node());
GraphReducer graph_reducer(data->graph(), temp_zone);
AddReducer(data, &graph_reducer, &spec);
......@@ -512,10 +512,9 @@ struct ChangeLoweringPhase {
void Run(PipelineData* data, Zone* temp_zone) {
SourcePositionTable::Scope pos(data->source_positions(),
SourcePosition::Unknown());
Linkage linkage(data->graph_zone(), data->info());
ValueNumberingReducer vn_reducer(temp_zone);
SimplifiedOperatorReducer simple_reducer(data->jsgraph());
ChangeLowering lowering(data->jsgraph(), &linkage);
ChangeLowering lowering(data->jsgraph());
MachineOperatorReducer machine_reducer(data->jsgraph());
CommonOperatorReducer common_reducer;
GraphReducer graph_reducer(data->graph(), temp_zone);
......@@ -571,7 +570,8 @@ struct GenericLoweringPhase {
void Run(PipelineData* data, Zone* temp_zone) {
SourcePositionTable::Scope pos(data->source_positions(),
SourcePosition::Unknown());
JSGenericLowering generic(data->info(), data->jsgraph());
JSGenericLowering generic(data->info()->is_typing_enabled(),
data->jsgraph());
SelectLowering select(data->jsgraph()->graph(), data->jsgraph()->common());
GraphReducer graph_reducer(data->graph(), temp_zone);
AddReducer(data, &graph_reducer, &generic);
......@@ -954,7 +954,7 @@ Handle<Code> Pipeline::GenerateCode() {
{
// Generate optimized code.
Linkage linkage(data.instruction_zone(), info());
Linkage linkage(Linkage::ComputeIncoming(data.instruction_zone(), info()));
GenerateCode(&linkage);
}
Handle<Code> code = data.code();
......@@ -1026,7 +1026,7 @@ Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
TraceSchedule(schedule);
}
Linkage linkage(info->isolate(), info->zone(), call_descriptor);
Linkage linkage(call_descriptor);
pipeline.GenerateCode(&linkage);
Handle<Code> code = data.code();
......
......@@ -126,11 +126,9 @@ class ChangesLoweringTester : public GraphBuilderTester<ReturnType> {
void LowerChange(Node* change) {
// 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->isolate(), this->graph(), info.context());
Typer typer(this->isolate(), this->graph(), Handle<Context>());
typer.Run();
ChangeLowering change_lowering(&jsgraph, &linkage);
ChangeLowering change_lowering(&jsgraph);
SelectLowering select_lowering(this->graph(), this->common());
GraphReducer reducer(this->graph(), this->zone());
reducer.AddReducer(&change_lowering);
......
......@@ -31,7 +31,7 @@ class InstructionTester : public HandleAndZoneScope {
graph(zone()),
schedule(zone()),
info(static_cast<HydrogenCodeStub*>(NULL), main_isolate()),
linkage(zone(), &info),
linkage(Linkage::ComputeIncoming(zone(), &info)),
common(zone()),
machine(zone()),
code(NULL) {}
......
......@@ -24,15 +24,13 @@ class ContextSpecializationTester : public HandleAndZoneScope,
javascript_(main_zone()),
machine_(main_zone()),
simplified_(main_zone()),
jsgraph_(main_isolate(), graph(), common(), &javascript_, &machine_),
info_(main_isolate(), main_zone()) {}
jsgraph_(main_isolate(), graph(), common(), &javascript_, &machine_) {}
Factory* factory() { return main_isolate()->factory(); }
CommonOperatorBuilder* common() { return &common_; }
JSOperatorBuilder* javascript() { return &javascript_; }
SimplifiedOperatorBuilder* simplified() { return &simplified_; }
JSGraph* jsgraph() { return &jsgraph_; }
CompilationInfo* info() { return &info_; }
private:
CommonOperatorBuilder common_;
......@@ -40,7 +38,6 @@ class ContextSpecializationTester : public HandleAndZoneScope,
MachineOperatorBuilder machine_;
SimplifiedOperatorBuilder simplified_;
JSGraph jsgraph_;
CompilationInfo info_;
};
......@@ -63,7 +60,7 @@ TEST(ReduceJSLoadContext) {
Node* const_context = t.jsgraph()->Constant(native);
Node* deep_const_context = t.jsgraph()->Constant(subcontext2);
Node* param_context = t.NewNode(t.common()->Parameter(0), start);
JSContextSpecializer spec(t.info(), t.jsgraph(), const_context);
JSContextSpecializer spec(Handle<Context>(), t.jsgraph(), const_context);
{
// Mutable slot, constant context, depth = 0 => do nothing.
......@@ -135,7 +132,7 @@ TEST(ReduceJSStoreContext) {
Node* const_context = t.jsgraph()->Constant(native);
Node* deep_const_context = t.jsgraph()->Constant(subcontext2);
Node* param_context = t.NewNode(t.common()->Parameter(0), start);
JSContextSpecializer spec(t.info(), t.jsgraph(), const_context);
JSContextSpecializer spec(Handle<Context>(), t.jsgraph(), const_context);
{
// Mutable slot, constant context, depth = 0 => do nothing.
......@@ -197,11 +194,10 @@ TEST(SpecializeToContext) {
Handle<Object> expected = t.factory()->InternalizeUtf8String("gboy!");
const int slot = Context::GLOBAL_OBJECT_INDEX;
native->set(slot, *expected);
t.info()->SetContext(native);
Node* const_context = t.jsgraph()->Constant(native);
Node* param_context = t.NewNode(t.common()->Parameter(0), start);
JSContextSpecializer spec(t.info(), t.jsgraph(), const_context);
JSContextSpecializer spec(native, t.jsgraph(), const_context);
{
// Check that specialization replaces values and forwards effects
......
......@@ -44,7 +44,8 @@ TEST(TestLinkageCreate) {
InitializedHandleScope handles;
Handle<JSFunction> function = Compile("a + b");
CompilationInfoWithZone info(function);
Linkage linkage(info.zone(), &info);
CallDescriptor* descriptor = Linkage::ComputeIncoming(info.zone(), &info);
CHECK(descriptor);
}
......@@ -59,9 +60,7 @@ TEST(TestLinkageJSFunctionIncoming) {
Handle<JSFunction> function = v8::Utils::OpenHandle(
*v8::Handle<v8::Function>::Cast(CompileRun(sources[i])));
CompilationInfoWithZone info(function);
Linkage linkage(info.zone(), &info);
CallDescriptor* descriptor = linkage.GetIncomingDescriptor();
CallDescriptor* descriptor = Linkage::ComputeIncoming(info.zone(), &info);
CHECK(descriptor);
CHECK_EQ(1 + i, static_cast<int>(descriptor->JSParameterCount()));
......@@ -75,10 +74,10 @@ TEST(TestLinkageJSFunctionIncoming) {
TEST(TestLinkageCodeStubIncoming) {
Isolate* isolate = CcTest::InitIsolateOnce();
CompilationInfoWithZone info(static_cast<CodeStub*>(NULL), isolate);
Linkage linkage(info.zone(), &info);
CallDescriptor* descriptor = Linkage::ComputeIncoming(info.zone(), &info);
// TODO(titzer): test linkage creation with a bonafide code stub.
// this just checks current behavior.
CHECK(!linkage.GetIncomingDescriptor());
CHECK(!descriptor);
}
......@@ -86,11 +85,10 @@ TEST(TestLinkageJSCall) {
HandleAndZoneScope handles;
Handle<JSFunction> function = Compile("a + c");
CompilationInfoWithZone info(function);
Linkage linkage(info.zone(), &info);
for (int i = 0; i < 32; i++) {
CallDescriptor* descriptor =
linkage.GetJSCallDescriptor(i, CallDescriptor::kNoFlags);
CallDescriptor* descriptor = Linkage::GetJSCallDescriptor(
info.zone(), false, i, CallDescriptor::kNoFlags);
CHECK(descriptor);
CHECK_EQ(i, static_cast<int>(descriptor->JSParameterCount()));
CHECK_EQ(1, static_cast<int>(descriptor->ReturnCount()));
......
......@@ -61,11 +61,7 @@ class SimplifiedLoweringTester : public GraphBuilderTester<ReturnType> {
typer.Run();
lowering.LowerAllNodes();
Zone* zone = this->zone();
CompilationInfo info(this->isolate(), zone);
Linkage linkage(this->isolate(), zone, Linkage::GetSimplifiedCDescriptor(
zone, this->machine_sig_));
ChangeLowering lowering(&jsgraph, &linkage);
ChangeLowering lowering(&jsgraph);
GraphReducer reducer(this->graph(), this->zone());
reducer.AddReducer(&lowering);
reducer.ReduceGraph();
......
......@@ -67,9 +67,7 @@ class ChangeLoweringTest : public GraphTest {
MachineOperatorBuilder machine(zone(), WordRepresentation());
JSOperatorBuilder javascript(zone());
JSGraph jsgraph(isolate(), graph(), common(), &javascript, &machine);
CompilationInfo info(isolate(), zone());
Linkage linkage(zone(), &info);
ChangeLowering reducer(&jsgraph, &linkage);
ChangeLowering reducer(&jsgraph);
return reducer.Reduce(node);
}
......
......@@ -36,7 +36,7 @@ InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build(
}
size_t const node_count = graph()->NodeCount();
EXPECT_NE(0u, node_count);
Linkage linkage(test_->isolate(), test_->zone(), call_descriptor());
Linkage linkage(call_descriptor());
InstructionBlocks* instruction_blocks =
InstructionSequence::InstructionBlocksFor(test_->zone(), schedule);
InstructionSequence sequence(test_->isolate(), test_->zone(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment