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 4936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4947 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; | 4947 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
4948 | 4948 |
4949 static intptr_t InstanceSize() { | 4949 static intptr_t InstanceSize() { |
4950 ASSERT(sizeof(RawCode) == OFFSET_OF_RETURNED_VALUE(RawCode, data)); | 4950 ASSERT(sizeof(RawCode) == OFFSET_OF_RETURNED_VALUE(RawCode, data)); |
4951 return 0; | 4951 return 0; |
4952 } | 4952 } |
4953 static intptr_t InstanceSize(intptr_t len) { | 4953 static intptr_t InstanceSize(intptr_t len) { |
4954 ASSERT(0 <= len && len <= kMaxElements); | 4954 ASSERT(0 <= len && len <= kMaxElements); |
4955 return RoundedAllocationSize(sizeof(RawCode) + (len * kBytesPerElement)); | 4955 return RoundedAllocationSize(sizeof(RawCode) + (len * kBytesPerElement)); |
4956 } | 4956 } |
| 4957 #if !defined(DART_PRECOMPILED_RUNTIME) |
4957 static RawCode* FinalizeCode(const Function& function, | 4958 static RawCode* FinalizeCode(const Function& function, |
4958 Assembler* assembler, | 4959 Assembler* assembler, |
4959 bool optimized = false); | 4960 bool optimized = false); |
4960 static RawCode* FinalizeCode(const char* name, | 4961 static RawCode* FinalizeCode(const char* name, |
4961 Assembler* assembler, | 4962 Assembler* assembler, |
4962 bool optimized); | 4963 bool optimized); |
| 4964 #endif |
4963 static RawCode* LookupCode(uword pc); | 4965 static RawCode* LookupCode(uword pc); |
4964 static RawCode* LookupCodeInVmIsolate(uword pc); | 4966 static RawCode* LookupCodeInVmIsolate(uword pc); |
4965 static RawCode* FindCode(uword pc, int64_t timestamp); | 4967 static RawCode* FindCode(uword pc, int64_t timestamp); |
4966 | 4968 |
4967 int32_t GetPointerOffsetAt(int index) const { | 4969 int32_t GetPointerOffsetAt(int index) const { |
4968 NoSafepointScope no_safepoint; | 4970 NoSafepointScope no_safepoint; |
4969 return *PointerOffsetAddrAt(index); | 4971 return *PointerOffsetAddrAt(index); |
4970 } | 4972 } |
4971 TokenPosition GetTokenIndexOfPC(uword pc) const; | 4973 TokenPosition GetTokenIndexOfPC(uword pc) const; |
4972 | 4974 |
(...skipping 4025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8998 | 9000 |
8999 inline void TypeArguments::SetHash(intptr_t value) const { | 9001 inline void TypeArguments::SetHash(intptr_t value) const { |
9000 // This is only safe because we create a new Smi, which does not cause | 9002 // This is only safe because we create a new Smi, which does not cause |
9001 // heap allocation. | 9003 // heap allocation. |
9002 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); | 9004 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); |
9003 } | 9005 } |
9004 | 9006 |
9005 } // namespace dart | 9007 } // namespace dart |
9006 | 9008 |
9007 #endif // RUNTIME_VM_OBJECT_H_ | 9009 #endif // RUNTIME_VM_OBJECT_H_ |
OLD | NEW |