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 4921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4932 | 4932 |
4933 OBJECT_IMPLEMENTATION(Integer, Number); | 4933 OBJECT_IMPLEMENTATION(Integer, Number); |
4934 friend class Class; | 4934 friend class Class; |
4935 }; | 4935 }; |
4936 | 4936 |
4937 | 4937 |
4938 class Smi : public Integer { | 4938 class Smi : public Integer { |
4939 public: | 4939 public: |
4940 static const intptr_t kBits = kSmiBits; | 4940 static const intptr_t kBits = kSmiBits; |
4941 static const intptr_t kMaxValue = kSmiMax; | 4941 static const intptr_t kMaxValue = kSmiMax; |
4942 static const intptr_t kMinValue = kSmiMin; | 4942 static const intptr_t kMinValue = kSmiMin; |
4943 | 4943 |
4944 intptr_t Value() const { | 4944 intptr_t Value() const { |
4945 return ValueFromRaw(raw_value()); | 4945 return ValueFromRaw(raw_value()); |
4946 } | 4946 } |
4947 | 4947 |
4948 virtual bool Equals(const Instance& other) const; | 4948 virtual bool Equals(const Instance& other) const; |
4949 virtual bool IsZero() const { return Value() == 0; } | 4949 virtual bool IsZero() const { return Value() == 0; } |
4950 virtual bool IsNegative() const { return Value() < 0; } | 4950 virtual bool IsNegative() const { return Value() < 0; } |
4951 // Smi values are implicitly canonicalized. | 4951 // Smi values are implicitly canonicalized. |
4952 virtual RawInstance* CheckAndCanonicalize(const char** error_str) const { | 4952 virtual RawInstance* CheckAndCanonicalize(const char** error_str) const { |
(...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7069 | 7069 |
7070 | 7070 |
7071 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 7071 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
7072 intptr_t index) { | 7072 intptr_t index) { |
7073 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 7073 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
7074 } | 7074 } |
7075 | 7075 |
7076 } // namespace dart | 7076 } // namespace dart |
7077 | 7077 |
7078 #endif // VM_OBJECT_H_ | 7078 #endif // VM_OBJECT_H_ |
OLD | NEW |