Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(910)

Side by Side Diff: runtime/vm/object.h

Issue 1071703002: Remove some duplication in code that extracts the source for a function. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 1702
1703 class Function : public Object { 1703 class Function : public Object {
1704 public: 1704 public:
1705 RawString* name() const { return raw_ptr()->name_; } 1705 RawString* name() const { return raw_ptr()->name_; }
1706 RawString* PrettyName() const; 1706 RawString* PrettyName() const;
1707 RawString* UserVisibleName() const; 1707 RawString* UserVisibleName() const;
1708 RawString* QualifiedPrettyName() const; 1708 RawString* QualifiedPrettyName() const;
1709 RawString* QualifiedUserVisibleName() const; 1709 RawString* QualifiedUserVisibleName() const;
1710 virtual RawString* DictionaryName() const { return name(); } 1710 virtual RawString* DictionaryName() const { return name(); }
1711 1711
1712 RawString* GetSource(); 1712 RawString* GetSource() const;
1713 1713
1714 // Build a string of the form 'C<T, R>(T, {b: B, c: C}) => R' representing the 1714 // Build a string of the form 'C<T, R>(T, {b: B, c: C}) => R' representing the
1715 // internal signature of the given function. In this example, T and R are 1715 // internal signature of the given function. In this example, T and R are
1716 // type parameters of class C, the owner of the function. 1716 // type parameters of class C, the owner of the function.
1717 RawString* Signature() const { 1717 RawString* Signature() const {
1718 const bool instantiate = false; 1718 const bool instantiate = false;
1719 return BuildSignature(instantiate, kInternalName, TypeArguments::Handle()); 1719 return BuildSignature(instantiate, kInternalName, TypeArguments::Handle());
1720 } 1720 }
1721 1721
1722 RawString* PrettySignature() const { 1722 RawString* PrettySignature() const {
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
2783 const char* GetKindAsCString() const; 2783 const char* GetKindAsCString() const;
2784 intptr_t line_offset() const { return raw_ptr()->line_offset_; } 2784 intptr_t line_offset() const { return raw_ptr()->line_offset_; }
2785 intptr_t col_offset() const { return raw_ptr()->col_offset_; } 2785 intptr_t col_offset() const { return raw_ptr()->col_offset_; }
2786 2786
2787 RawTokenStream* tokens() const { return raw_ptr()->tokens_; } 2787 RawTokenStream* tokens() const { return raw_ptr()->tokens_; }
2788 2788
2789 void Tokenize(const String& private_key) const; 2789 void Tokenize(const String& private_key) const;
2790 2790
2791 RawLibrary* FindLibrary() const; 2791 RawLibrary* FindLibrary() const;
2792 RawString* GetLine(intptr_t line_number) const; 2792 RawString* GetLine(intptr_t line_number) const;
2793 RawString* GetSnippet(intptr_t from_token_pos,
2794 intptr_t to_token_pos) const;
2795 RawString* GetSnippet(intptr_t from_line, 2793 RawString* GetSnippet(intptr_t from_line,
2796 intptr_t from_column, 2794 intptr_t from_column,
2797 intptr_t to_line, 2795 intptr_t to_line,
2798 intptr_t to_column) const; 2796 intptr_t to_column) const;
2799 2797
2800 void SetLocationOffset(intptr_t line_offset, intptr_t col_offset) const; 2798 void SetLocationOffset(intptr_t line_offset, intptr_t col_offset) const;
2801 2799
2802 void GetTokenLocation(intptr_t token_pos, 2800 void GetTokenLocation(intptr_t token_pos,
2803 intptr_t* line, intptr_t* column) const; 2801 intptr_t* line, intptr_t* column) const;
2804 2802
(...skipping 5032 matching lines...) Expand 10 before | Expand all | Expand 10 after
7837 7835
7838 7836
7839 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7837 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7840 intptr_t index) { 7838 intptr_t index) {
7841 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7839 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7842 } 7840 }
7843 7841
7844 } // namespace dart 7842 } // namespace dart
7845 7843
7846 #endif // VM_OBJECT_H_ 7844 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698