Commit bfa3884a authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

[turbofan] Machine operators are globally shared singletons.

TEST=compiler-unittests,cctest
R=svenpanne@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23864 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 11f7584d
......@@ -514,6 +514,7 @@ source_set("v8_base") {
"src/compiler/linkage.h",
"src/compiler/machine-operator-reducer.cc",
"src/compiler/machine-operator-reducer.h",
"src/compiler/machine-operator.cc",
"src/compiler/machine-operator.h",
"src/compiler/machine-type.cc",
"src/compiler/machine-type.h",
......
......@@ -283,8 +283,8 @@ static void VisitBinop(InstructionSelector* selector, Node* node,
void InstructionSelector::VisitLoad(Node* node) {
MachineType rep = RepresentationOf(OpParameter<MachineType>(node));
MachineType typ = TypeOf(OpParameter<MachineType>(node));
MachineType rep = RepresentationOf(OpParameter<LoadRepresentation>(node));
MachineType typ = TypeOf(OpParameter<LoadRepresentation>(node));
ArmOperandGenerator g(this);
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
......@@ -330,8 +330,8 @@ void InstructionSelector::VisitStore(Node* node) {
Node* value = node->InputAt(2);
StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node);
MachineType rep = RepresentationOf(store_rep.machine_type);
if (store_rep.write_barrier_kind == kFullWriteBarrier) {
MachineType rep = RepresentationOf(store_rep.machine_type());
if (store_rep.write_barrier_kind() == kFullWriteBarrier) {
DCHECK(rep == kRepTagged);
// TODO(dcarney): refactor RecordWrite function to take temp registers
// and pass them here instead of using fixed regs
......@@ -342,7 +342,7 @@ void InstructionSelector::VisitStore(Node* node) {
temps);
return;
}
DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind);
DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind());
ArchOpcode opcode;
switch (rep) {
......
......@@ -136,8 +136,8 @@ static void VisitBinop(InstructionSelector* selector, Node* node,
void InstructionSelector::VisitLoad(Node* node) {
MachineType rep = RepresentationOf(OpParameter<MachineType>(node));
MachineType typ = TypeOf(OpParameter<MachineType>(node));
MachineType rep = RepresentationOf(OpParameter<LoadRepresentation>(node));
MachineType typ = TypeOf(OpParameter<LoadRepresentation>(node));
Arm64OperandGenerator g(this);
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
......@@ -184,8 +184,8 @@ void InstructionSelector::VisitStore(Node* node) {
Node* value = node->InputAt(2);
StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node);
MachineType rep = RepresentationOf(store_rep.machine_type);
if (store_rep.write_barrier_kind == kFullWriteBarrier) {
MachineType rep = RepresentationOf(store_rep.machine_type());
if (store_rep.write_barrier_kind() == kFullWriteBarrier) {
DCHECK(rep == kRepTagged);
// TODO(dcarney): refactor RecordWrite function to take temp registers
// and pass them here instead of using fixed regs
......@@ -196,7 +196,7 @@ void InstructionSelector::VisitStore(Node* node) {
temps);
return;
}
DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind);
DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind());
ArchOpcode opcode;
switch (rep) {
case kRepFloat32:
......
......@@ -1924,7 +1924,7 @@ Node* AstGraphBuilder::BuildVariableAssignment(Variable* variable, Node* value,
Node* AstGraphBuilder::BuildLoadObjectField(Node* object, int offset) {
// TODO(sigurds) Use simplified load here once it is ready.
MachineOperatorBuilder machine(zone());
MachineOperatorBuilder machine;
Node* field_load = NewNode(machine.Load(kMachAnyTagged), object,
jsgraph_->Int32Constant(offset - kHeapObjectTag));
return field_load;
......
......@@ -77,7 +77,7 @@ class ChangeLoweringTest : public GraphTest {
JSGraph jsgraph(graph(), common(), &typer);
CompilationInfo info(isolate(), zone());
Linkage linkage(&info);
MachineOperatorBuilder machine(zone(), WordRepresentation());
MachineOperatorBuilder machine(WordRepresentation());
ChangeLowering reducer(&jsgraph, &linkage, &machine);
return reducer.Reduce(node);
}
......
......@@ -44,13 +44,13 @@ Reduction ChangeLowering::Reduce(Node* node) {
Node* ChangeLowering::HeapNumberValueIndexConstant() {
STATIC_ASSERT(HeapNumber::kValueOffset % kPointerSize == 0);
const int heap_number_value_offset =
((HeapNumber::kValueOffset / kPointerSize) * (machine()->is64() ? 8 : 4));
((HeapNumber::kValueOffset / kPointerSize) * (machine()->Is64() ? 8 : 4));
return jsgraph()->Int32Constant(heap_number_value_offset - kHeapObjectTag);
}
Node* ChangeLowering::SmiMaxValueConstant() {
const int smi_value_size = machine()->is32() ? SmiTagging<4>::SmiValueSize()
const int smi_value_size = machine()->Is32() ? SmiTagging<4>::SmiValueSize()
: SmiTagging<8>::SmiValueSize();
return jsgraph()->Int32Constant(
-(static_cast<int>(0xffffffffu << (smi_value_size - 1)) + 1));
......@@ -58,7 +58,7 @@ Node* ChangeLowering::SmiMaxValueConstant() {
Node* ChangeLowering::SmiShiftBitsConstant() {
const int smi_shift_size = machine()->is32() ? SmiTagging<4>::SmiShiftSize()
const int smi_shift_size = machine()->Is32() ? SmiTagging<4>::SmiShiftSize()
: SmiTagging<8>::SmiShiftSize();
return jsgraph()->Int32Constant(smi_shift_size + kSmiTagSize);
}
......@@ -79,15 +79,15 @@ Node* ChangeLowering::AllocateHeapNumberWithValue(Node* value, Node* control) {
jsgraph()->ExternalConstant(ExternalReference(function, isolate())),
jsgraph()->Int32Constant(function->nargs), context, effect, control);
Node* store = graph()->NewNode(
machine()->Store(kMachFloat64, kNoWriteBarrier), heap_number,
HeapNumberValueIndexConstant(), value, heap_number, control);
machine()->Store(StoreRepresentation(kMachFloat64, kNoWriteBarrier)),
heap_number, HeapNumberValueIndexConstant(), value, heap_number, control);
return graph()->NewNode(common()->Finish(1), heap_number, store);
}
Node* ChangeLowering::ChangeSmiToInt32(Node* value) {
value = graph()->NewNode(machine()->WordSar(), value, SmiShiftBitsConstant());
if (machine()->is64()) {
if (machine()->Is64()) {
value = graph()->NewNode(machine()->TruncateInt64ToInt32(), value);
}
return value;
......@@ -131,7 +131,7 @@ Reduction ChangeLowering::ChangeFloat64ToTagged(Node* val, Node* control) {
Reduction ChangeLowering::ChangeInt32ToTagged(Node* val, Node* control) {
if (machine()->is64()) {
if (machine()->Is64()) {
return Replace(
graph()->NewNode(machine()->Word64Shl(),
graph()->NewNode(machine()->ChangeInt32ToInt64(), val),
......@@ -219,7 +219,7 @@ Reduction ChangeLowering::ChangeUint32ToTagged(Node* val, Node* control) {
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* smi = graph()->NewNode(
machine()->WordShl(),
machine()->is64()
machine()->Is64()
? graph()->NewNode(machine()->ChangeUint32ToUint64(), val)
: val,
SmiShiftBitsConstant());
......
......@@ -428,20 +428,20 @@ class IsCallMatcher FINAL : public NodeMatcher {
class IsLoadMatcher FINAL : public NodeMatcher {
public:
IsLoadMatcher(const Matcher<MachineType>& type_matcher,
IsLoadMatcher(const Matcher<LoadRepresentation>& rep_matcher,
const Matcher<Node*>& base_matcher,
const Matcher<Node*>& index_matcher,
const Matcher<Node*>& effect_matcher)
: NodeMatcher(IrOpcode::kLoad),
type_matcher_(type_matcher),
rep_matcher_(rep_matcher),
base_matcher_(base_matcher),
index_matcher_(index_matcher),
effect_matcher_(effect_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE {
NodeMatcher::DescribeTo(os);
*os << " whose type (";
type_matcher_.DescribeTo(os);
*os << " whose rep (";
rep_matcher_.DescribeTo(os);
*os << "), base (";
base_matcher_.DescribeTo(os);
*os << "), index (";
......@@ -454,8 +454,8 @@ class IsLoadMatcher FINAL : public NodeMatcher {
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<MachineType>(node), "type",
type_matcher_, listener) &&
PrintMatchAndExplain(OpParameter<LoadRepresentation>(node), "rep",
rep_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "base",
base_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1),
......@@ -465,7 +465,7 @@ class IsLoadMatcher FINAL : public NodeMatcher {
}
private:
const Matcher<MachineType> type_matcher_;
const Matcher<LoadRepresentation> rep_matcher_;
const Matcher<Node*> base_matcher_;
const Matcher<Node*> index_matcher_;
const Matcher<Node*> effect_matcher_;
......@@ -513,10 +513,10 @@ class IsStoreMatcher FINAL : public NodeMatcher {
OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(
OpParameter<StoreRepresentation>(node).machine_type, "type",
OpParameter<StoreRepresentation>(node).machine_type(), "type",
type_matcher_, listener) &&
PrintMatchAndExplain(
OpParameter<StoreRepresentation>(node).write_barrier_kind,
OpParameter<StoreRepresentation>(node).write_barrier_kind(),
"write barrier", write_barrier_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "base",
base_matcher_, listener) &&
......@@ -704,12 +704,12 @@ Matcher<Node*> IsCall(const Matcher<CallDescriptor*>& descriptor_matcher,
}
Matcher<Node*> IsLoad(const Matcher<MachineType>& type_matcher,
Matcher<Node*> IsLoad(const Matcher<LoadRepresentation>& rep_matcher,
const Matcher<Node*>& base_matcher,
const Matcher<Node*>& index_matcher,
const Matcher<Node*>& effect_matcher) {
return MakeMatcher(new IsLoadMatcher(type_matcher, base_matcher,
index_matcher, effect_matcher));
return MakeMatcher(new IsLoadMatcher(rep_matcher, base_matcher, index_matcher,
effect_matcher));
}
......
......@@ -83,7 +83,7 @@ Matcher<Node*> IsCall(const Matcher<CallDescriptor*>& descriptor_matcher,
const Matcher<Node*>& effect_matcher,
const Matcher<Node*>& control_matcher);
Matcher<Node*> IsLoad(const Matcher<MachineType>& type_matcher,
Matcher<Node*> IsLoad(const Matcher<LoadRepresentation>& rep_matcher,
const Matcher<Node*>& base_matcher,
const Matcher<Node*>& index_matcher,
const Matcher<Node*>& effect_matcher);
......
......@@ -41,8 +41,8 @@ class IA32OperandGenerator FINAL : public OperandGenerator {
void InstructionSelector::VisitLoad(Node* node) {
MachineType rep = RepresentationOf(OpParameter<MachineType>(node));
MachineType typ = TypeOf(OpParameter<MachineType>(node));
MachineType rep = RepresentationOf(OpParameter<LoadRepresentation>(node));
MachineType typ = TypeOf(OpParameter<LoadRepresentation>(node));
IA32OperandGenerator g(this);
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
......@@ -98,8 +98,8 @@ void InstructionSelector::VisitStore(Node* node) {
Node* value = node->InputAt(2);
StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node);
MachineType rep = RepresentationOf(store_rep.machine_type);
if (store_rep.write_barrier_kind == kFullWriteBarrier) {
MachineType rep = RepresentationOf(store_rep.machine_type());
if (store_rep.write_barrier_kind() == kFullWriteBarrier) {
DCHECK_EQ(kRepTagged, rep);
// TODO(dcarney): refactor RecordWrite function to take temp registers
// and pass them here instead of using fixed regs
......@@ -110,7 +110,7 @@ void InstructionSelector::VisitStore(Node* node) {
temps);
return;
}
DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind);
DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind());
InstructionOperand* val;
if (g.CanBeImmediate(value)) {
val = g.UseImmediate(value);
......
......@@ -488,8 +488,8 @@ void InstructionSelector::VisitNode(Node* node) {
case IrOpcode::kStateValues:
return;
case IrOpcode::kLoad: {
MachineType load_rep = OpParameter<MachineType>(node);
MarkAsRepresentation(load_rep, node);
LoadRepresentation rep = OpParameter<LoadRepresentation>(node);
MarkAsRepresentation(rep, node);
return VisitLoad(node);
}
case IrOpcode::kStore:
......
......@@ -490,7 +490,8 @@ Node* JSGenericLowering::LowerJSStoreContext(Node* node) {
}
node->ReplaceInput(2, NodeProperties::GetValueInput(node, 1));
node->ReplaceInput(1, Int32Constant(Context::SlotOffset(access.index())));
PatchOperator(node, machine()->Store(kMachAnyTagged, kFullWriteBarrier));
PatchOperator(node, machine()->Store(StoreRepresentation(kMachAnyTagged,
kFullWriteBarrier)));
return node;
}
......
......@@ -19,9 +19,7 @@ namespace compiler {
class JSTypedLowering FINAL : public Reducer {
public:
explicit JSTypedLowering(JSGraph* jsgraph)
: jsgraph_(jsgraph),
simplified_(jsgraph->zone()),
machine_(jsgraph->zone()) {}
: jsgraph_(jsgraph), simplified_(jsgraph->zone()) {}
virtual ~JSTypedLowering();
virtual Reduction Reduce(Node* node) OVERRIDE;
......
......@@ -15,7 +15,7 @@ namespace compiler {
class MachineOperatorReducerTest : public GraphTest {
public:
explicit MachineOperatorReducerTest(int num_parameters = 2)
: GraphTest(num_parameters), machine_(zone()) {}
: GraphTest(num_parameters) {}
protected:
Reduction Reduce(Node* node) {
......
......@@ -15,7 +15,7 @@ namespace internal {
namespace compiler {
MachineOperatorReducer::MachineOperatorReducer(JSGraph* jsgraph)
: jsgraph_(jsgraph), machine_(jsgraph->zone()) {}
: jsgraph_(jsgraph) {}
MachineOperatorReducer::~MachineOperatorReducer() {}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -36,7 +36,22 @@ enum MachineType {
kTypeInt64 = 1 << 11,
kTypeUint64 = 1 << 12,
kTypeNumber = 1 << 13,
kTypeAny = 1 << 14
kTypeAny = 1 << 14,
// Machine types.
kMachNone = 0,
kMachFloat32 = kRepFloat32 | kTypeNumber,
kMachFloat64 = kRepFloat64 | kTypeNumber,
kMachInt8 = kRepWord8 | kTypeInt32,
kMachUint8 = kRepWord8 | kTypeUint32,
kMachInt16 = kRepWord16 | kTypeInt32,
kMachUint16 = kRepWord16 | kTypeUint32,
kMachInt32 = kRepWord32 | kTypeInt32,
kMachUint32 = kRepWord32 | kTypeUint32,
kMachInt64 = kRepWord64 | kTypeInt64,
kMachUint64 = kRepWord64 | kTypeUint64,
kMachPtr = (kPointerSize == 4) ? kRepWord32 : kRepWord64,
kMachAnyTagged = kRepTagged | kTypeAny
};
OStream& operator<<(OStream& os, const MachineType& type);
......@@ -51,30 +66,6 @@ const MachineTypeUnion kTypeMask = kTypeBool | kTypeInt32 | kTypeUint32 |
kTypeInt64 | kTypeUint64 | kTypeNumber |
kTypeAny;
const MachineType kMachNone = static_cast<MachineType>(0);
const MachineType kMachFloat32 =
static_cast<MachineType>(kRepFloat32 | kTypeNumber);
const MachineType kMachFloat64 =
static_cast<MachineType>(kRepFloat64 | kTypeNumber);
const MachineType kMachInt8 = static_cast<MachineType>(kRepWord8 | kTypeInt32);
const MachineType kMachUint8 =
static_cast<MachineType>(kRepWord8 | kTypeUint32);
const MachineType kMachInt16 =
static_cast<MachineType>(kRepWord16 | kTypeInt32);
const MachineType kMachUint16 =
static_cast<MachineType>(kRepWord16 | kTypeUint32);
const MachineType kMachInt32 =
static_cast<MachineType>(kRepWord32 | kTypeInt32);
const MachineType kMachUint32 =
static_cast<MachineType>(kRepWord32 | kTypeUint32);
const MachineType kMachInt64 =
static_cast<MachineType>(kRepWord64 | kTypeInt64);
const MachineType kMachUint64 =
static_cast<MachineType>(kRepWord64 | kTypeUint64);
const MachineType kMachPtr = kPointerSize == 4 ? kRepWord32 : kRepWord64;
const MachineType kMachAnyTagged =
static_cast<MachineType>(kRepTagged | kTypeAny);
// Gets only the type of the given type.
inline MachineType TypeOf(MachineType machine_type) {
int result = machine_type & kTypeMask;
......
......@@ -110,21 +110,21 @@ OStream& operator<<(OStream& os, const Operator& op);
// An implementation of Operator that has no static parameters. Such operators
// have just a name, an opcode, and a fixed number of inputs and outputs.
// They can represented by singletons and shared globally.
class SimpleOperator FINAL : public Operator {
class SimpleOperator : public Operator {
public:
SimpleOperator(Opcode opcode, Properties properties, int input_count,
int output_count, const char* mnemonic);
~SimpleOperator();
virtual bool Equals(const Operator* that) const OVERRIDE {
virtual bool Equals(const Operator* that) const FINAL {
return opcode() == that->opcode();
}
virtual int HashCode() const OVERRIDE { return opcode(); }
virtual int InputCount() const OVERRIDE { return input_count_; }
virtual int OutputCount() const OVERRIDE { return output_count_; }
virtual int HashCode() const FINAL { return opcode(); }
virtual int InputCount() const FINAL { return input_count_; }
virtual int OutputCount() const FINAL { return output_count_; }
private:
virtual OStream& PrintTo(OStream& os) const OVERRIDE { // NOLINT
virtual OStream& PrintTo(OStream& os) const FINAL { // NOLINT
return os << mnemonic();
}
......@@ -260,9 +260,6 @@ class Operator1 : public Operator {
T parameter_;
};
// Type definitions for operators with specific types of parameters.
typedef Operator1<Unique<Name> > NameOperator;
// Helper to extract parameters from Operator1<*> operator.
template <typename T>
......
......@@ -169,6 +169,7 @@ Handle<Code> Pipeline::GenerateCode() {
// construction. This is currently only needed for the node cache, which the
// typer could sweep over later.
Typer typer(zone());
MachineOperatorBuilder machine;
CommonOperatorBuilder common(zone());
JSGraph jsgraph(&graph, &common, &typer);
Node* context_node;
......@@ -256,7 +257,6 @@ Handle<Code> Pipeline::GenerateCode() {
SourcePositionTable::Scope pos(&source_positions,
SourcePosition::Unknown());
Linkage linkage(info());
MachineOperatorBuilder machine(zone());
ValueNumberingReducer vn_reducer(zone());
SimplifiedOperatorReducer simple_reducer(&jsgraph, &machine);
ChangeLowering lowering(&jsgraph, &linkage, &machine);
......@@ -281,7 +281,6 @@ Handle<Code> Pipeline::GenerateCode() {
"generic lowering");
SourcePositionTable::Scope pos(&source_positions,
SourcePosition::Unknown());
MachineOperatorBuilder machine(zone());
JSGenericLowering lowering(info(), &jsgraph, &machine);
GraphReducer graph_reducer(&graph);
graph_reducer.AddReducer(&lowering);
......
......@@ -15,7 +15,7 @@ RawMachineAssembler::RawMachineAssembler(Graph* graph,
MachineType word)
: GraphBuilder(graph),
schedule_(new (zone()) Schedule(zone())),
machine_(zone(), word),
machine_(word),
common_(zone()),
machine_sig_(machine_sig),
call_descriptor_(
......
......@@ -108,7 +108,8 @@ class RawMachineAssembler : public GraphBuilder {
Store(rep, base, Int32Constant(0), value);
}
void Store(MachineType rep, Node* base, Node* index, Node* value) {
NewNode(machine()->Store(rep, kNoWriteBarrier), base, index, value);
NewNode(machine()->Store(StoreRepresentation(rep, kNoWriteBarrier)), base,
index, value);
}
// Arithmetic Operations.
Node* WordAnd(Node* a, Node* b) {
......@@ -137,14 +138,14 @@ class RawMachineAssembler : public GraphBuilder {
return WordBinaryNot(WordEqual(a, b));
}
Node* WordNot(Node* a) {
if (machine()->is32()) {
if (machine()->Is32()) {
return Word32Not(a);
} else {
return Word64Not(a);
}
}
Node* WordBinaryNot(Node* a) {
if (machine()->is32()) {
if (machine()->Is32()) {
return Word32BinaryNot(a);
} else {
return Word64BinaryNot(a);
......
......@@ -590,11 +590,11 @@ class RepresentationSelector {
case IrOpcode::kLoad: {
// TODO(titzer): machine loads/stores need to know BaseTaggedness!?
MachineType tBase = kRepTagged;
MachineType machine_type = OpParameter<MachineType>(node);
LoadRepresentation rep = OpParameter<LoadRepresentation>(node);
ProcessInput(node, 0, tBase); // pointer or object
ProcessInput(node, 1, kMachInt32); // index
ProcessRemainingInputs(node, 2);
SetOutput(node, machine_type);
SetOutput(node, rep);
break;
}
case IrOpcode::kStore: {
......@@ -603,7 +603,7 @@ class RepresentationSelector {
StoreRepresentation rep = OpParameter<StoreRepresentation>(node);
ProcessInput(node, 0, tBase); // pointer or object
ProcessInput(node, 1, kMachInt32); // index
ProcessInput(node, 2, rep.machine_type);
ProcessInput(node, 2, rep.machine_type());
ProcessRemainingInputs(node, 3);
SetOutput(node, 0);
break;
......@@ -814,7 +814,7 @@ void SimplifiedLowering::DoStoreField(Node* node) {
const FieldAccess& access = FieldAccessOf(node->op());
WriteBarrierKind kind = ComputeWriteBarrierKind(
access.base_is_tagged, access.machine_type, access.type);
node->set_op(machine_.Store(access.machine_type, kind));
node->set_op(machine_.Store(StoreRepresentation(access.machine_type, kind)));
Node* offset = jsgraph()->Int32Constant(access.offset - access.tag());
node->InsertInput(zone(), 1, offset);
}
......@@ -845,7 +845,7 @@ void SimplifiedLowering::DoStoreElement(Node* node) {
const ElementAccess& access = ElementAccessOf(node->op());
WriteBarrierKind kind = ComputeWriteBarrierKind(
access.base_is_tagged, access.machine_type, access.type);
node->set_op(machine_.Store(access.machine_type, kind));
node->set_op(machine_.Store(StoreRepresentation(access.machine_type, kind)));
node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1)));
}
......
......@@ -16,8 +16,7 @@ namespace compiler {
class SimplifiedLowering {
public:
explicit SimplifiedLowering(JSGraph* jsgraph)
: jsgraph_(jsgraph), machine_(jsgraph->zone()) {}
explicit SimplifiedLowering(JSGraph* jsgraph) : jsgraph_(jsgraph) {}
virtual ~SimplifiedLowering() {}
void LowerAllNodes();
......
......@@ -22,7 +22,7 @@ class SimplifiedOperatorReducerTest : public GraphTest {
protected:
Reduction Reduce(Node* node) {
Typer typer(zone());
MachineOperatorBuilder machine(zone());
MachineOperatorBuilder machine;
JSGraph jsgraph(graph(), common(), &typer);
SimplifiedOperatorReducer reducer(&jsgraph, &machine);
return reducer.Reduce(node);
......
......@@ -7,6 +7,8 @@
#include "src/compiler/machine-operator.h"
#include "src/compiler/opcodes.h"
#include "src/compiler/operator.h"
#include "src/handles.h"
#include "src/zone.h"
namespace v8 {
......
......@@ -56,8 +56,8 @@ class X64OperandGenerator FINAL : public OperandGenerator {
void InstructionSelector::VisitLoad(Node* node) {
MachineType rep = RepresentationOf(OpParameter<MachineType>(node));
MachineType typ = TypeOf(OpParameter<MachineType>(node));
MachineType rep = RepresentationOf(OpParameter<LoadRepresentation>(node));
MachineType typ = TypeOf(OpParameter<LoadRepresentation>(node));
X64OperandGenerator g(this);
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
......@@ -111,8 +111,8 @@ void InstructionSelector::VisitStore(Node* node) {
Node* value = node->InputAt(2);
StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node);
MachineType rep = RepresentationOf(store_rep.machine_type);
if (store_rep.write_barrier_kind == kFullWriteBarrier) {
MachineType rep = RepresentationOf(store_rep.machine_type());
if (store_rep.write_barrier_kind() == kFullWriteBarrier) {
DCHECK(rep == kRepTagged);
// TODO(dcarney): refactor RecordWrite function to take temp registers
// and pass them here instead of using fixed regs
......@@ -123,7 +123,7 @@ void InstructionSelector::VisitStore(Node* node) {
temps);
return;
}
DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind);
DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind());
InstructionOperand* val;
if (g.CanBeImmediate(value)) {
val = g.UseImmediate(value);
......
......@@ -5,8 +5,8 @@
#ifndef V8_HYDROGEN_UNIQUE_H_
#define V8_HYDROGEN_UNIQUE_H_
#include "src/handles.h"
#include "src/objects.h"
#include "src/handles-inl.h" // TODO(everyone): Fix our inl.h crap
#include "src/objects-inl.h" // TODO(everyone): Fix our inl.h crap
#include "src/string-stream.h"
#include "src/utils.h"
#include "src/zone.h"
......
......@@ -61,7 +61,6 @@ class GraphAndBuilders {
explicit GraphAndBuilders(Zone* zone)
: main_graph_(new (zone) Graph(zone)),
main_common_(zone),
main_machine_(zone),
main_simplified_(zone) {}
protected:
......
......@@ -222,9 +222,10 @@ TEST(RunChangeTaggedToFloat64) {
ChangesLoweringTester<int32_t> t(kMachAnyTagged);
double result;
t.BuildStoreAndLower(t.simplified()->ChangeTaggedToFloat64(),
t.machine()->Store(kMachFloat64, kNoWriteBarrier),
&result);
t.BuildStoreAndLower(
t.simplified()->ChangeTaggedToFloat64(),
t.machine()->Store(StoreRepresentation(kMachFloat64, kNoWriteBarrier)),
&result);
if (Pipeline::SupportedTarget()) {
FOR_INT32_INPUTS(i) {
......
......@@ -32,7 +32,6 @@ class InstructionTester : public HandleAndZoneScope {
info(static_cast<HydrogenCodeStub*>(NULL), main_isolate()),
linkage(&info),
common(zone()),
machine(zone()),
code(NULL) {}
~InstructionTester() { delete code; }
......
......@@ -21,7 +21,6 @@ class JSTypedLoweringTester : public HandleAndZoneScope {
binop(NULL),
unop(NULL),
javascript(main_zone()),
machine(main_zone()),
simplified(main_zone()),
common(main_zone()),
graph(main_zone()),
......
......@@ -53,7 +53,6 @@ class ReducerTester : public HandleAndZoneScope {
: isolate(main_isolate()),
binop(NULL),
unop(NULL),
machine(main_zone()),
common(main_zone()),
graph(main_zone()),
typer(main_zone()),
......@@ -667,8 +666,9 @@ TEST(ReduceLoadStore) {
}
{
Node* store = R.graph.NewNode(R.machine.Store(kMachInt32, kNoWriteBarrier),
base, index, load);
Node* store = R.graph.NewNode(
R.machine.Store(StoreRepresentation(kMachInt32, kNoWriteBarrier)), base,
index, load);
MachineOperatorReducer reducer(&R.jsgraph);
Reduction reduction = reducer.Reduce(store);
CHECK(!reduction.Changed()); // stores should not be reduced.
......
......@@ -131,7 +131,7 @@ TEST(BuildMulNodeGraph) {
Schedule schedule(scope.main_zone());
Graph graph(scope.main_zone());
CommonOperatorBuilder common(scope.main_zone());
MachineOperatorBuilder machine(scope.main_zone());
MachineOperatorBuilder machine;
Node* start = graph.NewNode(common.Start(0));
graph.SetStart(start);
......
......@@ -1509,7 +1509,7 @@ TEST(BuildScheduleSimpleLoopWithCodeMotion) {
Graph graph(scope.main_zone());
CommonOperatorBuilder common_builder(scope.main_zone());
JSOperatorBuilder js_builder(scope.main_zone());
MachineOperatorBuilder machine_builder(scope.main_zone());
MachineOperatorBuilder machine_builder;
const Operator* op;
Handle<Object> object =
......@@ -1668,7 +1668,7 @@ TEST(FloatingDiamond2) {
HandleAndZoneScope scope;
Graph graph(scope.main_zone());
CommonOperatorBuilder common(scope.main_zone());
MachineOperatorBuilder machine(scope.main_zone());
MachineOperatorBuilder machine;
Node* start = graph.NewNode(common.Start(2));
graph.SetStart(start);
......@@ -1691,7 +1691,7 @@ TEST(FloatingDiamond3) {
HandleAndZoneScope scope;
Graph graph(scope.main_zone());
CommonOperatorBuilder common(scope.main_zone());
MachineOperatorBuilder machine(scope.main_zone());
MachineOperatorBuilder machine;
Node* start = graph.NewNode(common.Start(2));
graph.SetStart(start);
......
......@@ -1265,9 +1265,9 @@ TEST(LowerStoreField_to_store) {
StoreRepresentation rep = OpParameter<StoreRepresentation>(store);
if (machine_reps[i] & kRepTagged) {
CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind);
CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind());
}
CHECK_EQ(machine_reps[i], rep.machine_type);
CHECK_EQ(machine_reps[i], rep.machine_type());
}
}
......@@ -1312,9 +1312,9 @@ TEST(LowerStoreElement_to_store) {
StoreRepresentation rep = OpParameter<StoreRepresentation>(store);
if (machine_reps[i] & kRepTagged) {
CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind);
CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind());
}
CHECK_EQ(machine_reps[i], rep.machine_type);
CHECK_EQ(machine_reps[i], rep.machine_type());
}
}
......
......@@ -426,6 +426,7 @@
'../../src/compiler/linkage.h',
'../../src/compiler/machine-operator-reducer.cc',
'../../src/compiler/machine-operator-reducer.h',
'../../src/compiler/machine-operator.cc',
'../../src/compiler/machine-operator.h',
'../../src/compiler/machine-type.cc',
'../../src/compiler/machine-type.h',
......
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