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

Unified Diff: runtime/vm/ast.h

Issue 22640019: Fix for running with --throw_on_javascript_int_overflow: recognize pattern (a << b) & mask and test… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/lib/object_patch.dart ('k') | runtime/vm/ast_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.h
===================================================================
--- runtime/vm/ast.h (revision 26025)
+++ runtime/vm/ast.h (working copy)
@@ -569,7 +569,11 @@
Token::Kind kind,
AstNode* left,
AstNode* right)
- : AstNode(token_pos), kind_(kind), left_(left), right_(right) {
+ : AstNode(token_pos),
+ kind_(kind),
+ left_(left),
+ right_(right),
+ mask32_(-1) {
ASSERT(left_ != NULL);
ASSERT(right_ != NULL);
ASSERT(IsKindValid());
@@ -579,6 +583,17 @@
AstNode* left() const { return left_; }
AstNode* right() const { return right_; }
+ // The optional 32-bit mask must be a an unsigned 32-bit value.
+ bool has_mask32() const { return mask32_ >= 0; }
+ int64_t mask32() const {
+ ASSERT(has_mask32());
+ return mask32_;
+ }
+ void set_mask32(int64_t value) {
+ ASSERT(Utils::IsUint(32, value));
+ mask32_ = value;
+ }
+
virtual void VisitChildren(AstNodeVisitor* visitor) const {
left()->Visit(visitor);
right()->Visit(visitor);
@@ -594,6 +609,8 @@
const Token::Kind kind_;
AstNode* left_;
AstNode* right_;
+ // Optional unsigned 32 bit mask applied on result. No mask: -1.
+ int64_t mask32_;
Florian Schneider 2013/08/13 15:29:52 I think it would be cleaner to have a separate AST
srdjan 2013/08/13 18:44:59 Done.
bool IsKindValid() const;
« no previous file with comments | « runtime/lib/object_patch.dart ('k') | runtime/vm/ast_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698