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 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1436 }; | 1436 }; |
1437 | 1437 |
1438 | 1438 |
1439 class Function : public Object { | 1439 class Function : public Object { |
1440 public: | 1440 public: |
1441 RawString* name() const { return raw_ptr()->name_; } | 1441 RawString* name() const { return raw_ptr()->name_; } |
1442 RawString* UserVisibleName() const; | 1442 RawString* UserVisibleName() const; |
1443 RawString* QualifiedUserVisibleName() const; | 1443 RawString* QualifiedUserVisibleName() const; |
1444 virtual RawString* DictionaryName() const { return name(); } | 1444 virtual RawString* DictionaryName() const { return name(); } |
1445 | 1445 |
| 1446 RawString* GenerateSource(); |
| 1447 |
1446 // Build a string of the form 'C<T, R>(T, {b: B, c: C}) => R' representing the | 1448 // Build a string of the form 'C<T, R>(T, {b: B, c: C}) => R' representing the |
1447 // internal signature of the given function. In this example, T and R are | 1449 // internal signature of the given function. In this example, T and R are |
1448 // type parameters of class C, the owner of the function. | 1450 // type parameters of class C, the owner of the function. |
1449 RawString* Signature() const { | 1451 RawString* Signature() const { |
1450 const bool instantiate = false; | 1452 const bool instantiate = false; |
1451 return BuildSignature(instantiate, kInternalName, TypeArguments::Handle()); | 1453 return BuildSignature(instantiate, kInternalName, TypeArguments::Handle()); |
1452 } | 1454 } |
1453 | 1455 |
1454 // Build a string of the form '(T, {b: B, c: C}) => R' representing the | 1456 // Build a string of the form '(T, {b: B, c: C}) => R' representing the |
1455 // user visible signature of the given function. In this example, T and R are | 1457 // user visible signature of the given function. In this example, T and R are |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2266 | 2268 |
2267 | 2269 |
2268 class TokenStream : public Object { | 2270 class TokenStream : public Object { |
2269 public: | 2271 public: |
2270 RawArray* TokenObjects() const; | 2272 RawArray* TokenObjects() const; |
2271 void SetTokenObjects(const Array& value) const; | 2273 void SetTokenObjects(const Array& value) const; |
2272 | 2274 |
2273 RawExternalTypedData* GetStream() const; | 2275 RawExternalTypedData* GetStream() const; |
2274 void SetStream(const ExternalTypedData& stream) const; | 2276 void SetStream(const ExternalTypedData& stream) const; |
2275 | 2277 |
2276 RawString* GenerateSource() const; | 2278 RawString* GenerateSource(intptr_t start_tok_pos = 0, |
| 2279 intptr_t end_tok_pos = -1) const; |
2277 intptr_t ComputeSourcePosition(intptr_t tok_pos) const; | 2280 intptr_t ComputeSourcePosition(intptr_t tok_pos) const; |
2278 | 2281 |
2279 RawString* PrivateKey() const; | 2282 RawString* PrivateKey() const; |
2280 | 2283 |
2281 static const intptr_t kBytesPerElement = 1; | 2284 static const intptr_t kBytesPerElement = 1; |
2282 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; | 2285 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
2283 | 2286 |
2284 static intptr_t InstanceSize() { | 2287 static intptr_t InstanceSize() { |
2285 return RoundedAllocationSize(sizeof(RawTokenStream)); | 2288 return RoundedAllocationSize(sizeof(RawTokenStream)); |
2286 } | 2289 } |
(...skipping 4094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6381 | 6384 |
6382 | 6385 |
6383 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6386 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
6384 intptr_t index) { | 6387 intptr_t index) { |
6385 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6388 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
6386 } | 6389 } |
6387 | 6390 |
6388 } // namespace dart | 6391 } // namespace dart |
6389 | 6392 |
6390 #endif // VM_OBJECT_H_ | 6393 #endif // VM_OBJECT_H_ |
OLD | NEW |