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 RUNTIME_VM_OBJECT_H_ | 5 #ifndef RUNTIME_VM_OBJECT_H_ |
6 #define RUNTIME_VM_OBJECT_H_ | 6 #define RUNTIME_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 4918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4929 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; | 4929 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
4930 | 4930 |
4931 static intptr_t InstanceSize() { | 4931 static intptr_t InstanceSize() { |
4932 ASSERT(sizeof(RawCode) == OFFSET_OF_RETURNED_VALUE(RawCode, data)); | 4932 ASSERT(sizeof(RawCode) == OFFSET_OF_RETURNED_VALUE(RawCode, data)); |
4933 return 0; | 4933 return 0; |
4934 } | 4934 } |
4935 static intptr_t InstanceSize(intptr_t len) { | 4935 static intptr_t InstanceSize(intptr_t len) { |
4936 ASSERT(0 <= len && len <= kMaxElements); | 4936 ASSERT(0 <= len && len <= kMaxElements); |
4937 return RoundedAllocationSize(sizeof(RawCode) + (len * kBytesPerElement)); | 4937 return RoundedAllocationSize(sizeof(RawCode) + (len * kBytesPerElement)); |
4938 } | 4938 } |
| 4939 #if !defined(DART_PRECOMPILED_RUNTIME) |
4939 static RawCode* FinalizeCode(const Function& function, | 4940 static RawCode* FinalizeCode(const Function& function, |
4940 Assembler* assembler, | 4941 Assembler* assembler, |
4941 bool optimized = false); | 4942 bool optimized = false); |
4942 static RawCode* FinalizeCode(const char* name, | 4943 static RawCode* FinalizeCode(const char* name, |
4943 Assembler* assembler, | 4944 Assembler* assembler, |
4944 bool optimized); | 4945 bool optimized); |
| 4946 #endif |
4945 static RawCode* LookupCode(uword pc); | 4947 static RawCode* LookupCode(uword pc); |
4946 static RawCode* LookupCodeInVmIsolate(uword pc); | 4948 static RawCode* LookupCodeInVmIsolate(uword pc); |
4947 static RawCode* FindCode(uword pc, int64_t timestamp); | 4949 static RawCode* FindCode(uword pc, int64_t timestamp); |
4948 | 4950 |
4949 int32_t GetPointerOffsetAt(int index) const { | 4951 int32_t GetPointerOffsetAt(int index) const { |
4950 NoSafepointScope no_safepoint; | 4952 NoSafepointScope no_safepoint; |
4951 return *PointerOffsetAddrAt(index); | 4953 return *PointerOffsetAddrAt(index); |
4952 } | 4954 } |
4953 TokenPosition GetTokenIndexOfPC(uword pc) const; | 4955 TokenPosition GetTokenIndexOfPC(uword pc) const; |
4954 | 4956 |
(...skipping 4067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9022 | 9024 |
9023 inline void TypeArguments::SetHash(intptr_t value) const { | 9025 inline void TypeArguments::SetHash(intptr_t value) const { |
9024 // This is only safe because we create a new Smi, which does not cause | 9026 // This is only safe because we create a new Smi, which does not cause |
9025 // heap allocation. | 9027 // heap allocation. |
9026 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); | 9028 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); |
9027 } | 9029 } |
9028 | 9030 |
9029 } // namespace dart | 9031 } // namespace dart |
9030 | 9032 |
9031 #endif // RUNTIME_VM_OBJECT_H_ | 9033 #endif // RUNTIME_VM_OBJECT_H_ |
OLD | NEW |