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

Unified Diff: src/compiler/node-matchers.h

Issue 1310633004: Read all integer op parameters using a signed integer type. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | src/compiler/representation-change.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/node-matchers.h
diff --git a/src/compiler/node-matchers.h b/src/compiler/node-matchers.h
index d543425fca48606a0947291dc13bda6ecaa1c9cd..749b03cc2d670bba300f6f701a2392ac4e4f3766 100644
--- a/src/compiler/node-matchers.h
+++ b/src/compiler/node-matchers.h
@@ -77,6 +77,18 @@ struct ValueMatcher : public NodeMatcher {
template <>
+inline ValueMatcher<uint32_t, IrOpcode::kInt32Constant>::ValueMatcher(
+ Node* node)
+ : NodeMatcher(node),
+ value_(),
+ has_value_(opcode() == IrOpcode::kInt32Constant) {
+ if (has_value_) {
+ value_ = static_cast<uint32_t>(OpParameter<int32_t>(node));
+ }
+}
+
+
+template <>
inline ValueMatcher<int64_t, IrOpcode::kInt64Constant>::ValueMatcher(Node* node)
: NodeMatcher(node), value_(), has_value_(false) {
if (opcode() == IrOpcode::kInt32Constant) {
@@ -94,10 +106,10 @@ inline ValueMatcher<uint64_t, IrOpcode::kInt64Constant>::ValueMatcher(
Node* node)
: NodeMatcher(node), value_(), has_value_(false) {
if (opcode() == IrOpcode::kInt32Constant) {
- value_ = OpParameter<uint32_t>(node);
+ value_ = static_cast<uint32_t>(OpParameter<int32_t>(node));
has_value_ = true;
} else if (opcode() == IrOpcode::kInt64Constant) {
- value_ = OpParameter<uint64_t>(node);
+ value_ = static_cast<uint64_t>(OpParameter<int64_t>(node));
has_value_ = true;
}
}
« no previous file with comments | « no previous file | src/compiler/representation-change.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698