Revision: 23837
Author: [email protected]
Date: Wed Sep 10 12:23:45 2014 UTC
Log: [turbofan] Next step towards shared operators.
TEST=compiler-unittests,cctest
[email protected]
Review URL: https://codereview.chromium.org/555283004
https://code.google.com/p/v8/source/detail?r=23837
Modified:
/branches/bleeding_edge/src/compiler/ast-graph-builder.cc
/branches/bleeding_edge/src/compiler/ast-graph-builder.h
/branches/bleeding_edge/src/compiler/change-lowering.cc
/branches/bleeding_edge/src/compiler/common-operator-unittest.cc
/branches/bleeding_edge/src/compiler/common-operator.h
/branches/bleeding_edge/src/compiler/graph-builder.cc
/branches/bleeding_edge/src/compiler/graph-builder.h
/branches/bleeding_edge/src/compiler/js-context-specialization.cc
/branches/bleeding_edge/src/compiler/js-generic-lowering.cc
/branches/bleeding_edge/src/compiler/js-generic-lowering.h
/branches/bleeding_edge/src/compiler/js-graph.cc
/branches/bleeding_edge/src/compiler/js-graph.h
/branches/bleeding_edge/src/compiler/js-inlining.cc
/branches/bleeding_edge/src/compiler/js-operator.h
/branches/bleeding_edge/src/compiler/js-typed-lowering.cc
/branches/bleeding_edge/src/compiler/js-typed-lowering.h
/branches/bleeding_edge/src/compiler/machine-operator-reducer-unittest.cc
/branches/bleeding_edge/src/compiler/machine-operator-unittest.cc
/branches/bleeding_edge/src/compiler/machine-operator.h
/branches/bleeding_edge/src/compiler/raw-machine-assembler.cc
/branches/bleeding_edge/src/compiler/raw-machine-assembler.h
/branches/bleeding_edge/src/compiler/representation-change.h
/branches/bleeding_edge/src/compiler/simplified-lowering.cc
/branches/bleeding_edge/src/compiler/simplified-operator-reducer-unittest.cc
/branches/bleeding_edge/src/compiler/simplified-operator-reducer.cc
/branches/bleeding_edge/src/compiler/simplified-operator-reducer.h
/branches/bleeding_edge/src/compiler/simplified-operator.h
/branches/bleeding_edge/test/cctest/compiler/codegen-tester.h
/branches/bleeding_edge/test/cctest/compiler/graph-builder-tester.h
/branches/bleeding_edge/test/cctest/compiler/simplified-graph-builder.cc
/branches/bleeding_edge/test/cctest/compiler/simplified-graph-builder.h
/branches/bleeding_edge/test/cctest/compiler/test-changes-lowering.cc
/branches/bleeding_edge/test/cctest/compiler/test-js-typed-lowering.cc
/branches/bleeding_edge/test/cctest/compiler/test-machine-operator-reducer.cc
/branches/bleeding_edge/test/cctest/compiler/test-run-machops.cc
/branches/bleeding_edge/test/cctest/compiler/test-scheduler.cc
/branches/bleeding_edge/test/cctest/compiler/test-simplified-lowering.cc
=======================================
--- /branches/bleeding_edge/src/compiler/ast-graph-builder.cc Thu Sep 4
13:45:05 2014 UTC
+++ /branches/bleeding_edge/src/compiler/ast-graph-builder.cc Wed Sep 10
12:23:45 2014 UTC
@@ -31,7 +31,7 @@
Node* AstGraphBuilder::GetFunctionClosure() {
if (!function_closure_.is_set()) {
// Parameter -1 is special for the function closure
- Operator* op = common()->Parameter(-1);
+ const Operator* op = common()->Parameter(-1);
Node* node = NewNode(op, graph()->start());
function_closure_.set(node);
}
@@ -42,7 +42,7 @@
Node* AstGraphBuilder::GetFunctionContext() {
if (!function_context_.is_set()) {
// Parameter (arity + 1) is special for the outer context of the
function
- Operator* op = common()->Parameter(info()->num_parameters() + 1);
+ const Operator* op = common()->Parameter(info()->num_parameters() + 1);
Node* node = NewNode(op, graph()->start());
function_context_.set(node);
}
@@ -211,7 +211,7 @@
}
}
if (should_update) {
- Operator* op = common()->StateValues(count);
+ const Operator* op = common()->StateValues(count);
(*state_values) = graph()->NewNode(op, count, env_values);
}
}
@@ -224,7 +224,7 @@
UpdateStateValues(&stack_node_, parameters_count() + locals_count(),
stack_height());
- Operator* op = common()->FrameState(ast_id, combine);
+ const Operator* op = common()->FrameState(ast_id, combine);
return graph()->NewNode(op, parameters_node_, locals_node_, stack_node_,
GetContext(),
@@ -374,7 +374,7 @@
case Variable::CONTEXT:
if (hole_init) {
Node* value = jsgraph()->TheHoleConstant();
- Operator* op = javascript()->StoreContext(0, variable->index());
+ const Operator* op = javascript()->StoreContext(0,
variable->index());
NewNode(op, current_context(), value);
}
break;
@@ -406,7 +406,7 @@
case Variable::CONTEXT: {
VisitForValue(decl->fun());
Node* value = environment()->Pop();
- Operator* op = javascript()->StoreContext(0, variable->index());
+ const Operator* op = javascript()->StoreContext(0,
variable->index());
NewNode(op, current_context(), value);
break;
}
@@ -453,7 +453,7 @@
// Visit statements in the same scope, no declarations.
VisitStatements(stmt->statements());
} else {
- Operator* op = javascript()->CreateBlockContext();
+ const Operator* op = javascript()->CreateBlockContext();
Node* scope_info = jsgraph()->Constant(stmt->scope()->GetScopeInfo());
Node* context = NewNode(op, scope_info, GetFunctionClosure());
ContextScope scope(this, stmt->scope(), context);
@@ -519,7 +519,7 @@
void AstGraphBuilder::VisitWithStatement(WithStatement* stmt) {
VisitForValue(stmt->expression());
Node* value = environment()->Pop();
- Operator* op = javascript()->CreateWithContext();
+ const Operator* op = javascript()->CreateWithContext();
Node* context = NewNode(op, value, GetFunctionClosure());
ContextScope scope(this, stmt->scope(), context);
Visit(stmt->statement());
@@ -551,7 +551,7 @@
// value is still on the operand stack while the label is evaluated.
VisitForValue(clause->label());
Node* label = environment()->Pop();
- Operator* op = javascript()->StrictEqual();
+ const Operator* op = javascript()->StrictEqual();
Node* condition = NewNode(op, tag, label);
compare_switch.BeginLabel(i, condition);
@@ -806,7 +806,7 @@
Node* info = jsgraph()->Constant(shared_info);
Node* pretenure = expr->pretenure() ? jsgraph()->TrueConstant()
: jsgraph()->FalseConstant();
- Operator* op = javascript()->Runtime(Runtime::kNewClosure, 3);
+ const Operator* op = javascript()->Runtime(Runtime::kNewClosure, 3);
Node* value = NewNode(op, context, info, pretenure);
ast_context()->ProduceValue(value);
}
@@ -852,7 +852,8 @@
Node* literal_index = jsgraph()->Constant(expr->literal_index());
Node* pattern = jsgraph()->Constant(expr->pattern());
Node* flags = jsgraph()->Constant(expr->flags());
- Operator* op = javascript()->Runtime(Runtime::kMaterializeRegExpLiteral,
4);
+ const Operator* op =
+ javascript()->Runtime(Runtime::kMaterializeRegExpLiteral, 4);
Node* literal = NewNode(op, literals_array, literal_index, pattern,
flags);
ast_context()->ProduceValue(literal);
}
@@ -868,7 +869,7 @@
Node* literal_index = jsgraph()->Constant(expr->literal_index());
Node* constants = jsgraph()->Constant(expr->constant_properties());
Node* flags = jsgraph()->Constant(expr->ComputeFlags());
- Operator* op = javascript()->Runtime(Runtime::kCreateObjectLiteral, 4);
+ const Operator* op =
javascript()->Runtime(Runtime::kCreateObjectLiteral, 4);
Node* literal = NewNode(op, literals_array, literal_index, constants,
flags);
// The object is expected on the operand stack during computation of the
@@ -917,7 +918,7 @@
Node* receiver = environment()->Pop();
if (property->emit_store()) {
Node* strict = jsgraph()->Constant(SLOPPY);
- Operator* op = javascript()->Runtime(Runtime::kSetProperty, 4);
+ const Operator* op =
javascript()->Runtime(Runtime::kSetProperty, 4);
NewNode(op, receiver, key, value, strict);
}
break;
@@ -928,7 +929,7 @@
Node* value = environment()->Pop();
Node* receiver = environment()->Pop();
if (property->emit_store()) {
- Operator* op = javascript()->Runtime(Runtime::kSetPrototype, 2);
+ const Operator* op =
javascript()->Runtime(Runtime::kSetPrototype, 2);
NewNode(op, receiver, value);
}
break;
@@ -953,14 +954,14 @@
Node* getter = environment()->Pop();
Node* name = environment()->Pop();
Node* attr = jsgraph()->Constant(NONE);
- Operator* op =
+ const Operator* op =
javascript()->Runtime(Runtime::kDefineAccessorPropertyUnchecked,
5);
NewNode(op, literal, name, getter, setter, attr);
}
// Transform literals that contain functions to fast properties.
if (expr->has_function()) {
- Operator* op = javascript()->Runtime(Runtime::kToFastProperties, 1);
+ const Operator* op = javascript()->Runtime(Runtime::kToFastProperties,
1);
NewNode(op, literal);
}
@@ -978,7 +979,7 @@
Node* literal_index = jsgraph()->Constant(expr->literal_index());
Node* constants = jsgraph()->Constant(expr->constant_elements());
Node* flags = jsgraph()->Constant(expr->ComputeFlags());
- Operator* op = javascript()->Runtime(Runtime::kCreateArrayLiteral, 4);
+ const Operator* op = javascript()->Runtime(Runtime::kCreateArrayLiteral,
4);
Node* literal = NewNode(op, literals_array, literal_index, constants,
flags);
// The array and the literal index are both expected on the operand stack
@@ -1154,7 +1155,7 @@
void AstGraphBuilder::VisitThrow(Throw* expr) {
VisitForValue(expr->exception());
Node* exception = environment()->Pop();
- Operator* op = javascript()->Runtime(Runtime::kThrow, 1);
+ const Operator* op = javascript()->Runtime(Runtime::kThrow, 1);
Node* value = NewNode(op, exception);
ast_context()->ProduceValue(value);
}
@@ -1200,7 +1201,7 @@
Variable* variable = callee->AsVariableProxy()->var();
DCHECK(variable->location() == Variable::LOOKUP);
Node* name = jsgraph()->Constant(variable->name());
- Operator* op = javascript()->Runtime(Runtime::kLoadLookupSlot, 2);
+ const Operator* op = javascript()->Runtime(Runtime::kLoadLookupSlot,
2);
Node* pair = NewNode(op, current_context(), name);
callee_value = NewNode(common()->Projection(0), pair);
receiver_value = NewNode(common()->Projection(1), pair);
@@ -1260,7 +1261,7 @@
Node* receiver = environment()->Lookup(info()->scope()->receiver());
Node* strict = jsgraph()->Constant(strict_mode());
Node* position =
jsgraph()->Constant(info()->scope()->start_position());
- Operator* op =
+ const Operator* op =
javascript()->Runtime(Runtime::kResolvePossiblyDirectEval, 5);
Node* pair = NewNode(op, callee, source, receiver, strict, position);
Node* new_callee = NewNode(common()->Projection(0), pair);
@@ -1272,7 +1273,7 @@
}
// Create node to perform the function call.
- Operator* call = javascript()->Call(args->length() + 2, flags);
+ const Operator* call = javascript()->Call(args->length() + 2, flags);
Node* value = ProcessArguments(call, args->length() + 2);
PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine());
ast_context()->ProduceValue(value);
@@ -1287,7 +1288,7 @@
VisitForValues(args);
// Create node to perform the construct call.
- Operator* call = javascript()->CallNew(args->length() + 1);
+ const Operator* call = javascript()->CallNew(args->length() + 1);
Node* value = ProcessArguments(call, args->length() + 1);
PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine());
ast_context()->ProduceValue(value);
@@ -1314,7 +1315,7 @@
VisitForValues(args);
// Create node to perform the JS runtime call.
- Operator* call = javascript()->Call(args->length() + 2, flags);
+ const Operator* call = javascript()->Call(args->length() + 2, flags);
Node* value = ProcessArguments(call, args->length() + 2);
PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine());
ast_context()->ProduceValue(value);
@@ -1337,7 +1338,7 @@
// Create node to perform the runtime call.
Runtime::FunctionId functionId = function->function_id;
- Operator* call = javascript()->Runtime(functionId, args->length());
+ const Operator* call = javascript()->Runtime(functionId, args->length());
Node* value = ProcessArguments(call, args->length());
PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine());
ast_context()->ProduceValue(value);
@@ -1471,7 +1472,7 @@
void AstGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
- Operator* op;
+ const Operator* op;
switch (expr->op()) {
case Token::EQ:
op = javascript()->Equal();
@@ -1543,7 +1544,7 @@
DeclareGlobalsStrictMode::encode(strict_mode());
Node* flags = jsgraph()->Constant(encoded_flags);
Node* pairs = jsgraph()->Constant(data);
- Operator* op = javascript()->Runtime(Runtime::kDeclareGlobals, 3);
+ const Operator* op = javascript()->Runtime(Runtime::kDeclareGlobals, 3);
NewNode(op, current_context(), pairs, flags);
globals()->Rewind(0);
}
@@ -1650,7 +1651,7 @@
}
-Node* AstGraphBuilder::ProcessArguments(Operator* op, int arity) {
+Node* AstGraphBuilder::ProcessArguments(const Operator* op, int arity) {
DCHECK(environment()->stack_height() >= arity);
Node** all = info()->zone()->NewArray<Node*>(arity);
for (int i = arity - 1; i >= 0; --i) {
@@ -1667,7 +1668,7 @@
set_current_context(context);
// Allocate a new local context.
- Operator* op = javascript()->CreateFunctionContext();
+ const Operator* op = javascript()->CreateFunctionContext();
Node* local_context = NewNode(op, closure);
set_current_context(local_context);
@@ -1681,7 +1682,7 @@
Node* parameter = NewNode(common()->Parameter(i + 1),
graph()->start());
// Context variable (at bottom of the context chain).
DCHECK_EQ(0, info()->scope()->ContextChainLength(variable->scope()));
- Operator* op = javascript()->StoreContext(0, variable->index());
+ const Operator* op = javascript()->StoreContext(0, variable->index());
NewNode(op, local_context, parameter);
}
@@ -1694,7 +1695,7 @@
// Allocate and initialize a new arguments object.
Node* callee = GetFunctionClosure();
- Operator* op = javascript()->Runtime(Runtime::kNewArguments, 1);
+ const Operator* op = javascript()->Runtime(Runtime::kNewArguments, 1);
Node* object = NewNode(op, callee);
// Assign the object to the arguments variable.
@@ -1746,7 +1747,7 @@
// Global var, const, or let variable.
Node* global = BuildLoadGlobalObject();
Unique<Name> name = MakeUnique(variable->name());
- Operator* op = javascript()->LoadNamed(name, contextual_mode);
+ const Operator* op = javascript()->LoadNamed(name, contextual_mode);
Node* node = NewNode(op, global);
PrepareFrameState(node, bailout_id, kPushOutput);
return node;
@@ -1777,7 +1778,7 @@
// Context variable (potentially up the context chain).
int depth = current_scope()->ContextChainLength(variable->scope());
bool immutable = variable->maybe_assigned() == kNotAssigned;
- Operator* op =
+ const Operator* op =
javascript()->LoadContext(depth, variable->index(), immutable);
Node* value = NewNode(op, current_context());
// TODO(titzer): initialization checks are redundant for already
@@ -1800,7 +1801,7 @@
(contextual_mode == CONTEXTUAL)
? Runtime::kLoadLookupSlot
: Runtime::kLoadLookupSlotNoReferenceError;
- Operator* op = javascript()->Runtime(function_id, 2);
+ const Operator* op = javascript()->Runtime(function_id, 2);
Node* pair = NewNode(op, current_context(), name);
return NewNode(common()->Projection(0), pair);
}
@@ -1816,7 +1817,7 @@
// Global var, const, or let variable.
Node* global = BuildLoadGlobalObject();
Node* name = jsgraph()->Constant(variable->name());
- Operator* op = javascript()->DeleteProperty(strict_mode());
+ const Operator* op = javascript()->DeleteProperty(strict_mode());
return NewNode(op, global, name);
}
case Variable::PARAMETER:
@@ -1828,7 +1829,7 @@
case Variable::LOOKUP: {
// Dynamic lookup of context variable (anywhere in the chain).
Node* name = jsgraph()->Constant(variable->name());
- Operator* op = javascript()->Runtime(Runtime::kDeleteLookupSlot, 2);
+ const Operator* op =
javascript()->Runtime(Runtime::kDeleteLookupSlot, 2);
return NewNode(op, current_context(), name);
}
}
@@ -1847,7 +1848,7 @@
// Global var, const, or let variable.
Node* global = BuildLoadGlobalObject();
Unique<Name> name = MakeUnique(variable->name());
- Operator* op = javascript()->StoreNamed(strict_mode(), name);
+ const Operator* op = javascript()->StoreNamed(strict_mode(), name);
Node* store = NewNode(op, global, value);
PrepareFrameState(store, bailout_id);
return store;
@@ -1886,7 +1887,7 @@
int depth = current_scope()->ContextChainLength(variable->scope());
if (mode == CONST_LEGACY && op == Token::INIT_CONST_LEGACY) {
// Perform an initialization check for legacy const variables.
- Operator* op =
+ const Operator* op =
javascript()->LoadContext(depth, variable->index(), false);
Node* current = NewNode(op, current_context());
value = BuildHoleCheckSilent(current, value, current);
@@ -1895,7 +1896,7 @@
return value;
} else if (mode == LET && op != Token::INIT_LET) {
// Perform an initialization check for let declared variables.
- Operator* op =
+ const Operator* op =
javascript()->LoadContext(depth, variable->index(), false);
Node* current = NewNode(op, current_context());
value = BuildHoleCheckThrow(current, variable, value);
@@ -1903,7 +1904,7 @@
// All assignments to const variables are early errors.
UNREACHABLE();
}
- Operator* op = javascript()->StoreContext(depth, variable->index());
+ const Operator* op = javascript()->StoreContext(depth,
variable->index());
return NewNode(op, current_context(), value);
}
case Variable::LOOKUP: {
@@ -1912,7 +1913,7 @@
Node* strict = jsgraph()->Constant(strict_mode());
// TODO(mstarzinger): Use Runtime::kInitializeLegacyConstLookupSlot
for
// initializations of const declarations.
- Operator* op = javascript()->Runtime(Runtime::kStoreLookupSlot, 4);
+ const Operator* op =
javascript()->Runtime(Runtime::kStoreLookupSlot, 4);
return NewNode(op, value, current_context(), name, strict);
}
}
@@ -1940,7 +1941,7 @@
Node* AstGraphBuilder::BuildLoadGlobalObject() {
Node* context = GetFunctionContext();
- Operator* load_op =
+ const Operator* load_op =
javascript()->LoadContext(0, Context::GLOBAL_OBJECT_INDEX, true);
return NewNode(load_op, context);
}
@@ -1955,13 +1956,13 @@
Node* AstGraphBuilder::BuildThrowReferenceError(Variable* variable) {
// TODO(mstarzinger): Should be unified with the VisitThrow
implementation.
Node* variable_name = jsgraph()->Constant(variable->name());
- Operator* op = javascript()->Runtime(Runtime::kThrowReferenceError, 1);
+ const Operator* op =
javascript()->Runtime(Runtime::kThrowReferenceError, 1);
return NewNode(op, variable_name);
}
Node* AstGraphBuilder::BuildBinaryOp(Node* left, Node* right, Token::Value
op) {
- Operator* js_op;
+ const Operator* js_op;
switch (op) {
case Token::BIT_OR:
js_op = javascript()->BitwiseOr();
=======================================
--- /branches/bleeding_edge/src/compiler/ast-graph-builder.h Wed Sep 3
14:10:20 2014 UTC
+++ /branches/bleeding_edge/src/compiler/ast-graph-builder.h Wed Sep 10
12:23:45 2014 UTC
@@ -140,7 +140,7 @@
// Process arguments to a call by popping {arity} elements off the
operand
// stack and build a call node using the given call operator.
- Node* ProcessArguments(Operator* op, int arity);
+ Node* ProcessArguments(const Operator* op, int arity);
// Visit statements.
void VisitIfNotNull(Statement* stmt);
=======================================
--- /branches/bleeding_edge/src/compiler/change-lowering.cc Fri Sep 5
11:44:31 2014 UTC
+++ /branches/bleeding_edge/src/compiler/change-lowering.cc Wed Sep 10
12:23:45 2014 UTC
@@ -168,8 +168,9 @@
Node* branch = graph()->NewNode(common()->Branch(), tag, control);
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
- Operator* op = (signedness == kSigned) ?
machine()->ChangeFloat64ToInt32()
- :
machine()->ChangeFloat64ToUint32();
+ const Operator* op = (signedness == kSigned)
+ ? machine()->ChangeFloat64ToInt32()
+ : machine()->ChangeFloat64ToUint32();
Node* change = graph()->NewNode(op, LoadHeapNumberValue(val, if_true));
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
=======================================
--- /branches/bleeding_edge/src/compiler/common-operator-unittest.cc Thu
Sep 4 08:44:03 2014 UTC
+++ /branches/bleeding_edge/src/compiler/common-operator-unittest.cc Wed
Sep 10 12:23:45 2014 UTC
@@ -30,7 +30,7 @@
TEST_F(CommonOperatorTest, ControlEffect) {
- Operator* op = common()->ControlEffect();
+ const Operator* op = common()->ControlEffect();
EXPECT_EQ(1, OperatorProperties::GetControlInputCount(op));
EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op));
EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
@@ -41,7 +41,7 @@
TEST_F(CommonOperatorTest, ValueEffect) {
TRACED_FOREACH(int, arguments, kArguments) {
- Operator* op = common()->ValueEffect(arguments);
+ const Operator* op = common()->ValueEffect(arguments);
EXPECT_EQ(arguments, OperatorProperties::GetValueInputCount(op));
EXPECT_EQ(arguments, OperatorProperties::GetTotalInputCount(op));
EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
@@ -53,7 +53,7 @@
TEST_F(CommonOperatorTest, Finish) {
TRACED_FOREACH(int, arguments, kArguments) {
- Operator* op = common()->Finish(arguments);
+ const Operator* op = common()->Finish(arguments);
EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op));
EXPECT_EQ(arguments, OperatorProperties::GetEffectInputCount(op));
EXPECT_EQ(arguments + 1, OperatorProperties::GetTotalInputCount(op));
=======================================
--- /branches/bleeding_edge/src/compiler/common-operator.h Mon Sep 8
09:16:11 2014 UTC
+++ /branches/bleeding_edge/src/compiler/common-operator.h Wed Sep 10
12:23:45 2014 UTC
@@ -81,104 +81,105 @@
return new (zone_) ControlOperator(IrOpcode::k##name,
Operator::kFoldable, \
inputs, 0, controls, #name);
- Operator* Start(int num_formal_parameters) {
+ const Operator* Start(int num_formal_parameters) {
// Outputs are formal parameters, plus context, receiver, and
JSFunction.
int outputs = num_formal_parameters + 3;
return new (zone_) ControlOperator(IrOpcode::kStart,
Operator::kFoldable, 0,
outputs, 0, "Start");
}
- Operator* Dead() { CONTROL_OP(Dead, 0, 0); }
- Operator* End() { CONTROL_OP(End, 0, 1); }
- Operator* Branch() { CONTROL_OP(Branch, 1, 1); }
- Operator* IfTrue() { CONTROL_OP(IfTrue, 0, 1); }
- Operator* IfFalse() { CONTROL_OP(IfFalse, 0, 1); }
- Operator* Throw() { CONTROL_OP(Throw, 1, 1); }
+ const Operator* Dead() { CONTROL_OP(Dead, 0, 0); }
+ const Operator* End() { CONTROL_OP(End, 0, 1); }
+ const Operator* Branch() { CONTROL_OP(Branch, 1, 1); }
+ const Operator* IfTrue() { CONTROL_OP(IfTrue, 0, 1); }
+ const Operator* IfFalse() { CONTROL_OP(IfFalse, 0, 1); }
+ const Operator* Throw() { CONTROL_OP(Throw, 1, 1); }
- Operator* Return() {
+ const Operator* Return() {
return new (zone_) ControlOperator(
IrOpcode::kReturn, Operator::kNoProperties, 1, 0, 1, "Return");
}
- Operator* Merge(int controls) {
+ const Operator* Merge(int controls) {
return new (zone_) ControlOperator(IrOpcode::kMerge,
Operator::kFoldable, 0,
0, controls, "Merge");
}
- Operator* Loop(int controls) {
+ const Operator* Loop(int controls) {
return new (zone_) ControlOperator(IrOpcode::kLoop,
Operator::kFoldable, 0,
0, controls, "Loop");
}
- Operator* Parameter(int index) {
+ const Operator* Parameter(int index) {
return new (zone_) Operator1<int>(IrOpcode::kParameter,
Operator::kPure, 1,
1, "Parameter", index);
}
- Operator* Int32Constant(int32_t value) {
+ const Operator* Int32Constant(int32_t value) {
return new (zone_)
Operator1<int32_t>(IrOpcode::kInt32Constant, Operator::kPure, 0, 1,
"Int32Constant", value);
}
- Operator* Int64Constant(int64_t value) {
+ const Operator* Int64Constant(int64_t value) {
return new (zone_)
Operator1<int64_t>(IrOpcode::kInt64Constant, Operator::kPure, 0, 1,
"Int64Constant", value);
}
- Operator* Float64Constant(double value) {
+ const Operator* Float64Constant(double value) {
return new (zone_)
Operator1<double>(IrOpcode::kFloat64Constant, Operator::kPure, 0,
1,
"Float64Constant", value);
}
- Operator* ExternalConstant(ExternalReference value) {
+ const Operator* ExternalConstant(ExternalReference value) {
return new (zone_)
Operator1<ExternalReference>(IrOpcode::kExternalConstant,
Operator::kPure, 0, 1,
"ExternalConstant",
value);
}
- Operator* NumberConstant(double value) {
+ const Operator* NumberConstant(double value) {
return new (zone_)
Operator1<double>(IrOpcode::kNumberConstant, Operator::kPure, 0, 1,
"NumberConstant", value);
}
- Operator* HeapConstant(Unique<Object> value) {
+ const Operator* HeapConstant(Unique<Object> value) {
return new (zone_) Operator1<Unique<Object> >(
IrOpcode::kHeapConstant, Operator::kPure, 0, 1, "HeapConstant",
value);
}
- Operator* Phi(MachineType type, int arguments) {
+ const Operator* Phi(MachineType type, int arguments) {
DCHECK(arguments > 0); // Disallow empty phis.
return new (zone_) Operator1<MachineType>(IrOpcode::kPhi,
Operator::kPure,
arguments, 1, "Phi", type);
}
- Operator* EffectPhi(int arguments) {
+ const Operator* EffectPhi(int arguments) {
DCHECK(arguments > 0); // Disallow empty phis.
return new (zone_) Operator1<int>(IrOpcode::kEffectPhi,
Operator::kPure, 0,
0, "EffectPhi", arguments);
}
- Operator* ControlEffect() {
+ const Operator* ControlEffect() {
return new (zone_) SimpleOperator(IrOpcode::kControlEffect,
Operator::kPure,
0, 0, "ControlEffect");
}
- Operator* ValueEffect(int arguments) {
+ const Operator* ValueEffect(int arguments) {
DCHECK(arguments > 0); // Disallow empty value effects.
return new (zone_) SimpleOperator(IrOpcode::kValueEffect,
Operator::kPure,
arguments, 0, "ValueEffect");
}
- Operator* Finish(int arguments) {
+ const Operator* Finish(int arguments) {
DCHECK(arguments > 0); // Disallow empty finishes.
return new (zone_) Operator1<int>(IrOpcode::kFinish, Operator::kPure,
1, 1,
"Finish", arguments);
}
- Operator* StateValues(int arguments) {
+ const Operator* StateValues(int arguments) {
return new (zone_) Operator1<int>(IrOpcode::kStateValues,
Operator::kPure,
arguments, 1, "StateValues",
arguments);
}
- Operator* FrameState(BailoutId bailout_id, OutputFrameStateCombine
combine) {
+ const Operator* FrameState(BailoutId bailout_id,
+ OutputFrameStateCombine combine) {
return new (zone_) Operator1<FrameStateCallInfo>(
IrOpcode::kFrameState, Operator::kPure, 4, 1, "FrameState",
FrameStateCallInfo(bailout_id, combine));
}
- Operator* Call(CallDescriptor* descriptor) {
+ const Operator* Call(CallDescriptor* descriptor) {
return new (zone_) CallOperator(descriptor, "Call");
}
- Operator* Projection(size_t index) {
+ const Operator* Projection(size_t index) {
return new (zone_) Operator1<size_t>(IrOpcode::kProjection,
Operator::kPure,
1, 1, "Projection", index);
}
=======================================
--- /branches/bleeding_edge/src/compiler/graph-builder.cc Fri Sep 5
11:44:31 2014 UTC
+++ /branches/bleeding_edge/src/compiler/graph-builder.cc Wed Sep 10
12:23:45 2014 UTC
@@ -28,7 +28,8 @@
exit_control_(NULL) {}
-Node* StructuredGraphBuilder::MakeNode(Operator* op, int value_input_count,
+Node* StructuredGraphBuilder::MakeNode(const Operator* op,
+ int value_input_count,
Node** value_inputs) {
DCHECK(op->InputCount() == value_input_count);
@@ -161,7 +162,7 @@
Node* StructuredGraphBuilder::NewPhi(int count, Node* input, Node*
control) {
- Operator* phi_op = common()->Phi(kMachAnyTagged, count);
+ const Operator* phi_op = common()->Phi(kMachAnyTagged, count);
Node** buffer = zone()->NewArray<Node*>(count + 1);
MemsetPointer(buffer, input, count);
buffer[count] = control;
@@ -172,7 +173,7 @@
// TODO(mstarzinger): Revisit this once we have proper effect states.
Node* StructuredGraphBuilder::NewEffectPhi(int count, Node* input,
Node* control) {
- Operator* phi_op = common()->EffectPhi(count);
+ const Operator* phi_op = common()->EffectPhi(count);
Node** buffer = zone()->NewArray<Node*>(count + 1);
MemsetPointer(buffer, input, count);
buffer[count] = control;
@@ -184,17 +185,17 @@
int inputs = OperatorProperties::GetControlInputCount(control->op()) + 1;
if (control->opcode() == IrOpcode::kLoop) {
// Control node for loop exists, add input.
- Operator* op = common()->Loop(inputs);
+ const Operator* op = common()->Loop(inputs);
control->AppendInput(zone(), other);
control->set_op(op);
} else if (control->opcode() == IrOpcode::kMerge) {
// Control node for merge exists, add input.
- Operator* op = common()->Merge(inputs);
+ const Operator* op = common()->Merge(inputs);
control->AppendInput(zone(), other);
control->set_op(op);
} else {
// Control node is a singleton, introduce a merge.
- Operator* op = common()->Merge(inputs);
+ const Operator* op = common()->Merge(inputs);
control = graph()->NewNode(op, control, other);
}
return control;
=======================================
--- /branches/bleeding_edge/src/compiler/graph-builder.h Thu Sep 4
13:45:05 2014 UTC
+++ /branches/bleeding_edge/src/compiler/graph-builder.h Wed Sep 10
12:23:45 2014 UTC
@@ -24,40 +24,41 @@
explicit GraphBuilder(Graph* graph) : graph_(graph) {}
virtual ~GraphBuilder() {}
- Node* NewNode(Operator* op) {
+ Node* NewNode(const Operator* op) {
return MakeNode(op, 0, static_cast<Node**>(NULL));
}
- Node* NewNode(Operator* op, Node* n1) { return MakeNode(op, 1, &n1); }
+ Node* NewNode(const Operator* op, Node* n1) { return MakeNode(op, 1,
&n1); }
- Node* NewNode(Operator* op, Node* n1, Node* n2) {
+ Node* NewNode(const Operator* op, Node* n1, Node* n2) {
Node* buffer[] = {n1, n2};
return MakeNode(op, arraysize(buffer), buffer);
}
- Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3) {
+ Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3) {
Node* buffer[] = {n1, n2, n3};
return MakeNode(op, arraysize(buffer), buffer);
}
- Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4) {
+ Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node*
n4) {
Node* buffer[] = {n1, n2, n3, n4};
return MakeNode(op, arraysize(buffer), buffer);
}
- Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4,
+ Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4,
Node* n5) {
Node* buffer[] = {n1, n2, n3, n4, n5};
return MakeNode(op, arraysize(buffer), buffer);
}
- Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4,
Node* n5,
- Node* n6) {
+ Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4,
+ Node* n5, Node* n6) {
Node* nodes[] = {n1, n2, n3, n4, n5, n6};
return MakeNode(op, arraysize(nodes), nodes);
}
- Node* NewNode(Operator* op, int value_input_count, Node** value_inputs) {
+ Node* NewNode(const Operator* op, int value_input_count,
+ Node** value_inputs) {
return MakeNode(op, value_input_count, value_inputs);
}
@@ -65,7 +66,7 @@
protected:
// Base implementation used by all factory methods.
- virtual Node* MakeNode(Operator* op, int value_input_count,
+ virtual Node* MakeNode(const Operator* op, int value_input_count,
Node** value_inputs) = 0;
private:
@@ -107,8 +108,8 @@
// The following method creates a new node having the specified operator
and
// ensures effect and control dependencies are wired up. The dependencies
// tracked by the environment might be mutated.
- virtual Node* MakeNode(Operator* op, int value_input_count,
- Node** value_inputs);
+ virtual Node* MakeNode(const Operator* op, int value_input_count,
+ Node** value_inputs) FINAL;
Environment* environment() const { return environment_; }
void set_environment(Environment* env) { environment_ = env; }
=======================================
--- /branches/bleeding_edge/src/compiler/js-context-specialization.cc Mon
Sep 8 09:16:11 2014 UTC
+++ /branches/bleeding_edge/src/compiler/js-context-specialization.cc Wed
Sep 10 12:23:45 2014 UTC
@@ -81,8 +81,8 @@
if (access.depth() == 0) {
return Reducer::NoChange();
}
- Operator* op = jsgraph_->javascript()->LoadContext(0, access.index(),
- access.immutable());
+ const Operator* op = jsgraph_->javascript()->LoadContext(
+ 0, access.index(), access.immutable());
node->set_op(op);
Handle<Object> context_handle = Handle<Object>(context,
info_->isolate());
node->ReplaceInput(0, jsgraph_->Constant(context_handle));
@@ -128,13 +128,14 @@
context = context->previous();
}
- Operator* op = jsgraph_->javascript()->StoreContext(0, access.index());
+ const Operator* op = jsgraph_->javascript()->StoreContext(0,
access.index());
node->set_op(op);
Handle<Object> new_context_handle = Handle<Object>(context,
info_->isolate());
node->ReplaceInput(0, jsgraph_->Constant(new_context_handle));
return Reducer::Changed(node);
}
-}
-}
-} // namespace v8::internal::compiler
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
=======================================
--- /branches/bleeding_edge/src/compiler/js-generic-lowering.cc Mon Sep 8
15:18:54 2014 UTC
+++ /branches/bleeding_edge/src/compiler/js-generic-lowering.cc Wed Sep 10
12:23:45 2014 UTC
@@ -120,7 +120,7 @@
machine_(machine) {}
-void JSGenericLowering::PatchOperator(Node* node, Operator* op) {
+void JSGenericLowering::PatchOperator(Node* node, const Operator* op) {
node->set_op(op);
}
=======================================
--- /branches/bleeding_edge/src/compiler/js-generic-lowering.h Fri Aug 29
05:00:55 2014 UTC
+++ /branches/bleeding_edge/src/compiler/js-generic-lowering.h Wed Sep 10
12:23:45 2014 UTC
@@ -50,7 +50,7 @@
Node* ExternalConstant(ExternalReference ref);
// Helpers to patch existing nodes in the graph.
- void PatchOperator(Node* node, Operator* new_op);
+ void PatchOperator(Node* node, const Operator* new_op);
void PatchInsertInput(Node* node, int index, Node* input);
// Helpers to replace existing nodes with a generic call.
=======================================
--- /branches/bleeding_edge/src/compiler/js-graph.cc Mon Sep 8 09:11:11
2014 UTC
+++ /branches/bleeding_edge/src/compiler/js-graph.cc Wed Sep 10 12:23:45
2014 UTC
@@ -16,7 +16,7 @@
}
-Node* JSGraph::NewNode(Operator* op) {
+Node* JSGraph::NewNode(const Operator* op) {
Node* node = graph()->NewNode(op);
typer_->Init(node);
return node;
=======================================
--- /branches/bleeding_edge/src/compiler/js-graph.h Wed Sep 10 06:39:25
2014 UTC
+++ /branches/bleeding_edge/src/compiler/js-graph.h Wed Sep 10 12:23:45
2014 UTC
@@ -99,7 +99,7 @@
Node* ImmovableHeapConstant(Handle<Object> value);
Node* NumberConstant(double value);
- Node* NewNode(Operator* op);
+ Node* NewNode(const Operator* op);
Factory* factory() { return isolate()->factory(); }
};
=======================================
--- /branches/bleeding_edge/src/compiler/js-inlining.cc Wed Sep 10 09:48:03
2014 UTC
+++ /branches/bleeding_edge/src/compiler/js-inlining.cc Wed Sep 10 12:23:45
2014 UTC
@@ -121,8 +121,9 @@
int predecessors =
OperatorProperties::GetControlInputCount(final_merge->op());
- Operator* op_phi = jsgraph_->common()->Phi(kMachAnyTagged, predecessors);
- Operator* op_ephi = jsgraph_->common()->EffectPhi(predecessors);
+ const Operator* op_phi =
+ jsgraph_->common()->Phi(kMachAnyTagged, predecessors);
+ const Operator* op_ephi = jsgraph_->common()->EffectPhi(predecessors);
NodeVector values(jsgraph_->zone());
NodeVector effects(jsgraph_->zone());
=======================================
--- /branches/bleeding_edge/src/compiler/js-operator.h Tue Sep 9 14:48:16
2014 UTC
+++ /branches/bleeding_edge/src/compiler/js-operator.h Wed Sep 10 12:23:45
2014 UTC
@@ -81,100 +81,106 @@
#define PURE_BINOP(name) SIMPLE(name, Operator::kPure, 2, 1)
- Operator* Equal() { BINOP(JSEqual); }
- Operator* NotEqual() { BINOP(JSNotEqual); }
- Operator* StrictEqual() { PURE_BINOP(JSStrictEqual); }
- Operator* StrictNotEqual() { PURE_BINOP(JSStrictNotEqual); }
- Operator* LessThan() { BINOP(JSLessThan); }
- Operator* GreaterThan() { BINOP(JSGreaterThan); }
- Operator* LessThanOrEqual() { BINOP(JSLessThanOrEqual); }
- Operator* GreaterThanOrEqual() { BINOP(JSGreaterThanOrEqual); }
- Operator* BitwiseOr() { BINOP(JSBitwiseOr); }
- Operator* BitwiseXor() { BINOP(JSBitwiseXor); }
- Operator* BitwiseAnd() { BINOP(JSBitwiseAnd); }
- Operator* ShiftLeft() { BINOP(JSShiftLeft); }
- Operator* ShiftRight() { BINOP(JSShiftRight); }
- Operator* ShiftRightLogical() { BINOP(JSShiftRightLogical); }
- Operator* Add() { BINOP(JSAdd); }
- Operator* Subtract() { BINOP(JSSubtract); }
- Operator* Multiply() { BINOP(JSMultiply); }
- Operator* Divide() { BINOP(JSDivide); }
- Operator* Modulus() { BINOP(JSModulus); }
+ const Operator* Equal() { BINOP(JSEqual); }
+ const Operator* NotEqual() { BINOP(JSNotEqual); }
+ const Operator* StrictEqual() { PURE_BINOP(JSStrictEqual); }
+ const Operator* StrictNotEqual() { PURE_BINOP(JSStrictNotEqual); }
+ const Operator* LessThan() { BINOP(JSLessThan); }
+ const Operator* GreaterThan() { BINOP(JSGreaterThan); }
+ const Operator* LessThanOrEqual() { BINOP(JSLessThanOrEqual); }
+ const Operator* GreaterThanOrEqual() { BINOP(JSGreaterThanOrEqual); }
+ const Operator* BitwiseOr() { BINOP(JSBitwiseOr); }
+ const Operator* BitwiseXor() { BINOP(JSBitwiseXor); }
+ const Operator* BitwiseAnd() { BINOP(JSBitwiseAnd); }
+ const Operator* ShiftLeft() { BINOP(JSShiftLeft); }
+ const Operator* ShiftRight() { BINOP(JSShiftRight); }
+ const Operator* ShiftRightLogical() { BINOP(JSShiftRightLogical); }
+ const Operator* Add() { BINOP(JSAdd); }
+ const Operator* Subtract() { BINOP(JSSubtract); }
+ const Operator* Multiply() { BINOP(JSMultiply); }
+ const Operator* Divide() { BINOP(JSDivide); }
+ const Operator* Modulus() { BINOP(JSModulus); }
- Operator* UnaryNot() { UNOP(JSUnaryNot); }
- Operator* ToBoolean() { UNOP(JSToBoolean); }
- Operator* ToNumber() { UNOP(JSToNumber); }
- Operator* ToString() { UNOP(JSToString); }
- Operator* ToName() { UNOP(JSToName); }
- Operator* ToObject() { UNOP(JSToObject); }
- Operator* Yield() { UNOP(JSYield); }
+ const Operator* UnaryNot() { UNOP(JSUnaryNot); }
+ const Operator* ToBoolean() { UNOP(JSToBoolean); }
+ const Operator* ToNumber() { UNOP(JSToNumber); }
+ const Operator* ToString() { UNOP(JSToString); }
+ const Operator* ToName() { UNOP(JSToName); }
+ const Operator* ToObject() { UNOP(JSToObject); }
+ const Operator* Yield() { UNOP(JSYield); }
- Operator* Create() { SIMPLE(JSCreate, Operator::kEliminatable, 0, 1); }
+ const Operator* Create() { SIMPLE(JSCreate, Operator::kEliminatable, 0,
1); }
- Operator* Call(int arguments, CallFunctionFlags flags) {
+ const Operator* Call(int arguments, CallFunctionFlags flags) {
CallParameters parameters = {arguments, flags};
OP1(JSCallFunction, CallParameters, parameters,
Operator::kNoProperties,
arguments, 1);
}
- Operator* CallNew(int arguments) {
+ const Operator* CallNew(int arguments) {
return new (zone_)
Operator1<int>(IrOpcode::kJSCallConstruct, Operator::kNoProperties,
arguments, 1, "JSCallConstruct", arguments);
}
- Operator* LoadProperty() { BINOP(JSLoadProperty); }
- Operator* LoadNamed(Unique<Name> name,
- ContextualMode contextual_mode = NOT_CONTEXTUAL) {
+ const Operator* LoadProperty() { BINOP(JSLoadProperty); }
+ const Operator* LoadNamed(Unique<Name> name,
+ ContextualMode contextual_mode =
NOT_CONTEXTUAL) {
LoadNamedParameters parameters = {name, contextual_mode};
OP1(JSLoadNamed, LoadNamedParameters, parameters,
Operator::kNoProperties,
1, 1);
}
- Operator* StoreProperty(StrictMode strict_mode) {
+ const Operator* StoreProperty(StrictMode strict_mode) {
OP1(JSStoreProperty, StrictMode, strict_mode, Operator::kNoProperties,
3,
0);
}
- Operator* StoreNamed(StrictMode strict_mode, Unique<Name> name) {
+ const Operator* StoreNamed(StrictMode strict_mode, Unique<Name> name) {
StoreNamedParameters parameters = {strict_mode, name};
OP1(JSStoreNamed, StoreNamedParameters, parameters,
Operator::kNoProperties,
2, 0);
}
- Operator* DeleteProperty(StrictMode strict_mode) {
+ const Operator* DeleteProperty(StrictMode strict_mode) {
OP1(JSDeleteProperty, StrictMode, strict_mode,
Operator::kNoProperties, 2,
1);
}
- Operator* HasProperty() { NOPROPS(JSHasProperty, 2, 1); }
+ const Operator* HasProperty() { NOPROPS(JSHasProperty, 2, 1); }
- Operator* LoadContext(uint16_t depth, uint32_t index, bool immutable) {
+ const Operator* LoadContext(uint16_t depth, uint32_t index, bool
immutable) {
ContextAccess access(depth, index, immutable);
OP1(JSLoadContext, ContextAccess, access,
Operator::kEliminatable | Operator::kNoWrite, 1, 1);
}
- Operator* StoreContext(uint16_t depth, uint32_t index) {
+ const Operator* StoreContext(uint16_t depth, uint32_t index) {
ContextAccess access(depth, index, false);
OP1(JSStoreContext, ContextAccess, access, Operator::kNoProperties, 2,
0);
}
- Operator* TypeOf() { SIMPLE(JSTypeOf, Operator::kPure, 1, 1); }
- Operator* InstanceOf() { NOPROPS(JSInstanceOf, 2, 1); }
- Operator* Debugger() { NOPROPS(JSDebugger, 0, 0); }
+ const Operator* TypeOf() { SIMPLE(JSTypeOf, Operator::kPure, 1, 1); }
+ const Operator* InstanceOf() { NOPROPS(JSInstanceOf, 2, 1); }
+ const Operator* Debugger() { NOPROPS(JSDebugger, 0, 0); }
// TODO(titzer): nail down the static parts of each of these context
flavors.
- Operator* CreateFunctionContext() { NOPROPS(JSCreateFunctionContext, 1,
1); }
- Operator* CreateCatchContext(Unique<String> name) {
+ const Operator* CreateFunctionContext() {
+ NOPROPS(JSCreateFunctionContext, 1, 1);
+ }
+ const Operator* CreateCatchContext(Unique<String> name) {
OP1(JSCreateCatchContext, Unique<String>, name,
Operator::kNoProperties, 1,
1);
}
- Operator* CreateWithContext() { NOPROPS(JSCreateWithContext, 2, 1); }
- Operator* CreateBlockContext() { NOPROPS(JSCreateBlockContext, 2, 1); }
- Operator* CreateModuleContext() { NOPROPS(JSCreateModuleContext, 2, 1); }
- Operator* CreateGlobalContext() { NOPROPS(JSCreateGlobalContext, 2, 1); }
+ const Operator* CreateWithContext() { NOPROPS(JSCreateWithContext, 2,
1); }
+ const Operator* CreateBlockContext() { NOPROPS(JSCreateBlockContext, 2,
1); }
+ const Operator* CreateModuleContext() {
+ NOPROPS(JSCreateModuleContext, 2, 1);
+ }
+ const Operator* CreateGlobalContext() {
+ NOPROPS(JSCreateGlobalContext, 2, 1);
+ }
- Operator* Runtime(Runtime::FunctionId function, int arguments) {
+ const Operator* Runtime(Runtime::FunctionId function, int arguments) {
const Runtime::Function* f = Runtime::FunctionForId(function);
DCHECK(f->nargs == -1 || f->nargs == arguments);
OP1(JSCallRuntime, Runtime::FunctionId, function,
Operator::kNoProperties,
@@ -219,8 +225,9 @@
return a == b;
}
};
-}
-}
-} // namespace v8::internal::compiler
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
#endif // V8_COMPILER_JS_OPERATOR_H_
=======================================
--- /branches/bleeding_edge/src/compiler/js-typed-lowering.cc Wed Sep 3
11:35:19 2014 UTC
+++ /branches/bleeding_edge/src/compiler/js-typed-lowering.cc Wed Sep 10
12:23:45 2014 UTC
@@ -79,7 +79,7 @@
// Remove all effect and control inputs and outputs to this node and
change
// to the pure operator {op}, possibly inserting a boolean inversion.
- Reduction ChangeToPureOperator(Operator* op, bool invert = false) {
+ Reduction ChangeToPureOperator(const Operator* op, bool invert = false) {
DCHECK_EQ(0, OperatorProperties::GetEffectInputCount(op));
DCHECK_EQ(false, OperatorProperties::HasContextInput(op));
DCHECK_EQ(0, OperatorProperties::GetControlInputCount(op));
@@ -205,8 +205,8 @@
if (input_type->Is(type)) return node; // already in the value range.
- Operator* op = is_signed ? simplified()->NumberToInt32()
- : simplified()->NumberToUint32();
+ const Operator* op = is_signed ? simplified()->NumberToInt32()
+ : simplified()->NumberToUint32();
Node* n = graph()->NewNode(op, node);
return n;
}
@@ -231,7 +231,8 @@
}
-Reduction JSTypedLowering::ReduceNumberBinop(Node* node, Operator*
numberOp) {
+Reduction JSTypedLowering::ReduceNumberBinop(Node* node,
+ const Operator* numberOp) {
JSBinopReduction r(this, node);
if (r.OneInputIs(Type::Primitive())) {
// If at least one input is a primitive, then insert appropriate
conversions
@@ -246,7 +247,8 @@
Reduction JSTypedLowering::ReduceI32Binop(Node* node, bool left_signed,
- bool right_signed, Operator*
intOp) {
+ bool right_signed,
+ const Operator* intOp) {
JSBinopReduction r(this, node);
// TODO(titzer): some Smi bitwise operations don't really require going
// all the way to int32, which can save tagging/untagging for some
operations
@@ -258,7 +260,7 @@
Reduction JSTypedLowering::ReduceI32Shift(Node* node, bool left_signed,
- Operator* shift_op) {
+ const Operator* shift_op) {
JSBinopReduction r(this, node);
r.ConvertInputsForShift(left_signed);
return r.ChangeToPureOperator(shift_op);
@@ -269,7 +271,7 @@
JSBinopReduction r(this, node);
if (r.BothInputsAre(Type::String())) {
// If both inputs are definitely strings, perform a string comparison.
- Operator* stringOp;
+ const Operator* stringOp;
switch (node->opcode()) {
case IrOpcode::kJSLessThan:
stringOp = simplified()->StringLessThan();
@@ -291,8 +293,8 @@
return r.ChangeToPureOperator(stringOp);
} else if (r.OneInputCannotBe(Type::String())) {
// If one input cannot be a string, then emit a number comparison.
- Operator* less_than;
- Operator* less_than_or_equal;
+ const Operator* less_than;
+ const Operator* less_than_or_equal;
if (r.BothInputsAre(Type::Unsigned32())) {
less_than = machine()->Uint32LessThan();
less_than_or_equal = machine()->Uint32LessThanOrEqual();
@@ -305,7 +307,7 @@
less_than = simplified()->NumberLessThan();
less_than_or_equal = simplified()->NumberLessThanOrEqual();
}
- Operator* comparison;
+ const Operator* comparison;
switch (node->opcode()) {
case IrOpcode::kJSLessThan:
comparison = less_than;
=======================================
--- /branches/bleeding_edge/src/compiler/js-typed-lowering.h Thu Aug 28
14:35:11 2014 UTC
+++ /branches/bleeding_edge/src/compiler/js-typed-lowering.h Wed Sep 10
12:23:45 2014 UTC
@@ -45,10 +45,11 @@
Reduction ReduceJSToNumberInput(Node* input);
Reduction ReduceJSToStringInput(Node* input);
Reduction ReduceJSToBooleanInput(Node* input);
- Reduction ReduceNumberBinop(Node* node, Operator* numberOp);
+ Reduction ReduceNumberBinop(Node* node, const Operator* numberOp);
Reduction ReduceI32Binop(Node* node, bool left_signed, bool right_signed,
- Operator* intOp);
- Reduction ReduceI32Shift(Node* node, bool left_signed, Operator*
shift_op);
+ const Operator* intOp);
+ Reduction ReduceI32Shift(Node* node, bool left_signed,
+ const Operator* shift_op);
JSOperatorBuilder* javascript() { return jsgraph_->javascript(); }
CommonOperatorBuilder* common() { return jsgraph_->common(); }
=======================================
---
/branches/bleeding_edge/src/compiler/machine-operator-reducer-unittest.cc
Wed Sep 10 06:39:25 2014 UTC
+++
/branches/bleeding_edge/src/compiler/machine-operator-reducer-unittest.cc
Wed Sep 10 12:23:45 2014 UTC
@@ -164,7 +164,7 @@
namespace {
struct UnaryOperator {
- Operator* (MachineOperatorBuilder::*constructor)();
+ const Operator* (MachineOperatorBuilder::*constructor)();
const char* constructor_name;
};
=======================================
--- /branches/bleeding_edge/src/compiler/machine-operator-unittest.cc Thu
Sep 4 08:44:03 2014 UTC
+++ /branches/bleeding_edge/src/compiler/machine-operator-unittest.cc Wed
Sep 10 12:23:45 2014 UTC
@@ -39,7 +39,7 @@
TEST_P(MachineOperatorCommonTest, ChangeInt32ToInt64) {
- Operator* op = machine()->ChangeInt32ToInt64();
+ const Operator* op = machine()->ChangeInt32ToInt64();
EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op));
EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op));
EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
@@ -49,7 +49,7 @@
TEST_P(MachineOperatorCommonTest, ChangeUint32ToUint64) {
- Operator* op = machine()->ChangeUint32ToUint64();
+ const Operator* op = machine()->ChangeUint32ToUint64();
EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op));
EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op));
EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
@@ -59,7 +59,7 @@
TEST_P(MachineOperatorCommonTest, TruncateFloat64ToInt32) {
- Operator* op = machine()->TruncateFloat64ToInt32();
+ const Operator* op = machine()->TruncateFloat64ToInt32();
EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op));
EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op));
EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
@@ -69,7 +69,7 @@
TEST_P(MachineOperatorCommonTest, TruncateInt64ToInt32) {
- Operator* op = machine()->TruncateInt64ToInt32();
+ const Operator* op = machine()->TruncateInt64ToInt32();
EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op));
EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op));
EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
=======================================
--- /branches/bleeding_edge/src/compiler/machine-operator.h Thu Sep 4
11:13:35 2014 UTC
+++ /branches/bleeding_edge/src/compiler/machine-operator.h Wed Sep 10
12:23:45 2014 UTC
@@ -73,101 +73,101 @@
#define WORD_SIZE(x) return is64() ? Word64##x() : Word32##x()
#define INT_SIZE(x) return is64() ? Int64##x() : Int32##x()
- Operator* Load(MachineType rep) { // load [base + index]
+ const Operator* Load(MachineType rep) { // load [base + index]
OP1(Load, MachineType, rep, Operator::kNoWrite, 2, 1);
}
// store [base + index], value
- Operator* Store(MachineType rep, WriteBarrierKind kind) {
+ const Operator* Store(MachineType rep, WriteBarrierKind kind) {
StoreRepresentation store_rep = {rep, kind};
OP1(Store, StoreRepresentation, store_rep, Operator::kNoRead, 3, 0);
}
- Operator* WordAnd() { WORD_SIZE(And); }
- Operator* WordOr() { WORD_SIZE(Or); }
- Operator* WordXor() { WORD_SIZE(Xor); }
- Operator* WordShl() { WORD_SIZE(Shl); }
- Operator* WordShr() { WORD_SIZE(Shr); }
- Operator* WordSar() { WORD_SIZE(Sar); }
- Operator* WordRor() { WORD_SIZE(Ror); }
- Operator* WordEqual() { WORD_SIZE(Equal); }
+ const Operator* WordAnd() { WORD_SIZE(And); }
+ const Operator* WordOr() { WORD_SIZE(Or); }
+ const Operator* WordXor() { WORD_SIZE(Xor); }
+ const Operator* WordShl() { WORD_SIZE(Shl); }
+ const Operator* WordShr() { WORD_SIZE(Shr); }
+ const Operator* WordSar() { WORD_SIZE(Sar); }
+ const Operator* WordRor() { WORD_SIZE(Ror); }
+ const Operator* WordEqual() { WORD_SIZE(Equal); }
- Operator* Word32And() { BINOP_AC(Word32And); }
- Operator* Word32Or() { BINOP_AC(Word32Or); }
- Operator* Word32Xor() { BINOP_AC(Word32Xor); }
- Operator* Word32Shl() { BINOP(Word32Shl); }
- Operator* Word32Shr() { BINOP(Word32Shr); }
- Operator* Word32Sar() { BINOP(Word32Sar); }
- Operator* Word32Ror() { BINOP(Word32Ror); }
- Operator* Word32Equal() { BINOP_C(Word32Equal); }
+ const Operator* Word32And() { BINOP_AC(Word32And); }
+ const Operator* Word32Or() { BINOP_AC(Word32Or); }
+ const Operator* Word32Xor() { BINOP_AC(Word32Xor); }
+ const Operator* Word32Shl() { BINOP(Word32Shl); }
+ const Operator* Word32Shr() { BINOP(Word32Shr); }
+ const Operator* Word32Sar() { BINOP(Word32Sar); }
+ const Operator* Word32Ror() { BINOP(Word32Ror); }
+ const Operator* Word32Equal() { BINOP_C(Word32Equal); }
- Operator* Word64And() { BINOP_AC(Word64And); }
- Operator* Word64Or() { BINOP_AC(Word64Or); }
- Operator* Word64Xor() { BINOP_AC(Word64Xor); }
- Operator* Word64Shl() { BINOP(Word64Shl); }
- Operator* Word64Shr() { BINOP(Word64Shr); }
- Operator* Word64Sar() { BINOP(Word64Sar); }
- Operator* Word64Ror() { BINOP(Word64Ror); }
- Operator* Word64Equal() { BINOP_C(Word64Equal); }
+ const Operator* Word64And() { BINOP_AC(Word64And); }
+ const Operator* Word64Or() { BINOP_AC(Word64Or); }
+ const Operator* Word64Xor() { BINOP_AC(Word64Xor); }
+ const Operator* Word64Shl() { BINOP(Word64Shl); }
+ const Operator* Word64Shr() { BINOP(Word64Shr); }
+ const Operator* Word64Sar() { BINOP(Word64Sar); }
+ const Operator* Word64Ror() { BINOP(Word64Ror); }
+ const Operator* Word64Equal() { BINOP_C(Word64Equal); }
- Operator* Int32Add() { BINOP_AC(Int32Add); }
- Operator* Int32AddWithOverflow() { BINOP_ACO(Int32AddWithOverflow); }
- Operator* Int32Sub() { BINOP(Int32Sub); }
- Operator* Int32SubWithOverflow() { BINOP_O(Int32SubWithOverflow); }
- Operator* Int32Mul() { BINOP_AC(Int32Mul); }
- Operator* Int32Div() { BINOP(Int32Div); }
- Operator* Int32UDiv() { BINOP(Int32UDiv); }
- Operator* Int32Mod() { BINOP(Int32Mod); }
- Operator* Int32UMod() { BINOP(Int32UMod); }
- Operator* Int32LessThan() { BINOP(Int32LessThan); }
- Operator* Int32LessThanOrEqual() { BINOP(Int32LessThanOrEqual); }
- Operator* Uint32LessThan() { BINOP(Uint32LessThan); }
- Operator* Uint32LessThanOrEqual() { BINOP(Uint32LessThanOrEqual); }
+ const Operator* Int32Add() { BINOP_AC(Int32Add); }
+ const Operator* Int32AddWithOverflow() {
BINOP_ACO(Int32AddWithOverflow); }
+ const Operator* Int32Sub() { BINOP(Int32Sub); }
+ const Operator* Int32SubWithOverflow() { BINOP_O(Int32SubWithOverflow); }
+ const Operator* Int32Mul() { BINOP_AC(Int32Mul); }
+ const Operator* Int32Div() { BINOP(Int32Div); }
+ const Operator* Int32UDiv() { BINOP(Int32UDiv); }
+ const Operator* Int32Mod() { BINOP(Int32Mod); }
+ const Operator* Int32UMod() { BINOP(Int32UMod); }
+ const Operator* Int32LessThan() { BINOP(Int32LessThan); }
+ const Operator* Int32LessThanOrEqual() { BINOP(Int32LessThanOrEqual); }
+ const Operator* Uint32LessThan() { BINOP(Uint32LessThan); }
+ const Operator* Uint32LessThanOrEqual() { BINOP(Uint32LessThanOrEqual); }
- Operator* Int64Add() { BINOP_AC(Int64Add); }
- Operator* Int64Sub() { BINOP(Int64Sub); }
- Operator* Int64Mul() { BINOP_AC(Int64Mul); }
- Operator* Int64Div() { BINOP(Int64Div); }
- Operator* Int64UDiv() { BINOP(Int64UDiv); }
- Operator* Int64Mod() { BINOP(Int64Mod); }
- Operator* Int64UMod() { BINOP(Int64UMod); }
- Operator* Int64LessThan() { BINOP(Int64LessThan); }
- Operator* Int64LessThanOrEqual() { BINOP(Int64LessThanOrEqual); }
+ const Operator* Int64Add() { BINOP_AC(Int64Add); }
+ const Operator* Int64Sub() { BINOP(Int64Sub); }
+ const Operator* Int64Mul() { BINOP_AC(Int64Mul); }
+ const Operator* Int64Div() { BINOP(Int64Div); }
+ const Operator* Int64UDiv() { BINOP(Int64UDiv); }
+ const Operator* Int64Mod() { BINOP(Int64Mod); }
+ const Operator* Int64UMod() { BINOP(Int64UMod); }
+ const Operator* Int64LessThan() { BINOP(Int64LessThan); }
+ const Operator* Int64LessThanOrEqual() { BINOP(Int64LessThanOrEqual); }
// Signed comparison of word-sized integer values, translates to
int32/int64
// comparisons depending on the word-size of the machine.
- Operator* IntLessThan() { INT_SIZE(LessThan); }
- Operator* IntLessThanOrEqual() { INT_SIZE(LessThanOrEqual); }
+ const Operator* IntLessThan() { INT_SIZE(LessThan); }
+ const Operator* IntLessThanOrEqual() { INT_SIZE(LessThanOrEqual); }
// Convert representation of integers between float64 and int32/uint32.
// The precise rounding mode and handling of out of range inputs are
*not*
// defined for these operators, since they are intended only for use with
// integers.
- Operator* ChangeInt32ToFloat64() { UNOP(ChangeInt32ToFloat64); }
- Operator* ChangeUint32ToFloat64() { UNOP(ChangeUint32ToFloat64); }
- Operator* ChangeFloat64ToInt32() { UNOP(ChangeFloat64ToInt32); }
- Operator* ChangeFloat64ToUint32() { UNOP(ChangeFloat64ToUint32); }
+ const Operator* ChangeInt32ToFloat64() { UNOP(ChangeInt32ToFloat64); }
+ const Operator* ChangeUint32ToFloat64() { UNOP(ChangeUint32ToFloat64); }
+ const Operator* ChangeFloat64ToInt32() { UNOP(ChangeFloat64ToInt32); }
+ const Operator* ChangeFloat64ToUint32() { UNOP(ChangeFloat64ToUint32); }
// Sign/zero extend int32/uint32 to int64/uint64.
- Operator* ChangeInt32ToInt64() { UNOP(ChangeInt32ToInt64); }
- Operator* ChangeUint32ToUint64() { UNOP(ChangeUint32ToUint64); }
+ const Operator* ChangeInt32ToInt64() { UNOP(ChangeInt32ToInt64); }
+ const Operator* ChangeUint32ToUint64() { UNOP(ChangeUint32ToUint64); }
// Truncate double to int32 using JavaScript semantics.
- Operator* TruncateFloat64ToInt32() { UNOP(TruncateFloat64ToInt32); }
+ const Operator* TruncateFloat64ToInt32() { UNOP(TruncateFloat64ToInt32);
}
// Truncate the high order bits and convert the remaining bits to int32.
- Operator* TruncateInt64ToInt32() { UNOP(TruncateInt64ToInt32); }
+ const Operator* TruncateInt64ToInt32() { UNOP(TruncateInt64ToInt32); }
// Floating point operators always operate with IEEE 754
round-to-nearest.
- Operator* Float64Add() { BINOP_C(Float64Add); }
- Operator* Float64Sub() { BINOP(Float64Sub); }
- Operator* Float64Mul() { BINOP_C(Float64Mul); }
- Operator* Float64Div() { BINOP(Float64Div); }
- Operator* Float64Mod() { BINOP(Float64Mod); }
+ const Operator* Float64Add() { BINOP_C(Float64Add); }
+ const Operator* Float64Sub() { BINOP(Float64Sub); }
+ const Operator* Float64Mul() { BINOP_C(Float64Mul); }
+ const Operator* Float64Div() { BINOP(Float64Div); }
+ const Operator* Float64Mod() { BINOP(Float64Mod); }
// Floating point comparisons complying to IEEE 754.
- Operator* Float64Equal() { BINOP_C(Float64Equal); }
- Operator* Float64LessThan() { BINOP(Float64LessThan); }
- Operator* Float64LessThanOrEqual() { BINOP(Float64LessThanOrEqual); }
+ const Operator* Float64Equal() { BINOP_C(Float64Equal); }
+ const Operator* Float64LessThan() { BINOP(Float64LessThan); }
+ const Operator* Float64LessThanOrEqual() {
BINOP(Float64LessThanOrEqual); }
inline bool is32() const { return word_ == kRepWord32; }
inline bool is64() const { return word_ == kRepWord64; }
@@ -184,8 +184,9 @@
Zone* zone_;
MachineType word_;
};
-}
-}
-} // namespace v8::internal::compiler
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
#endif // V8_COMPILER_MACHINE_OPERATOR_H_
=======================================
--- /branches/bleeding_edge/src/compiler/raw-machine-assembler.cc Mon Sep
8 15:18:54 2014 UTC
+++ /branches/bleeding_edge/src/compiler/raw-machine-assembler.cc Wed Sep
10 12:23:45 2014 UTC
@@ -149,7 +149,7 @@
}
-Node* RawMachineAssembler::MakeNode(Operator* op, int input_count,
+Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count,
Node** inputs) {
DCHECK(ScheduleValid());
DCHECK(current_block_ != NULL);
=======================================
--- /branches/bleeding_edge/src/compiler/raw-machine-assembler.h Fri Sep 5
11:44:31 2014 UTC
+++ /branches/bleeding_edge/src/compiler/raw-machine-assembler.h Wed Sep 10
12:23:45 2014 UTC
@@ -423,7 +423,8 @@
Schedule* Export();
protected:
- virtual Node* MakeNode(Operator* op, int input_count, Node** inputs);
+ virtual Node* MakeNode(const Operator* op, int input_count,
+ Node** inputs) FINAL;
bool ScheduleValid() { return schedule_ != NULL; }
=======================================
--- /branches/bleeding_edge/src/compiler/representation-change.h Mon Sep 8
09:16:11 2014 UTC
+++ /branches/bleeding_edge/src/compiler/representation-change.h Wed Sep 10
12:23:45 2014 UTC
@@ -91,7 +91,7 @@
break;
}
// Select the correct X -> Tagged operator.
- Operator* op;
+ const Operator* op;
if (output_type & kRepBit) {
op = simplified()->ChangeBitToBool();
} else if (output_type & rWord) {
@@ -129,7 +129,7 @@
break;
}
// Select the correct X -> Float64 operator.
- Operator* op;
+ const Operator* op;
if (output_type & kRepBit) {
return TypeError(node, output_type, kRepFloat64);
} else if (output_type & rWord) {
@@ -169,7 +169,7 @@
break;
}
// Select the correct X -> Word32 operator.
- Operator* op = NULL;
+ const Operator* op = NULL;
if (output_type & kRepFloat64) {
if (output_type & kTypeUint32 || use_unsigned) {
op = machine()->ChangeFloat64ToUint32();
@@ -207,7 +207,7 @@
break;
}
// Select the correct X -> Bit operator.
- Operator* op;
+ const Operator* op;
if (output_type & rWord) {
return node; // No change necessary.
} else if (output_type & kRepWord64) {
@@ -228,7 +228,7 @@
return TypeError(node, output_type, kRepWord64);
}
- Operator* Int32OperatorFor(IrOpcode::Value opcode) {
+ const Operator* Int32OperatorFor(IrOpcode::Value opcode) {
switch (opcode) {
case IrOpcode::kNumberAdd:
return machine()->Int32Add();
@@ -246,7 +246,7 @@
}
}
- Operator* Uint32OperatorFor(IrOpcode::Value opcode) {
+ const Operator* Uint32OperatorFor(IrOpcode::Value opcode) {
switch (opcode) {
case IrOpcode::kNumberAdd:
return machine()->Int32Add();
@@ -264,7 +264,7 @@
}
}
- Operator* Float64OperatorFor(IrOpcode::Value opcode) {
+ const Operator* Float64OperatorFor(IrOpcode::Value opcode) {
switch (opcode) {
case IrOpcode::kNumberAdd:
return machine()->Float64Add();
=======================================
--- /branches/bleeding_edge/src/compiler/simplified-lowering.cc Mon Sep 8
15:18:54 2014 UTC
+++ /branches/bleeding_edge/src/compiler/simplified-lowering.cc Wed Sep 10
12:23:45 2014 UTC
@@ -336,15 +336,15 @@
}
}
- Operator* Int32Op(Node* node) {
+ const Operator* Int32Op(Node* node) {
return changer_->Int32OperatorFor(node->opcode());
}
- Operator* Uint32Op(Node* node) {
+ const Operator* Uint32Op(Node* node) {
return changer_->Uint32OperatorFor(node->opcode());
}
- Operator* Float64Op(Node* node) {
+ const Operator* Float64Op(Node* node) {
return changer_->Float64OperatorFor(node->opcode());
}
=======================================
---
/branches/bleeding_edge/src/compiler/simplified-operator-reducer-unittest.cc
Wed Sep 10 06:39:25 2014 UTC
+++
/branches/bleeding_edge/src/compiler/simplified-operator-reducer-unittest.cc
Wed Sep 10 12:23:45 2014 UTC
@@ -128,7 +128,7 @@
namespace {
struct UnaryOperator {
- Operator* (SimplifiedOperatorBuilder::*constructor)() const;
+ const Operator* (SimplifiedOperatorBuilder::*constructor)() const;
const char* constructor_name;
};
=======================================
--- /branches/bleeding_edge/src/compiler/simplified-operator-reducer.cc Mon
Sep 8 09:16:11 2014 UTC
+++ /branches/bleeding_edge/src/compiler/simplified-operator-reducer.cc Wed
Sep 10 12:23:45 2014 UTC
@@ -102,7 +102,8 @@
}
-Reduction SimplifiedOperatorReducer::Change(Node* node, Operator* op,
Node* a) {
+Reduction SimplifiedOperatorReducer::Change(Node* node, const Operator* op,
+ Node* a) {
node->set_op(op);
node->ReplaceInput(0, a);
return Changed(node);
=======================================
--- /branches/bleeding_edge/src/compiler/simplified-operator-reducer.h Wed
Sep 10 08:32:23 2014 UTC
+++ /branches/bleeding_edge/src/compiler/simplified-operator-reducer.h Wed
Sep 10 12:23:45 2014 UTC
@@ -28,7 +28,7 @@
virtual Reduction Reduce(Node* node) OVERRIDE;
private:
- Reduction Change(Node* node, Operator* op, Node* a);
+ Reduction Change(Node* node, const Operator* op, Node* a);
Reduction ReplaceFloat64(double value);
Reduction ReplaceInt32(int32_t value);
Reduction ReplaceUint32(uint32_t value) {
=======================================
--- /branches/bleeding_edge/src/compiler/simplified-operator.h Thu Sep 4
09:37:25 2014 UTC
+++ /branches/bleeding_edge/src/compiler/simplified-operator.h Wed Sep 10
12:23:45 2014 UTC
@@ -133,45 +133,49 @@
#define UNOP(name) SIMPLE(name, Operator::kPure, 1, 1)
#define BINOP(name) SIMPLE(name, Operator::kPure, 2, 1)
- Operator* BooleanNot() const { UNOP(BooleanNot); }
+ const Operator* BooleanNot() const { UNOP(BooleanNot); }
- Operator* NumberEqual() const { BINOP(NumberEqual); }
- Operator* NumberLessThan() const { BINOP(NumberLessThan); }
- Operator* NumberLessThanOrEqual() const { BINOP(NumberLessThanOrEqual); }
- Operator* NumberAdd() const { BINOP(NumberAdd); }
- Operator* NumberSubtract() const { BINOP(NumberSubtract); }
- Operator* NumberMultiply() const { BINOP(NumberMultiply); }
- Operator* NumberDivide() const { BINOP(NumberDivide); }
- Operator* NumberModulus() const { BINOP(NumberModulus); }
- Operator* NumberToInt32() const { UNOP(NumberToInt32); }
- Operator* NumberToUint32() const { UNOP(NumberToUint32); }
+ const Operator* NumberEqual() const { BINOP(NumberEqual); }
+ const Operator* NumberLessThan() const { BINOP(NumberLessThan); }
+ const Operator* NumberLessThanOrEqual() const {
+ BINOP(NumberLessThanOrEqual);
+ }
+ const Operator* NumberAdd() const { BINOP(NumberAdd); }
+ const Operator* NumberSubtract() const { BINOP(NumberSubtract); }
+ const Operator* NumberMultiply() const { BINOP(NumberMultiply); }
+ const Operator* NumberDivide() const { BINOP(NumberDivide); }
+ const Operator* NumberModulus() const { BINOP(NumberModulus); }
+ const Operator* NumberToInt32() const { UNOP(NumberToInt32); }
+ const Operator* NumberToUint32() const { UNOP(NumberToUint32); }
- Operator* ReferenceEqual(Type* type) const { BINOP(ReferenceEqual); }
+ const Operator* ReferenceEqual(Type* type) const {
BINOP(ReferenceEqual); }
- Operator* StringEqual() const { BINOP(StringEqual); }
- Operator* StringLessThan() const { BINOP(StringLessThan); }
- Operator* StringLessThanOrEqual() const { BINOP(StringLessThanOrEqual); }
- Operator* StringAdd() const { BINOP(StringAdd); }
+ const Operator* StringEqual() const { BINOP(StringEqual); }
+ const Operator* StringLessThan() const { BINOP(StringLessThan); }
+ const Operator* StringLessThanOrEqual() const {
+ BINOP(StringLessThanOrEqual);
+ }
+ const Operator* StringAdd() const { BINOP(StringAdd); }
- Operator* ChangeTaggedToInt32() const { UNOP(ChangeTaggedToInt32); }
- Operator* ChangeTaggedToUint32() const { UNOP(ChangeTaggedToUint32); }
- Operator* ChangeTaggedToFloat64() const { UNOP(ChangeTaggedToFloat64); }
- Operator* ChangeInt32ToTagged() const { UNOP(ChangeInt32ToTagged); }
- Operator* ChangeUint32ToTagged() const { UNOP(ChangeUint32ToTagged); }
- Operator* ChangeFloat64ToTagged() const { UNOP(ChangeFloat64ToTagged); }
- Operator* ChangeBoolToBit() const { UNOP(ChangeBoolToBit); }
- Operator* ChangeBitToBool() const { UNOP(ChangeBitToBool); }
+ const Operator* ChangeTaggedToInt32() const { UNOP(ChangeTaggedToInt32);
}
+ const Operator* ChangeTaggedToUint32() const {
UNOP(ChangeTaggedToUint32); }
+ const Operator* ChangeTaggedToFloat64() const {
UNOP(ChangeTaggedToFloat64); }
+ const Operator* ChangeInt32ToTagged() const { UNOP(ChangeInt32ToTagged);
}
+ const Operator* ChangeUint32ToTagged() const {
UNOP(ChangeUint32ToTagged); }
+ const Operator* ChangeFloat64ToTagged() const {
UNOP(ChangeFloat64ToTagged); }
+ const Operator* ChangeBoolToBit() const { UNOP(ChangeBoolToBit); }
+ const Operator* ChangeBitToBool() const { UNOP(ChangeBitToBool); }
- Operator* LoadField(const FieldAccess& access) const {
+ const Operator* LoadField(const FieldAccess& access) const {
OP1(LoadField, FieldAccess, access, Operator::kNoWrite, 1, 1);
}
- Operator* StoreField(const FieldAccess& access) const {
+ const Operator* StoreField(const FieldAccess& access) const {
OP1(StoreField, FieldAccess, access, Operator::kNoRead, 2, 0);
}
- Operator* LoadElement(const ElementAccess& access) const {
+ const Operator* LoadElement(const ElementAccess& access) const {
OP1(LoadElement, ElementAccess, access, Operator::kNoWrite, 2, 1);
}
- Operator* StoreElement(const ElementAccess& access) const {
+ const Operator* StoreElement(const ElementAccess& access) const {
OP1(StoreElement, ElementAccess, access, Operator::kNoRead, 3, 0);
}
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/codegen-tester.h Fri Sep
5 08:48:41 2014 UTC
+++ /branches/bleeding_edge/test/cctest/compiler/codegen-tester.h Wed Sep
10 12:23:45 2014 UTC
@@ -242,7 +242,7 @@
return m->NewNode(op(m->machine()), a, b);
}
- Operator* op(MachineOperatorBuilder* machine) {
+ const Operator* op(MachineOperatorBuilder* machine) {
switch (opcode) {
case IrOpcode::kWord32Equal:
return machine->Word32Equal();
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/graph-builder-tester.h Thu
Sep 4 16:29:40 2014 UTC
+++ /branches/bleeding_edge/test/cctest/compiler/graph-builder-tester.h Wed
Sep 10 12:23:45 2014 UTC
@@ -26,8 +26,8 @@
virtual ~DirectGraphBuilder() {}
protected:
- virtual Node* MakeNode(Operator* op, int value_input_count,
- Node** value_inputs) {
+ virtual Node* MakeNode(const Operator* op, int value_input_count,
+ Node** value_inputs) FINAL {
return graph()->NewNode(op, value_input_count, value_inputs);
}
};
=======================================
---
/branches/bleeding_edge/test/cctest/compiler/simplified-graph-builder.cc
Thu Sep 4 10:23:51 2014 UTC
+++
/branches/bleeding_edge/test/cctest/compiler/simplified-graph-builder.cc
Wed Sep 10 12:23:45 2014 UTC
@@ -43,7 +43,8 @@
}
-Node* SimplifiedGraphBuilder::MakeNode(Operator* op, int value_input_count,
+Node* SimplifiedGraphBuilder::MakeNode(const Operator* op,
+ int value_input_count,
Node** value_inputs) {
DCHECK(op->InputCount() == value_input_count);
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/simplified-graph-builder.h
Thu Sep 4 16:29:40 2014 UTC
+++ /branches/bleeding_edge/test/cctest/compiler/simplified-graph-builder.h
Wed Sep 10 12:23:45 2014 UTC
@@ -136,8 +136,8 @@
}
protected:
- virtual Node* MakeNode(Operator* op, int value_input_count,
- Node** value_inputs);
+ virtual Node* MakeNode(const Operator* op, int value_input_count,
+ Node** value_inputs) FINAL;
private:
Node* effect_;
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/test-changes-lowering.cc
Wed Sep 10 06:39:25 2014 UTC
+++ /branches/bleeding_edge/test/cctest/compiler/test-changes-lowering.cc
Wed Sep 10 12:23:45 2014 UTC
@@ -99,7 +99,7 @@
CHECK(this->isolate()->factory()->NewNumber(expected)->SameValue(number));
}
- void BuildAndLower(Operator* op) {
+ void BuildAndLower(const Operator* op) {
// We build a graph by hand here, because the raw machine assembler
// does not add the correct control and effect nodes.
Node* p0 = this->Parameter(0);
@@ -111,7 +111,8 @@
LowerChange(change);
}
- void BuildStoreAndLower(Operator* op, Operator* store_op, void*
location) {
+ void BuildStoreAndLower(const Operator* op, const Operator* store_op,
+ void* location) {
// We build a graph by hand here, because the raw machine assembler
// does not add the correct control and effect nodes.
Node* p0 = this->Parameter(0);
@@ -126,7 +127,8 @@
LowerChange(change);
}
- void BuildLoadAndLower(Operator* op, Operator* load_op, void* location) {
+ void BuildLoadAndLower(const Operator* op, const Operator* load_op,
+ void* location) {
// We build a graph by hand here, because the raw machine assembler
// does not add the correct control and effect nodes.
Node* load =
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/test-js-typed-lowering.cc
Wed Sep 10 06:39:25 2014 UTC
+++ /branches/bleeding_edge/test/cctest/compiler/test-js-typed-lowering.cc
Wed Sep 10 12:23:45 2014 UTC
@@ -33,8 +33,8 @@
}
Isolate* isolate;
- Operator* binop;
- Operator* unop;
+ const Operator* binop;
+ const Operator* unop;
JSOperatorBuilder javascript;
MachineOperatorBuilder machine;
SimplifiedOperatorBuilder simplified;
@@ -73,25 +73,25 @@
CHECK_EQ(2, node->InputCount()); // should not have context, effect,
etc.
}
- void CheckPureBinop(Operator* expected, Node* node) {
+ void CheckPureBinop(const Operator* expected, Node* node) {
CHECK_EQ(expected->opcode(), node->op()->opcode());
CHECK_EQ(2, node->InputCount()); // should not have context, effect,
etc.
}
- Node* ReduceUnop(Operator* op, Type* input_type) {
+ Node* ReduceUnop(const Operator* op, Type* input_type) {
return reduce(Unop(op, Parameter(input_type)));
}
- Node* ReduceBinop(Operator* op, Type* left_type, Type* right_type) {
+ Node* ReduceBinop(const Operator* op, Type* left_type, Type* right_type)
{
return reduce(Binop(op, Parameter(left_type, 0), Parameter(right_type,
1)));
}
- Node* Binop(Operator* op, Node* left, Node* right) {
+ Node* Binop(const Operator* op, Node* left, Node* right) {
// JS binops also require context, effect, and control
return graph.NewNode(op, left, right, context(), start(), control());
}
- Node* Unop(Operator* op, Node* input) {
+ Node* Unop(const Operator* op, Node* input) {
// JS unops also require context, effect, and control
return graph.NewNode(op, input, context(), start(), control());
}
@@ -206,7 +206,7 @@
TEST(NumberBinops) {
JSTypedLoweringTester R;
- Operator* ops[] = {
+ const Operator* ops[] = {
R.javascript.Add(), R.simplified.NumberAdd(),
R.javascript.Subtract(), R.simplified.NumberSubtract(),
R.javascript.Multiply(), R.simplified.NumberMultiply(),
@@ -253,7 +253,7 @@
class JSBitwiseShiftTypedLoweringTester : public JSTypedLoweringTester {
public:
static const int kNumberOps = 6;
- Operator* ops[kNumberOps];
+ const Operator* ops[kNumberOps];
bool signedness[kNumberOps];
JSBitwiseShiftTypedLoweringTester() {
@@ -267,7 +267,7 @@
}
private:
- void set(int idx, Operator* op, bool s) {
+ void set(int idx, const Operator* op, bool s) {
ops[idx] = op;
signedness[idx] = s;
}
@@ -313,7 +313,7 @@
class JSBitwiseTypedLoweringTester : public JSTypedLoweringTester {
public:
static const int kNumberOps = 6;
- Operator* ops[kNumberOps];
+ const Operator* ops[kNumberOps];
bool signedness[kNumberOps];
JSBitwiseTypedLoweringTester() {
@@ -327,7 +327,7 @@
}
private:
- void set(int idx, Operator* op, bool s) {
+ void set(int idx, const Operator* op, bool s) {
ops[idx] = op;
signedness[idx] = s;
}
@@ -366,7 +366,7 @@
TEST(JSToNumber1) {
JSTypedLoweringTester R;
- Operator* ton = R.javascript.ToNumber();
+ const Operator* ton = R.javascript.ToNumber();
for (size_t i = 0; i < arraysize(kNumberTypes); i++) { //
ToNumber(number)
Node* r = R.ReduceUnop(ton, kNumberTypes[i]);
@@ -416,9 +416,10 @@
TEST(JSToNumberOfConstant) {
JSTypedLoweringTester R;
- Operator* ops[] = {R.common.NumberConstant(0),
R.common.NumberConstant(-1),
- R.common.NumberConstant(0.1),
R.common.Int32Constant(1177),
- R.common.Float64Constant(0.99)};
+ const Operator* ops[] = {
+ R.common.NumberConstant(0), R.common.NumberConstant(-1),
+ R.common.NumberConstant(0.1), R.common.Int32Constant(1177),
+ R.common.Float64Constant(0.99)};
for (size_t i = 0; i < arraysize(ops); i++) {
Node* n = R.graph.NewNode(ops[i]);
@@ -455,7 +456,7 @@
TEST(JSToBoolean) {
JSTypedLoweringTester R;
- Operator* op = R.javascript.ToBoolean();
+ const Operator* op = R.javascript.ToBoolean();
{ // ToBoolean(undefined)
Node* r = R.ReduceUnop(op, Type::Undefined());
@@ -543,7 +544,7 @@
CHECK_EQ(IrOpcode::kParameter, r->opcode());
}
- Operator* op = R.javascript.ToString();
+ const Operator* op = R.javascript.ToString();
{ // ToString(undefined) => "undefined"
Node* r = R.ReduceUnop(op, Type::Undefined());
@@ -610,7 +611,7 @@
TEST(StringComparison) {
JSTypedLoweringTester R;
- Operator* ops[] = {
+ const Operator* ops[] = {
R.javascript.LessThan(), R.simplified.StringLessThan(),
R.javascript.LessThanOrEqual(),
R.simplified.StringLessThanOrEqual(),
R.javascript.GreaterThan(), R.simplified.StringLessThan(),
@@ -655,7 +656,7 @@
TEST(NumberComparison) {
JSTypedLoweringTester R;
- Operator* ops[] = {
+ const Operator* ops[] = {
R.javascript.LessThan(), R.simplified.NumberLessThan(),
R.javascript.LessThanOrEqual(),
R.simplified.NumberLessThanOrEqual(),
R.javascript.GreaterThan(), R.simplified.NumberLessThan(),
@@ -755,7 +756,7 @@
TEST(UnaryNot) {
JSTypedLoweringTester R;
- Operator* opnot = R.javascript.UnaryNot();
+ const Operator* opnot = R.javascript.UnaryNot();
for (size_t i = 0; i < arraysize(kJSTypes); i++) {
Node* orig = R.Unop(opnot, R.Parameter(kJSTypes[i]));
@@ -832,7 +833,7 @@
// Helper class for testing the reduction of a single binop.
class BinopEffectsTester {
public:
- explicit BinopEffectsTester(Operator* op, Type* t0, Type* t1)
+ explicit BinopEffectsTester(const Operator* op, Type* t0, Type* t1)
: R(),
p0(R.Parameter(t0, 0)),
p1(R.Parameter(t1, 1)),
@@ -961,7 +962,7 @@
TEST(RemovePureNumberBinopEffects) {
JSTypedLoweringTester R;
- Operator* ops[] = {
+ const Operator* ops[] = {
R.javascript.Equal(), R.simplified.NumberEqual(),
R.javascript.Add(), R.simplified.NumberAdd(),
R.javascript.Subtract(), R.simplified.NumberSubtract(),
@@ -989,7 +990,7 @@
TEST(OrderNumberBinopEffects1) {
JSTypedLoweringTester R;
- Operator* ops[] = {
+ const Operator* ops[] = {
R.javascript.Subtract(), R.simplified.NumberSubtract(),
R.javascript.Multiply(), R.simplified.NumberMultiply(),
R.javascript.Divide(), R.simplified.NumberDivide(),
@@ -1015,7 +1016,7 @@
TEST(OrderNumberBinopEffects2) {
JSTypedLoweringTester R;
- Operator* ops[] = {
+ const Operator* ops[] = {
R.javascript.Add(), R.simplified.NumberAdd(),
R.javascript.Subtract(), R.simplified.NumberSubtract(),
R.javascript.Multiply(), R.simplified.NumberMultiply(),
@@ -1054,7 +1055,7 @@
TEST(OrderCompareEffects) {
JSTypedLoweringTester R;
- Operator* ops[] = {
+ const Operator* ops[] = {
R.javascript.GreaterThan(), R.simplified.NumberLessThan(),
R.javascript.GreaterThanOrEqual(),
R.simplified.NumberLessThanOrEqual(),
};
@@ -1187,7 +1188,7 @@
TEST(UnaryNotEffects) {
JSTypedLoweringTester R;
- Operator* opnot = R.javascript.UnaryNot();
+ const Operator* opnot = R.javascript.UnaryNot();
for (size_t i = 0; i < arraysize(kJSTypes); i++) {
Node* p0 = R.Parameter(kJSTypes[i], 0);
@@ -1299,10 +1300,10 @@
JSTypedLoweringTester R;
struct Entry {
- Operator* js_op;
- Operator* uint_op;
- Operator* int_op;
- Operator* num_op;
+ const Operator* js_op;
+ const Operator* uint_op;
+ const Operator* int_op;
+ const Operator* num_op;
bool commute;
};
@@ -1330,7 +1331,7 @@
Node* cmp = R.Binop(ops[o].js_op, p0, p1);
Node* r = R.reduce(cmp);
- Operator* expected;
+ const Operator* expected;
if (t0->Is(Type::Unsigned32()) && t1->Is(Type::Unsigned32())) {
expected = ops[o].uint_op;
} else if (t0->Is(Type::Signed32()) && t1->Is(Type::Signed32())) {
=======================================
---
/branches/bleeding_edge/test/cctest/compiler/test-machine-operator-reducer.cc
Wed Sep 10 06:39:25 2014 UTC
+++
/branches/bleeding_edge/test/cctest/compiler/test-machine-operator-reducer.cc
Wed Sep 10 12:23:45 2014 UTC
@@ -15,17 +15,18 @@
using namespace v8::internal::compiler;
template <typename T>
-Operator* NewConstantOperator(CommonOperatorBuilder* common, volatile T
value);
+const Operator* NewConstantOperator(CommonOperatorBuilder* common,
+ volatile T value);
template <>
-Operator* NewConstantOperator<int32_t>(CommonOperatorBuilder* common,
- volatile int32_t value) {
+const Operator* NewConstantOperator<int32_t>(CommonOperatorBuilder* common,
+ volatile int32_t value) {
return common->Int32Constant(value);
}
template <>
-Operator* NewConstantOperator<double>(CommonOperatorBuilder* common,
- volatile double value) {
+const Operator* NewConstantOperator<double>(CommonOperatorBuilder* common,
+ volatile double value) {
return common->Float64Constant(value);
}
@@ -63,8 +64,8 @@
}
Isolate* isolate;
- Operator* binop;
- Operator* unop;
+ const Operator* binop;
+ const Operator* unop;
MachineOperatorBuilder machine;
CommonOperatorBuilder common;
Graph graph;
@@ -130,7 +131,7 @@
// Check that the reduction of this binop applied to {left} and {right}
yields
// the {op_expect} applied to {left_expect} and {right_expect}.
template <typename T>
- void CheckFoldBinop(volatile T left_expect, Operator* op_expect,
+ void CheckFoldBinop(volatile T left_expect, const Operator* op_expect,
Node* right_expect, Node* left, Node* right) {
CHECK_NE(NULL, binop);
Node* n = graph.NewNode(binop, left, right);
@@ -145,7 +146,7 @@
// Check that the reduction of this binop applied to {left} and {right}
yields
// the {op_expect} applied to {left_expect} and {right_expect}.
template <typename T>
- void CheckFoldBinop(Node* left_expect, Operator* op_expect,
+ void CheckFoldBinop(Node* left_expect, const Operator* op_expect,
volatile T right_expect, Node* left, Node* right) {
CHECK_NE(NULL, binop);
Node* n = graph.NewNode(binop, left, right);
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/test-run-machops.cc Tue
Sep 9 14:18:17 2014 UTC
+++ /branches/bleeding_edge/test/cctest/compiler/test-run-machops.cc Wed
Sep 10 12:23:45 2014 UTC
@@ -58,7 +58,7 @@
TEST(CodeGenInt32Binop) {
RawMachineAssemblerTester<void> m;
- Operator* ops[] = {
+ const Operator* ops[] = {
m.machine()->Word32And(), m.machine()->Word32Or(),
m.machine()->Word32Xor(), m.machine()->Word32Shl(),
m.machine()->Word32Shr(), m.machine()->Word32Sar(),
@@ -741,8 +741,9 @@
}
{
RawMachineAssemblerTester<void> m;
- Operator* shops[] = {m.machine()->Word32Sar(),
m.machine()->Word32Shl(),
- m.machine()->Word32Shr()};
+ const Operator* shops[] = {m.machine()->Word32Sar(),
+ m.machine()->Word32Shl(),
+ m.machine()->Word32Shr()};
for (size_t n = 0; n < arraysize(shops); n++) {
RawMachineAssemblerTester<int32_t> m(kMachUint32, kMachInt32,
kMachUint32);
@@ -832,8 +833,9 @@
}
{
RawMachineAssemblerTester<void> m;
- Operator* shops[] = {m.machine()->Word32Sar(),
m.machine()->Word32Shl(),
- m.machine()->Word32Shr()};
+ const Operator* shops[] = {m.machine()->Word32Sar(),
+ m.machine()->Word32Shl(),
+ m.machine()->Word32Shr()};
for (size_t n = 0; n < arraysize(shops); n++) {
RawMachineAssemblerTester<int32_t> m(kMachUint32, kMachInt32,
kMachUint32);
@@ -1076,8 +1078,9 @@
}
{
RawMachineAssemblerTester<void> m;
- Operator* shops[] = {m.machine()->Word32Sar(),
m.machine()->Word32Shl(),
- m.machine()->Word32Shr()};
+ const Operator* shops[] = {m.machine()->Word32Sar(),
+ m.machine()->Word32Shl(),
+ m.machine()->Word32Shr()};
for (size_t n = 0; n < arraysize(shops); n++) {
RawMachineAssemblerTester<int32_t> m(kMachUint32, kMachInt32,
kMachUint32);
@@ -1167,8 +1170,9 @@
}
{
RawMachineAssemblerTester<void> m;
- Operator* shops[] = {m.machine()->Word32Sar(),
m.machine()->Word32Shl(),
- m.machine()->Word32Shr()};
+ const Operator* shops[] = {m.machine()->Word32Sar(),
+ m.machine()->Word32Shl(),
+ m.machine()->Word32Shr()};
for (size_t n = 0; n < arraysize(shops); n++) {
RawMachineAssemblerTester<int32_t> m(kMachUint32, kMachInt32,
kMachUint32);
@@ -1699,8 +1703,9 @@
}
{
RawMachineAssemblerTester<void> m;
- Operator* shops[] = {m.machine()->Word32Sar(),
m.machine()->Word32Shl(),
- m.machine()->Word32Shr()};
+ const Operator* shops[] = {m.machine()->Word32Sar(),
+ m.machine()->Word32Shl(),
+ m.machine()->Word32Shr()};
for (size_t n = 0; n < arraysize(shops); n++) {
RawMachineAssemblerTester<int32_t> m(kMachUint32, kMachInt32,
kMachUint32);
@@ -1926,8 +1931,9 @@
}
{
RawMachineAssemblerTester<void> m;
- Operator* shops[] = {m.machine()->Word32Sar(),
m.machine()->Word32Shl(),
- m.machine()->Word32Shr()};
+ const Operator* shops[] = {m.machine()->Word32Sar(),
+ m.machine()->Word32Shl(),
+ m.machine()->Word32Shr()};
for (size_t n = 0; n < arraysize(shops); n++) {
RawMachineAssemblerTester<int32_t> m(kMachUint32, kMachInt32,
kMachUint32);
@@ -2150,8 +2156,9 @@
}
{
RawMachineAssemblerTester<void> m;
- Operator* shops[] = {m.machine()->Word32Sar(),
m.machine()->Word32Shl(),
- m.machine()->Word32Shr()};
+ const Operator* shops[] = {m.machine()->Word32Sar(),
+ m.machine()->Word32Shl(),
+ m.machine()->Word32Shr()};
for (size_t n = 0; n < arraysize(shops); n++) {
RawMachineAssemblerTester<int32_t> m(kMachUint32, kMachInt32,
kMachUint32);
@@ -2651,7 +2658,7 @@
TEST(RunDeadInt32Binops) {
RawMachineAssemblerTester<int32_t> m;
- Operator* ops[] = {
+ const Operator* ops[] = {
m.machine()->Word32And(), m.machine()->Word32Or(),
m.machine()->Word32Xor(), m.machine()->Word32Shl(),
m.machine()->Word32Shr(), m.machine()->Word32Sar(),
@@ -2762,12 +2769,12 @@
RawMachineAssemblerTester<int32_t> m;
double result;
- Operator* ops[] = {m.machine()->Float64Add(), m.machine()->Float64Sub(),
- m.machine()->Float64Mul(), m.machine()->Float64Div(),
- m.machine()->Float64Mod(), NULL};
+ const Operator* ops[] = {m.machine()->Float64Add(),
m.machine()->Float64Sub(),
+ m.machine()->Float64Mul(),
m.machine()->Float64Div(),
+ m.machine()->Float64Mod(), NULL};
double inf = V8_INFINITY;
- Operator* inputs[] = {
+ const Operator* inputs[] = {
m.common()->Float64Constant(0), m.common()->Float64Constant(1),
m.common()->Float64Constant(1), m.common()->Float64Constant(0),
m.common()->Float64Constant(0), m.common()->Float64Constant(-1),
@@ -2797,9 +2804,9 @@
TEST(RunDeadFloat64Binops) {
RawMachineAssemblerTester<int32_t> m;
- Operator* ops[] = {m.machine()->Float64Add(), m.machine()->Float64Sub(),
- m.machine()->Float64Mul(), m.machine()->Float64Div(),
- m.machine()->Float64Mod(), NULL};
+ const Operator* ops[] = {m.machine()->Float64Add(),
m.machine()->Float64Sub(),
+ m.machine()->Float64Mul(),
m.machine()->Float64Div(),
+ m.machine()->Float64Mod(), NULL};
for (int i = 0; ops[i] != NULL; i++) {
RawMachineAssemblerTester<int32_t> m;
@@ -3714,9 +3721,9 @@
TEST(RunFloat64UnorderedCompare) {
RawMachineAssemblerTester<int32_t> m;
- Operator* operators[] = {m.machine()->Float64Equal(),
- m.machine()->Float64LessThan(),
- m.machine()->Float64LessThanOrEqual()};
+ const Operator* operators[] = {m.machine()->Float64Equal(),
+ m.machine()->Float64LessThan(),
+ m.machine()->Float64LessThanOrEqual()};
double nan = v8::base::OS::nan_value();
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/test-scheduler.cc Fri Sep
5 11:44:31 2014 UTC
+++ /branches/bleeding_edge/test/cctest/compiler/test-scheduler.cc Wed Sep
10 12:23:45 2014 UTC
@@ -676,7 +676,7 @@
Graph graph(scope.main_zone());
CommonOperatorBuilder common_builder(scope.main_zone());
JSOperatorBuilder js_builder(scope.main_zone());
- Operator* op;
+ const Operator* op;
Handle<Object> object =
Handle<Object>(isolate->heap()->undefined_value(), isolate);
@@ -821,7 +821,7 @@
Graph graph(scope.main_zone());
CommonOperatorBuilder common_builder(scope.main_zone());
JSOperatorBuilder js_builder(scope.main_zone());
- Operator* op;
+ const Operator* op;
Handle<Object> object =
Handle<Object>(isolate->heap()->undefined_value(), isolate);
@@ -933,7 +933,7 @@
Graph graph(scope.main_zone());
CommonOperatorBuilder common_builder(scope.main_zone());
JSOperatorBuilder js_builder(scope.main_zone());
- Operator* op;
+ const Operator* op;
Handle<Object> object =
Handle<Object>(isolate->heap()->undefined_value(), isolate);
@@ -1180,7 +1180,7 @@
Graph graph(scope.main_zone());
CommonOperatorBuilder common_builder(scope.main_zone());
JSOperatorBuilder js_builder(scope.main_zone());
- Operator* op;
+ const Operator* op;
Handle<Object> object =
Handle<Object>(isolate->heap()->undefined_value(), isolate);
@@ -1510,7 +1510,7 @@
CommonOperatorBuilder common_builder(scope.main_zone());
JSOperatorBuilder js_builder(scope.main_zone());
MachineOperatorBuilder machine_builder(scope.main_zone());
- Operator* op;
+ const Operator* op;
Handle<Object> object =
Handle<Object>(isolate->heap()->undefined_value(), isolate);
=======================================
---
/branches/bleeding_edge/test/cctest/compiler/test-simplified-lowering.cc
Wed Sep 10 06:39:25 2014 UTC
+++
/branches/bleeding_edge/test/cctest/compiler/test-simplified-lowering.cc
Wed Sep 10 12:23:45 2014 UTC
@@ -649,14 +649,14 @@
NodeProperties::SetBounds(p1, Bounds(p1_type));
}
- void CheckLoweringBinop(IrOpcode::Value expected, Operator* op) {
+ void CheckLoweringBinop(IrOpcode::Value expected, const Operator* op) {
Node* node = Return(graph()->NewNode(op, p0, p1));
Lower();
CHECK_EQ(expected, node->opcode());
}
- void CheckLoweringTruncatedBinop(IrOpcode::Value expected, Operator* op,
- Operator* trunc) {
+ void CheckLoweringTruncatedBinop(IrOpcode::Value expected, const
Operator* op,
+ const Operator* trunc) {
Node* node = graph()->NewNode(op, p0, p1);
Return(graph()->NewNode(trunc, node));
Lower();
@@ -1108,7 +1108,7 @@
}
-static void CheckChangesAroundBinop(TestingGraph* t, Operator* op,
+static void CheckChangesAroundBinop(TestingGraph* t, const Operator* op,
IrOpcode::Value input_change,
IrOpcode::Value output_change) {
Node* binop = t->graph()->NewNode(op, t->p0, t->p1);
@@ -1126,11 +1126,11 @@
TEST(InsertChangesAroundInt32Binops) {
TestingGraph t(Type::Signed32(), Type::Signed32());
- Operator* ops[] = {t.machine()->Int32Add(), t.machine()->Int32Sub(),
- t.machine()->Int32Mul(), t.machine()->Int32Div(),
- t.machine()->Int32Mod(), t.machine()->Word32And(),
- t.machine()->Word32Or(), t.machine()->Word32Xor(),
- t.machine()->Word32Shl(), t.machine()->Word32Sar()};
+ const Operator* ops[] = {t.machine()->Int32Add(),
t.machine()->Int32Sub(),
+ t.machine()->Int32Mul(),
t.machine()->Int32Div(),
+ t.machine()->Int32Mod(),
t.machine()->Word32And(),
+ t.machine()->Word32Or(),
t.machine()->Word32Xor(),
+ t.machine()->Word32Shl(),
t.machine()->Word32Sar()};
for (size_t i = 0; i < arraysize(ops); i++) {
CheckChangesAroundBinop(&t, ops[i], IrOpcode::kChangeTaggedToInt32,
@@ -1142,8 +1142,8 @@
TEST(InsertChangesAroundInt32Cmp) {
TestingGraph t(Type::Signed32(), Type::Signed32());
- Operator* ops[] = {t.machine()->Int32LessThan(),
- t.machine()->Int32LessThanOrEqual()};
+ const Operator* ops[] = {t.machine()->Int32LessThan(),
+ t.machine()->Int32LessThanOrEqual()};
for (size_t i = 0; i < arraysize(ops); i++) {
CheckChangesAroundBinop(&t, ops[i], IrOpcode::kChangeTaggedToInt32,
@@ -1155,8 +1155,8 @@
TEST(InsertChangesAroundUint32Cmp) {
TestingGraph t(Type::Unsigned32(), Type::Unsigned32());
- Operator* ops[] = {t.machine()->Uint32LessThan(),
- t.machine()->Uint32LessThanOrEqual()};
+ const Operator* ops[] = {t.machine()->Uint32LessThan(),
+ t.machine()->Uint32LessThanOrEqual()};
for (size_t i = 0; i < arraysize(ops); i++) {
CheckChangesAroundBinop(&t, ops[i], IrOpcode::kChangeTaggedToUint32,
@@ -1168,7 +1168,7 @@
TEST(InsertChangesAroundFloat64Binops) {
TestingGraph t(Type::Number(), Type::Number());
- Operator* ops[] = {
+ const Operator* ops[] = {
t.machine()->Float64Add(), t.machine()->Float64Sub(),
t.machine()->Float64Mul(), t.machine()->Float64Div(),
t.machine()->Float64Mod(),
@@ -1184,9 +1184,9 @@
TEST(InsertChangesAroundFloat64Cmp) {
TestingGraph t(Type::Number(), Type::Number());
- Operator* ops[] = {t.machine()->Float64Equal(),
- t.machine()->Float64LessThan(),
- t.machine()->Float64LessThanOrEqual()};
+ const Operator* ops[] = {t.machine()->Float64Equal(),
+ t.machine()->Float64LessThan(),
+ t.machine()->Float64LessThanOrEqual()};
for (size_t i = 0; i < arraysize(ops); i++) {
CheckChangesAroundBinop(&t, ops[i], IrOpcode::kChangeTaggedToFloat64,
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.