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

Unified Diff: src/compiler/machine-node-factory.h

Issue 432373002: [turbofan] Add support for Int32SubWithOverflow. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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/instruction-selector.cc ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/machine-node-factory.h
diff --git a/src/compiler/machine-node-factory.h b/src/compiler/machine-node-factory.h
index 8daae42ba8465f92f2276b2ef263cf9497b0f2a0..984d3944f9c3df7bcf2bcce4de33e4e872a1e115 100644
--- a/src/compiler/machine-node-factory.h
+++ b/src/compiler/machine-node-factory.h
@@ -85,6 +85,10 @@ class MachineNodeFactory {
return NEW_NODE_0(COMMON()->HeapConstant(val));
}
+ Node* Projection(int index, Node* a) {
+ return NEW_NODE_1(COMMON()->Projection(index), a);
+ }
+
// Memory Operations.
Node* Load(MachineRepresentation rep, Node* base) {
return Load(rep, base, Int32Constant(0));
@@ -198,12 +202,18 @@ class MachineNodeFactory {
void Int32AddWithOverflow(Node* a, Node* b, Node** val_return,
Node** ovf_return) {
Node* add = NEW_NODE_2(MACHINE()->Int32AddWithOverflow(), a, b);
- if (val_return) *val_return = NEW_NODE_1(COMMON()->Projection(0), add);
- if (ovf_return) *ovf_return = NEW_NODE_1(COMMON()->Projection(1), add);
+ if (val_return) *val_return = Projection(0, add);
+ if (ovf_return) *ovf_return = Projection(1, add);
}
Node* Int32Sub(Node* a, Node* b) {
return NEW_NODE_2(MACHINE()->Int32Sub(), a, b);
}
+ void Int32SubWithOverflow(Node* a, Node* b, Node** val_return,
+ Node** ovf_return) {
+ Node* add = NEW_NODE_2(MACHINE()->Int32SubWithOverflow(), a, b);
+ if (val_return) *val_return = Projection(0, add);
+ if (ovf_return) *ovf_return = Projection(1, add);
+ }
Node* Int32Mul(Node* a, Node* b) {
return NEW_NODE_2(MACHINE()->Int32Mul(), a, b);
}
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698