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

Side by Side Diff: runtime/vm/object.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 4117 matching lines...) Expand 10 before | Expand all | Expand 10 after
4128 4128
4129 class Integer : public Number { 4129 class Integer : public Number {
4130 public: 4130 public:
4131 static RawInteger* New(const String& str, Heap::Space space = Heap::kNew); 4131 static RawInteger* New(const String& str, Heap::Space space = Heap::kNew);
4132 static RawInteger* NewFromUint64( 4132 static RawInteger* NewFromUint64(
4133 uint64_t value, Heap::Space space = Heap::kNew); 4133 uint64_t value, Heap::Space space = Heap::kNew);
4134 4134
4135 // Returns a canonical Integer object allocated in the old gen space. 4135 // Returns a canonical Integer object allocated in the old gen space.
4136 static RawInteger* NewCanonical(const String& str); 4136 static RawInteger* NewCanonical(const String& str);
4137 4137
4138 static RawInteger* New(int64_t value, Heap::Space space = Heap::kNew); 4138 // Do not throw JavascriptIntegerOverflow if 'silent' is true.
4139 static RawInteger* New(int64_t value,
4140 Heap::Space space = Heap::kNew,
4141 const bool silent = false);
4139 4142
4140 virtual double AsDoubleValue() const; 4143 virtual double AsDoubleValue() const;
4141 virtual int64_t AsInt64Value() const; 4144 virtual int64_t AsInt64Value() const;
4142 4145
4143 // Returns 0, -1 or 1. 4146 // Returns 0, -1 or 1.
4144 virtual int CompareWith(const Integer& other) const; 4147 virtual int CompareWith(const Integer& other) const;
4145 4148
4146 // Return the most compact presentation of an integer. 4149 // Return the most compact presentation of an integer.
4147 RawInteger* AsValidInteger() const; 4150 RawInteger* AsValidInteger() const;
4148 4151
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
4203 } 4206 }
4204 4207
4205 static bool IsValid(intptr_t value) { 4208 static bool IsValid(intptr_t value) {
4206 return (value >= kMinValue) && (value <= kMaxValue); 4209 return (value >= kMinValue) && (value <= kMaxValue);
4207 } 4210 }
4208 4211
4209 static bool IsValid64(int64_t value) { 4212 static bool IsValid64(int64_t value) {
4210 return (value >= kMinValue) && (value <= kMaxValue); 4213 return (value >= kMinValue) && (value <= kMaxValue);
4211 } 4214 }
4212 4215
4213 RawInteger* ShiftOp(Token::Kind kind, const Smi& other) const; 4216 RawInteger* ShiftOp(Token::Kind kind,
4217 const Smi& other,
4218 const bool silent = false) const;
4214 4219
4215 void operator=(RawSmi* value) { 4220 void operator=(RawSmi* value) {
4216 raw_ = value; 4221 raw_ = value;
4217 CHECK_HANDLE(); 4222 CHECK_HANDLE();
4218 } 4223 }
4219 void operator^=(RawObject* value) { 4224 void operator^=(RawObject* value) {
4220 raw_ = value; 4225 raw_ = value;
4221 CHECK_HANDLE(); 4226 CHECK_HANDLE();
4222 } 4227 }
4223 4228
(...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after
6049 6054
6050 6055
6051 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6056 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6052 intptr_t index) { 6057 intptr_t index) {
6053 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6058 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6054 } 6059 }
6055 6060
6056 } // namespace dart 6061 } // namespace dart
6057 6062
6058 #endif // VM_OBJECT_H_ 6063 #endif // VM_OBJECT_H_
OLDNEW
« runtime/vm/ast.h ('K') | « runtime/vm/intermediate_language.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698