| OLD | NEW |
| 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 4126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4137 | 4137 |
| 4138 class Integer : public Number { | 4138 class Integer : public Number { |
| 4139 public: | 4139 public: |
| 4140 static RawInteger* New(const String& str, Heap::Space space = Heap::kNew); | 4140 static RawInteger* New(const String& str, Heap::Space space = Heap::kNew); |
| 4141 static RawInteger* NewFromUint64( | 4141 static RawInteger* NewFromUint64( |
| 4142 uint64_t value, Heap::Space space = Heap::kNew); | 4142 uint64_t value, Heap::Space space = Heap::kNew); |
| 4143 | 4143 |
| 4144 // Returns a canonical Integer object allocated in the old gen space. | 4144 // Returns a canonical Integer object allocated in the old gen space. |
| 4145 static RawInteger* NewCanonical(const String& str); | 4145 static RawInteger* NewCanonical(const String& str); |
| 4146 | 4146 |
| 4147 static RawInteger* New(int64_t value, Heap::Space space = Heap::kNew); | 4147 // Do not throw JavascriptIntegerOverflow if 'silent' is true. |
| 4148 static RawInteger* New(int64_t value, |
| 4149 Heap::Space space = Heap::kNew, |
| 4150 const bool silent = false); |
| 4148 | 4151 |
| 4149 virtual double AsDoubleValue() const; | 4152 virtual double AsDoubleValue() const; |
| 4150 virtual int64_t AsInt64Value() const; | 4153 virtual int64_t AsInt64Value() const; |
| 4151 | 4154 |
| 4152 // Returns 0, -1 or 1. | 4155 // Returns 0, -1 or 1. |
| 4153 virtual int CompareWith(const Integer& other) const; | 4156 virtual int CompareWith(const Integer& other) const; |
| 4154 | 4157 |
| 4155 // Return the most compact presentation of an integer. | 4158 // Return the most compact presentation of an integer. |
| 4156 RawInteger* AsValidInteger() const; | 4159 RawInteger* AsValidInteger() const; |
| 4157 | 4160 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4212 } | 4215 } |
| 4213 | 4216 |
| 4214 static bool IsValid(intptr_t value) { | 4217 static bool IsValid(intptr_t value) { |
| 4215 return (value >= kMinValue) && (value <= kMaxValue); | 4218 return (value >= kMinValue) && (value <= kMaxValue); |
| 4216 } | 4219 } |
| 4217 | 4220 |
| 4218 static bool IsValid64(int64_t value) { | 4221 static bool IsValid64(int64_t value) { |
| 4219 return (value >= kMinValue) && (value <= kMaxValue); | 4222 return (value >= kMinValue) && (value <= kMaxValue); |
| 4220 } | 4223 } |
| 4221 | 4224 |
| 4222 RawInteger* ShiftOp(Token::Kind kind, const Smi& other) const; | 4225 RawInteger* ShiftOp(Token::Kind kind, |
| 4226 const Smi& other, |
| 4227 const bool silent = false) const; |
| 4223 | 4228 |
| 4224 void operator=(RawSmi* value) { | 4229 void operator=(RawSmi* value) { |
| 4225 raw_ = value; | 4230 raw_ = value; |
| 4226 CHECK_HANDLE(); | 4231 CHECK_HANDLE(); |
| 4227 } | 4232 } |
| 4228 void operator^=(RawObject* value) { | 4233 void operator^=(RawObject* value) { |
| 4229 raw_ = value; | 4234 raw_ = value; |
| 4230 CHECK_HANDLE(); | 4235 CHECK_HANDLE(); |
| 4231 } | 4236 } |
| 4232 | 4237 |
| (...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_ |
| OLD | NEW |