| 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 4078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4089 static const intptr_t kBytesPerElement = kChunkSize; | 4089 static const intptr_t kBytesPerElement = kChunkSize; |
| 4090 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; | 4090 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
| 4091 | 4091 |
| 4092 static intptr_t InstanceSize() { return 0; } | 4092 static intptr_t InstanceSize() { return 0; } |
| 4093 | 4093 |
| 4094 static intptr_t InstanceSize(intptr_t len) { | 4094 static intptr_t InstanceSize(intptr_t len) { |
| 4095 ASSERT(0 <= len && len <= kMaxElements); | 4095 ASSERT(0 <= len && len <= kMaxElements); |
| 4096 return RoundedAllocationSize(sizeof(RawBigint) + (len * kBytesPerElement)); | 4096 return RoundedAllocationSize(sizeof(RawBigint) + (len * kBytesPerElement)); |
| 4097 } | 4097 } |
| 4098 | 4098 |
| 4099 RawBigint* ArithmeticOp(Token::Kind operation, const Bigint& other) const; | |
| 4100 | |
| 4101 protected: | 4099 protected: |
| 4102 // Only Integer::NewXXX is allowed to call Bigint::NewXXX directly. | 4100 // Only Integer::NewXXX is allowed to call Bigint::NewXXX directly. |
| 4103 friend class Integer; | 4101 friend class Integer; |
| 4104 | 4102 |
| 4103 RawBigint* BigArithmeticOp(Token::Kind operation, const Bigint& other) const; |
| 4104 |
| 4105 static RawBigint* New(const String& str, Heap::Space space = Heap::kNew); | 4105 static RawBigint* New(const String& str, Heap::Space space = Heap::kNew); |
| 4106 | 4106 |
| 4107 // Returns a canonical Bigint object allocated in the old gen space. | 4107 // Returns a canonical Bigint object allocated in the old gen space. |
| 4108 static RawBigint* NewCanonical(const String& str); | 4108 static RawBigint* NewCanonical(const String& str); |
| 4109 | 4109 |
| 4110 private: | 4110 private: |
| 4111 Chunk GetChunkAt(intptr_t i) const { | 4111 Chunk GetChunkAt(intptr_t i) const { |
| 4112 return *ChunkAddr(i); | 4112 return *ChunkAddr(i); |
| 4113 } | 4113 } |
| 4114 | 4114 |
| (...skipping 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5765 | 5765 |
| 5766 | 5766 |
| 5767 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 5767 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 5768 intptr_t index) { | 5768 intptr_t index) { |
| 5769 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 5769 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 5770 } | 5770 } |
| 5771 | 5771 |
| 5772 } // namespace dart | 5772 } // namespace dart |
| 5773 | 5773 |
| 5774 #endif // VM_OBJECT_H_ | 5774 #endif // VM_OBJECT_H_ |
| OLD | NEW |