[turbofan] Fix a couple of invalid Uint32Constant/Int32Constant uses.
The contract for TurboFan is that we use NumberConstants for any kind of number value until the representation selection picks concrete representations, i.e. Int32Constant or Float64Constant. We will soon be able to also guard this contract with DCHECKs. BUG=v8:5267 R=yangguo@chromium.org Review-Url: https://codereview.chromium.org/2499573002 Cr-Commit-Position: refs/heads/master@{#40908}
This commit is contained in:
parent
c7ebb14c3c
commit
4ee6fdf38b
@ -1116,11 +1116,11 @@ Reduction JSBuiltinReducer::ReduceStringIteratorNext(Node* node) {
|
||||
index, if_true0);
|
||||
|
||||
// branch1: if ((lead & 0xFC00) === 0xD800)
|
||||
Node* check1 = graph()->NewNode(
|
||||
simplified()->NumberEqual(),
|
||||
graph()->NewNode(simplified()->NumberBitwiseAnd(), lead,
|
||||
jsgraph()->Int32Constant(0xFC00)),
|
||||
jsgraph()->Int32Constant(0xD800));
|
||||
Node* check1 =
|
||||
graph()->NewNode(simplified()->NumberEqual(),
|
||||
graph()->NewNode(simplified()->NumberBitwiseAnd(),
|
||||
lead, jsgraph()->Constant(0xFC00)),
|
||||
jsgraph()->Constant(0xD800));
|
||||
Node* branch1 = graph()->NewNode(common()->Branch(BranchHint::kFalse),
|
||||
check1, if_true0);
|
||||
Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1);
|
||||
@ -1142,8 +1142,8 @@ Reduction JSBuiltinReducer::ReduceStringIteratorNext(Node* node) {
|
||||
Node* check3 = graph()->NewNode(
|
||||
simplified()->NumberEqual(),
|
||||
graph()->NewNode(simplified()->NumberBitwiseAnd(), trail,
|
||||
jsgraph()->Int32Constant(0xFC00)),
|
||||
jsgraph()->Int32Constant(0xDC00));
|
||||
jsgraph()->Constant(0xFC00)),
|
||||
jsgraph()->Constant(0xDC00));
|
||||
Node* branch3 = graph()->NewNode(common()->Branch(BranchHint::kTrue),
|
||||
check3, if_true2);
|
||||
Node* if_true3 = graph()->NewNode(common()->IfTrue(), branch3);
|
||||
@ -1154,11 +1154,11 @@ Reduction JSBuiltinReducer::ReduceStringIteratorNext(Node* node) {
|
||||
// Need to swap the order for big-endian platforms
|
||||
#if V8_TARGET_BIG_ENDIAN
|
||||
graph()->NewNode(simplified()->NumberShiftLeft(), lead,
|
||||
jsgraph()->Int32Constant(16)),
|
||||
jsgraph()->Constant(16)),
|
||||
trail);
|
||||
#else
|
||||
graph()->NewNode(simplified()->NumberShiftLeft(), trail,
|
||||
jsgraph()->Int32Constant(16)),
|
||||
jsgraph()->Constant(16)),
|
||||
lead);
|
||||
#endif
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ Reduction JSCreateLowering::ReduceNewArrayToStubCall(
|
||||
CallDescriptor::kNeedsFrameState);
|
||||
node->ReplaceInput(0, jsgraph()->HeapConstant(stub.GetCode()));
|
||||
node->InsertInput(graph()->zone(), 2, jsgraph()->HeapConstant(site));
|
||||
node->InsertInput(graph()->zone(), 3, jsgraph()->Int32Constant(0));
|
||||
node->InsertInput(graph()->zone(), 3, jsgraph()->Constant(0));
|
||||
node->InsertInput(graph()->zone(), 4, jsgraph()->UndefinedConstant());
|
||||
NodeProperties::ChangeOp(node, common()->Call(desc));
|
||||
return Changed(node);
|
||||
@ -529,7 +529,7 @@ Reduction JSCreateLowering::ReduceNewArrayToStubCall(
|
||||
CallDescriptor::kNeedsFrameState);
|
||||
node->ReplaceInput(0, jsgraph()->HeapConstant(stub.GetCode()));
|
||||
node->InsertInput(graph()->zone(), 2, jsgraph()->HeapConstant(site));
|
||||
node->InsertInput(graph()->zone(), 3, jsgraph()->Int32Constant(1));
|
||||
node->InsertInput(graph()->zone(), 3, jsgraph()->Constant(1));
|
||||
node->InsertInput(graph()->zone(), 4, jsgraph()->UndefinedConstant());
|
||||
NodeProperties::ChangeOp(node, common()->Call(desc));
|
||||
return Changed(node);
|
||||
@ -560,7 +560,7 @@ Reduction JSCreateLowering::ReduceNewArrayToStubCall(
|
||||
Node* inputs[] = {jsgraph()->HeapConstant(stub.GetCode()),
|
||||
node->InputAt(1),
|
||||
jsgraph()->HeapConstant(site),
|
||||
jsgraph()->Int32Constant(1),
|
||||
jsgraph()->Constant(1),
|
||||
jsgraph()->UndefinedConstant(),
|
||||
length,
|
||||
context,
|
||||
@ -584,7 +584,7 @@ Reduction JSCreateLowering::ReduceNewArrayToStubCall(
|
||||
Node* inputs[] = {jsgraph()->HeapConstant(stub.GetCode()),
|
||||
node->InputAt(1),
|
||||
jsgraph()->HeapConstant(site),
|
||||
jsgraph()->Int32Constant(1),
|
||||
jsgraph()->Constant(1),
|
||||
jsgraph()->UndefinedConstant(),
|
||||
length,
|
||||
context,
|
||||
@ -615,7 +615,7 @@ Reduction JSCreateLowering::ReduceNewArrayToStubCall(
|
||||
CallDescriptor::kNeedsFrameState);
|
||||
node->ReplaceInput(0, jsgraph()->HeapConstant(stub.GetCode()));
|
||||
node->InsertInput(graph()->zone(), 2, jsgraph()->HeapConstant(site));
|
||||
node->InsertInput(graph()->zone(), 3, jsgraph()->Int32Constant(arity));
|
||||
node->InsertInput(graph()->zone(), 3, jsgraph()->Constant(arity));
|
||||
node->InsertInput(graph()->zone(), 4, jsgraph()->UndefinedConstant());
|
||||
NodeProperties::ChangeOp(node, common()->Call(desc));
|
||||
return Changed(node);
|
||||
|
@ -116,7 +116,7 @@ Reduction JSInliner::InlineCall(Node* call, Node* new_target, Node* context,
|
||||
Replace(use, new_target);
|
||||
} else if (index == inlinee_arity_index) {
|
||||
// The projection is requesting the number of arguments.
|
||||
Replace(use, jsgraph()->Int32Constant(inliner_inputs - 2));
|
||||
Replace(use, jsgraph()->Constant(inliner_inputs - 2));
|
||||
} else if (index == inlinee_context_index) {
|
||||
// The projection is requesting the inlinee function context.
|
||||
Replace(use, context);
|
||||
|
@ -672,7 +672,7 @@ Reduction JSTypedLowering::ReduceCreateConsString(Node* node) {
|
||||
value, value_map, effect, control);
|
||||
effect = graph()->NewNode(
|
||||
simplified()->StoreField(AccessBuilder::ForNameHashField()), value,
|
||||
jsgraph()->Uint32Constant(Name::kEmptyHashField), effect, control);
|
||||
jsgraph()->Constant(Name::kEmptyHashField), effect, control);
|
||||
effect = graph()->NewNode(
|
||||
simplified()->StoreField(AccessBuilder::ForStringLength()), value, length,
|
||||
effect, control);
|
||||
@ -1849,7 +1849,7 @@ Reduction JSTypedLowering::ReduceJSCallConstruct(Node* node) {
|
||||
node->InsertInput(graph()->zone(), 0,
|
||||
jsgraph()->HeapConstant(callable.code()));
|
||||
node->InsertInput(graph()->zone(), 2, new_target);
|
||||
node->InsertInput(graph()->zone(), 3, jsgraph()->Int32Constant(arity));
|
||||
node->InsertInput(graph()->zone(), 3, jsgraph()->Constant(arity));
|
||||
node->InsertInput(graph()->zone(), 4, jsgraph()->UndefinedConstant());
|
||||
node->InsertInput(graph()->zone(), 5, jsgraph()->UndefinedConstant());
|
||||
NodeProperties::ChangeOp(
|
||||
@ -1868,7 +1868,7 @@ Reduction JSTypedLowering::ReduceJSCallConstruct(Node* node) {
|
||||
node->InsertInput(graph()->zone(), 0,
|
||||
jsgraph()->HeapConstant(callable.code()));
|
||||
node->InsertInput(graph()->zone(), 2, new_target);
|
||||
node->InsertInput(graph()->zone(), 3, jsgraph()->Int32Constant(arity));
|
||||
node->InsertInput(graph()->zone(), 3, jsgraph()->Constant(arity));
|
||||
node->InsertInput(graph()->zone(), 4, jsgraph()->UndefinedConstant());
|
||||
NodeProperties::ChangeOp(
|
||||
node, common()->Call(Linkage::GetStubCallDescriptor(
|
||||
@ -1939,7 +1939,7 @@ Reduction JSTypedLowering::ReduceJSCallFunction(Node* node) {
|
||||
}
|
||||
|
||||
Node* new_target = jsgraph()->UndefinedConstant();
|
||||
Node* argument_count = jsgraph()->Int32Constant(arity);
|
||||
Node* argument_count = jsgraph()->Constant(arity);
|
||||
if (NeedsArgumentAdaptorFrame(shared, arity)) {
|
||||
// Patch {node} to an indirect call via the ArgumentsAdaptorTrampoline.
|
||||
Callable callable = CodeFactory::ArgumentAdaptor(isolate());
|
||||
@ -1949,7 +1949,7 @@ Reduction JSTypedLowering::ReduceJSCallFunction(Node* node) {
|
||||
node->InsertInput(graph()->zone(), 3, argument_count);
|
||||
node->InsertInput(
|
||||
graph()->zone(), 4,
|
||||
jsgraph()->Int32Constant(shared->internal_formal_parameter_count()));
|
||||
jsgraph()->Constant(shared->internal_formal_parameter_count()));
|
||||
NodeProperties::ChangeOp(
|
||||
node, common()->Call(Linkage::GetStubCallDescriptor(
|
||||
isolate(), graph()->zone(), callable.descriptor(),
|
||||
@ -1981,7 +1981,7 @@ Reduction JSTypedLowering::ReduceJSCallFunction(Node* node) {
|
||||
Callable callable = CodeFactory::CallFunction(isolate(), convert_mode);
|
||||
node->InsertInput(graph()->zone(), 0,
|
||||
jsgraph()->HeapConstant(callable.code()));
|
||||
node->InsertInput(graph()->zone(), 2, jsgraph()->Int32Constant(arity));
|
||||
node->InsertInput(graph()->zone(), 2, jsgraph()->Constant(arity));
|
||||
NodeProperties::ChangeOp(
|
||||
node, common()->Call(Linkage::GetStubCallDescriptor(
|
||||
isolate(), graph()->zone(), callable.descriptor(), 1 + arity,
|
||||
|
Loading…
Reference in New Issue
Block a user