Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1120)

Unified Diff: src/compiler/simplified-lowering.cc

Issue 1131263002: [turbofan] Work towards fixing asm.js heap access. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/simplified-lowering.h ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index 39246df24609db6d039b5a78459cf5a97662b701..e832beb7637d6120adc9bcef0b821801e26b7b39 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -739,23 +739,6 @@ class RepresentationSelector {
}
break;
}
- case IrOpcode::kPlainPrimitiveToNumber: {
- VisitUnop(node, kMachAnyTagged, kTypeNumber | kRepTagged);
- if (lower()) {
- // PlainPrimitiveToNumber(x) => Call(ToNumberStub, x, no-context)
- Operator::Properties properties = node->op()->properties();
- Callable callable = CodeFactory::ToNumber(jsgraph_->isolate());
- CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
- CallDescriptor* desc = Linkage::GetStubCallDescriptor(
- jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0,
- flags, properties);
- node->set_op(jsgraph_->common()->Call(desc));
- node->InsertInput(jsgraph_->zone(), 0,
- jsgraph_->HeapConstant(callable.code()));
- node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant());
- }
- break;
- }
case IrOpcode::kReferenceEqual: {
VisitBinop(node, kMachAnyTagged, kRepBit);
if (lower()) node->set_op(lowering->machine()->WordEqual());
@@ -811,24 +794,8 @@ class RepresentationSelector {
ProcessInput(node, 1, kMachInt32); // offset
ProcessInput(node, 2, kMachInt32); // length
ProcessRemainingInputs(node, 3);
- // Tagged overrides everything if we have to do a typed array bounds
- // check, because we may need to return undefined then.
- MachineType output_type;
- if (use & kRepTagged) {
- output_type = kMachAnyTagged;
- } else if (use & kRepFloat64) {
- if (access.machine_type() & kRepFloat32) {
- output_type = access.machine_type();
- } else {
- output_type = kMachFloat64;
- }
- } else if (use & kRepFloat32) {
- output_type = kMachFloat32;
- } else {
- output_type = access.machine_type();
- }
- SetOutput(node, output_type);
- if (lower()) lowering->DoLoadBuffer(node, output_type, changer_);
+ SetOutput(node, access.machine_type());
+ if (lower()) lowering->DoLoadBuffer(node);
break;
}
case IrOpcode::kStoreBuffer: {
@@ -1224,61 +1191,10 @@ Node* SimplifiedLowering::ComputeIndex(const ElementAccess& access,
}
-void SimplifiedLowering::DoLoadBuffer(Node* node, MachineType output_type,
- RepresentationChanger* changer) {
+void SimplifiedLowering::DoLoadBuffer(Node* node) {
DCHECK_EQ(IrOpcode::kLoadBuffer, node->opcode());
- DCHECK_NE(kMachNone, RepresentationOf(output_type));
MachineType const type = BufferAccessOf(node->op()).machine_type();
- if (output_type != type) {
- Node* const buffer = node->InputAt(0);
- Node* const offset = node->InputAt(1);
- Node* const length = node->InputAt(2);
- Node* const effect = node->InputAt(3);
- Node* const control = node->InputAt(4);
- Node* const index =
- machine()->Is64()
- ? graph()->NewNode(machine()->ChangeUint32ToUint64(), offset)
- : offset;
-
- Node* check = graph()->NewNode(machine()->Uint32LessThan(), offset, length);
- Node* branch =
- graph()->NewNode(common()->Branch(BranchHint::kTrue), check, control);
-
- Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
- Node* etrue =
- graph()->NewNode(machine()->Load(type), buffer, index, effect, if_true);
- Node* vtrue = changer->GetRepresentationFor(etrue, type, output_type);
-
- Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
- Node* efalse = effect;
- Node* vfalse;
- if (output_type & kRepTagged) {
- vfalse = jsgraph()->UndefinedConstant();
- } else if (output_type & kRepFloat64) {
- vfalse =
- jsgraph()->Float64Constant(std::numeric_limits<double>::quiet_NaN());
- } else if (output_type & kRepFloat32) {
- vfalse =
- jsgraph()->Float32Constant(std::numeric_limits<float>::quiet_NaN());
- } else {
- vfalse = jsgraph()->Int32Constant(0);
- }
-
- Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
- Node* ephi = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, merge);
-
- // Replace effect uses of {node} with the {ephi}.
- NodeProperties::ReplaceWithValue(node, node, ephi);
-
- // Turn the {node} into a Phi.
- node->set_op(common()->Phi(output_type, 2));
- node->ReplaceInput(0, vtrue);
- node->ReplaceInput(1, vfalse);
- node->ReplaceInput(2, merge);
- node->TrimInputCount(3);
- } else {
- node->set_op(machine()->CheckedLoad(type));
- }
+ node->set_op(machine()->CheckedLoad(type));
}
« no previous file with comments | « src/compiler/simplified-lowering.h ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698