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

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

Issue 2591823002: Introduce a SignatureData class so that signature functions can store both their (Closed)
Patch Set: address comments Created 3 years, 12 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
« no previous file with comments | « runtime/vm/clustered_snapshot.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 static void set_vm_isolate_snapshot_object_table(const Array& table); 481 static void set_vm_isolate_snapshot_object_table(const Array& table);
482 482
483 static RawClass* class_class() { return class_class_; } 483 static RawClass* class_class() { return class_class_; }
484 static RawClass* dynamic_class() { return dynamic_class_; } 484 static RawClass* dynamic_class() { return dynamic_class_; }
485 static RawClass* void_class() { return void_class_; } 485 static RawClass* void_class() { return void_class_; }
486 static RawClass* unresolved_class_class() { return unresolved_class_class_; } 486 static RawClass* unresolved_class_class() { return unresolved_class_class_; }
487 static RawClass* type_arguments_class() { return type_arguments_class_; } 487 static RawClass* type_arguments_class() { return type_arguments_class_; }
488 static RawClass* patch_class_class() { return patch_class_class_; } 488 static RawClass* patch_class_class() { return patch_class_class_; }
489 static RawClass* function_class() { return function_class_; } 489 static RawClass* function_class() { return function_class_; }
490 static RawClass* closure_data_class() { return closure_data_class_; } 490 static RawClass* closure_data_class() { return closure_data_class_; }
491 static RawClass* signature_data_class() { return signature_data_class_; }
491 static RawClass* redirection_data_class() { return redirection_data_class_; } 492 static RawClass* redirection_data_class() { return redirection_data_class_; }
492 static RawClass* field_class() { return field_class_; } 493 static RawClass* field_class() { return field_class_; }
493 static RawClass* literal_token_class() { return literal_token_class_; } 494 static RawClass* literal_token_class() { return literal_token_class_; }
494 static RawClass* token_stream_class() { return token_stream_class_; } 495 static RawClass* token_stream_class() { return token_stream_class_; }
495 static RawClass* script_class() { return script_class_; } 496 static RawClass* script_class() { return script_class_; }
496 static RawClass* library_class() { return library_class_; } 497 static RawClass* library_class() { return library_class_; }
497 static RawClass* namespace_class() { return namespace_class_; } 498 static RawClass* namespace_class() { return namespace_class_; }
498 static RawClass* code_class() { return code_class_; } 499 static RawClass* code_class() { return code_class_; }
499 static RawClass* instructions_class() { return instructions_class_; } 500 static RawClass* instructions_class() { return instructions_class_; }
500 static RawClass* object_pool_class() { return object_pool_class_; } 501 static RawClass* object_pool_class() { return object_pool_class_; }
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 static RawObject* null_; 739 static RawObject* null_;
739 740
740 static RawClass* class_class_; // Class of the Class vm object. 741 static RawClass* class_class_; // Class of the Class vm object.
741 static RawClass* dynamic_class_; // Class of the 'dynamic' type. 742 static RawClass* dynamic_class_; // Class of the 'dynamic' type.
742 static RawClass* void_class_; // Class of the 'void' type. 743 static RawClass* void_class_; // Class of the 'void' type.
743 static RawClass* unresolved_class_class_; // Class of UnresolvedClass. 744 static RawClass* unresolved_class_class_; // Class of UnresolvedClass.
744 static RawClass* type_arguments_class_; // Class of TypeArguments vm object. 745 static RawClass* type_arguments_class_; // Class of TypeArguments vm object.
745 static RawClass* patch_class_class_; // Class of the PatchClass vm object. 746 static RawClass* patch_class_class_; // Class of the PatchClass vm object.
746 static RawClass* function_class_; // Class of the Function vm object. 747 static RawClass* function_class_; // Class of the Function vm object.
747 static RawClass* closure_data_class_; // Class of ClosureData vm obj. 748 static RawClass* closure_data_class_; // Class of ClosureData vm obj.
749 static RawClass* signature_data_class_; // Class of SignatureData vm obj.
748 static RawClass* redirection_data_class_; // Class of RedirectionData vm obj. 750 static RawClass* redirection_data_class_; // Class of RedirectionData vm obj.
749 static RawClass* field_class_; // Class of the Field vm object. 751 static RawClass* field_class_; // Class of the Field vm object.
750 static RawClass* literal_token_class_; // Class of LiteralToken vm object. 752 static RawClass* literal_token_class_; // Class of LiteralToken vm object.
751 static RawClass* token_stream_class_; // Class of the TokenStream vm object. 753 static RawClass* token_stream_class_; // Class of the TokenStream vm object.
752 static RawClass* script_class_; // Class of the Script vm object. 754 static RawClass* script_class_; // Class of the Script vm object.
753 static RawClass* library_class_; // Class of the Library vm object. 755 static RawClass* library_class_; // Class of the Library vm object.
754 static RawClass* namespace_class_; // Class of Namespace vm object. 756 static RawClass* namespace_class_; // Class of Namespace vm object.
755 static RawClass* code_class_; // Class of the Code vm object. 757 static RawClass* code_class_; // Class of the Code vm object.
756 static RawClass* instructions_class_; // Class of the Instructions vm object. 758 static RawClass* instructions_class_; // Class of the Instructions vm object.
757 static RawClass* object_pool_class_; // Class of the ObjectPool vm object. 759 static RawClass* object_pool_class_; // Class of the ObjectPool vm object.
(...skipping 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after
3015 3017
3016 static RawClosureData* New(); 3018 static RawClosureData* New();
3017 3019
3018 FINAL_HEAP_OBJECT_IMPLEMENTATION(ClosureData, Object); 3020 FINAL_HEAP_OBJECT_IMPLEMENTATION(ClosureData, Object);
3019 friend class Class; 3021 friend class Class;
3020 friend class Function; 3022 friend class Function;
3021 friend class HeapProfiler; 3023 friend class HeapProfiler;
3022 }; 3024 };
3023 3025
3024 3026
3027 class SignatureData : public Object {
3028 public:
3029 static intptr_t InstanceSize() {
3030 return RoundedAllocationSize(sizeof(RawSignatureData));
3031 }
3032
3033 private:
3034 // Enclosing function of this signature function.
3035 RawFunction* parent_function() const { return raw_ptr()->parent_function_; }
3036 void set_parent_function(const Function& value) const;
3037
3038 // Signature type of this signature function.
3039 RawType* signature_type() const { return raw_ptr()->signature_type_; }
3040 void set_signature_type(const Type& value) const;
3041
3042 static RawSignatureData* New();
3043
3044 FINAL_HEAP_OBJECT_IMPLEMENTATION(SignatureData, Object);
3045 friend class Class;
3046 friend class Function;
3047 friend class HeapProfiler;
3048 };
3049
3050
3025 class RedirectionData : public Object { 3051 class RedirectionData : public Object {
3026 public: 3052 public:
3027 static intptr_t InstanceSize() { 3053 static intptr_t InstanceSize() {
3028 return RoundedAllocationSize(sizeof(RawRedirectionData)); 3054 return RoundedAllocationSize(sizeof(RawRedirectionData));
3029 } 3055 }
3030 3056
3031 private: 3057 private:
3032 // The type specifies the class and type arguments of the target constructor. 3058 // The type specifies the class and type arguments of the target constructor.
3033 RawType* type() const { return raw_ptr()->type_; } 3059 RawType* type() const { return raw_ptr()->type_; }
3034 void set_type(const Type& value) const; 3060 void set_type(const Type& value) const;
(...skipping 5869 matching lines...) Expand 10 before | Expand all | Expand 10 after
8904 8930
8905 inline void TypeArguments::SetHash(intptr_t value) const { 8931 inline void TypeArguments::SetHash(intptr_t value) const {
8906 // This is only safe because we create a new Smi, which does not cause 8932 // This is only safe because we create a new Smi, which does not cause
8907 // heap allocation. 8933 // heap allocation.
8908 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8934 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8909 } 8935 }
8910 8936
8911 } // namespace dart 8937 } // namespace dart
8912 8938
8913 #endif // RUNTIME_VM_OBJECT_H_ 8939 #endif // RUNTIME_VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/clustered_snapshot.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698