: SmiTagging<8>::SmiValueSize();
}
- Node* Parameter(int32_t index = 0) {
- return graph()->NewNode(common()->Parameter(index), graph()->start());
- }
-
Reduction Reduce(Node* node) {
MachineOperatorBuilder machine(zone(), WordRepresentation());
JSOperatorBuilder javascript(zone());
#include "test/unittests/compiler/graph-unittest.h"
-#include <ostream> // NOLINT(readability/streams)
-
#include "src/compiler/node-properties-inl.h"
#include "test/unittests/compiler/node-test-utils.h"
Unique<HeapObject>::CreateImmovable(factory()->true_value()));
}
+
+TypedGraphTest::TypedGraphTest(int num_parameters)
+ : GraphTest(num_parameters), typer_(graph(), MaybeHandle<Context>()) {}
+
+
+TypedGraphTest::~TypedGraphTest() {}
+
+
+Node* TypedGraphTest::Parameter(Type* type, int32_t index) {
+ Node* node = GraphTest::Parameter(index);
+ NodeProperties::SetBounds(node, Bounds(type));
+ return node;
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
#include "src/compiler/common-operator.h"
#include "src/compiler/graph.h"
-#include "src/compiler/machine-operator.h"
#include "src/compiler/typer.h"
#include "test/unittests/test-utils.h"
#include "testing/gmock/include/gmock/gmock.h"
class GraphTest : public TestWithContext, public TestWithZone {
public:
- explicit GraphTest(int parameters = 1);
+ explicit GraphTest(int num_parameters = 1);
~GraphTest() OVERRIDE;
protected:
- Node* Parameter(int32_t index);
+ Node* Parameter(int32_t index = 0);
Node* Float32Constant(volatile float value);
Node* Float64Constant(volatile double value);
Node* Int32Constant(int32_t value);
class TypedGraphTest : public GraphTest {
public:
- explicit TypedGraphTest(int parameters = 1)
- : GraphTest(parameters), typer_(graph(), MaybeHandle<Context>()) {}
+ explicit TypedGraphTest(int num_parameters = 1);
+ ~TypedGraphTest() OVERRIDE;
protected:
+ Node* Parameter(int32_t index = 0) { return GraphTest::Parameter(index); }
+ Node* Parameter(Type* type, int32_t index = 0);
+
Typer* typer() { return &typer_; }
private:
return reducer.Reduce(node);
}
- Node* Parameter(Type* t, int32_t index = 0) {
- Node* n = graph()->NewNode(common()->Parameter(index), graph()->start());
- NodeProperties::SetBounds(n, Bounds(Type::None(), t));
- return n;
- }
-
Handle<JSFunction> MathFunction(const char* name) {
Handle<Object> m =
JSObject::GetProperty(isolate()->global_object(),
return reducer.Reduce(node);
}
- Node* Parameter(Type* type, int index = 0) {
- Node* node = graph()->NewNode(common()->Parameter(index), graph()->start());
- NodeProperties::SetBounds(node, Bounds(Type::None(), type));
- return node;
- }
-
Handle<JSArrayBuffer> NewArrayBuffer(void* bytes, size_t byte_length) {
Handle<JSArrayBuffer> buffer = factory()->NewJSArrayBuffer();
Runtime::SetupArrayBuffer(isolate(), buffer, true, bytes, byte_length);
public:
explicit SimplifiedOperatorReducerTest(int num_parameters = 1)
: GraphTest(num_parameters), simplified_(zone()) {}
- virtual ~SimplifiedOperatorReducerTest() {}
+ ~SimplifiedOperatorReducerTest() OVERRIDE {}
protected:
Reduction Reduce(Node* node) {
public:
explicit SimplifiedOperatorReducerTestWithParam(int num_parameters = 1)
: SimplifiedOperatorReducerTest(num_parameters) {}
- virtual ~SimplifiedOperatorReducerTestWithParam() {}
+ ~SimplifiedOperatorReducerTestWithParam() OVERRIDE {}
};