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

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

Issue 1289813005: Use Object::null_instance and Object::null_function and do not create Handles everytime. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 return *null_array_; 379 return *null_array_;
380 } 380 }
381 static const String& null_string() { 381 static const String& null_string() {
382 ASSERT(null_string_ != NULL); 382 ASSERT(null_string_ != NULL);
383 return *null_string_; 383 return *null_string_;
384 } 384 }
385 static const Instance& null_instance() { 385 static const Instance& null_instance() {
386 ASSERT(null_instance_ != NULL); 386 ASSERT(null_instance_ != NULL);
387 return *null_instance_; 387 return *null_instance_;
388 } 388 }
389 static const Function& null_function() {
390 ASSERT(null_function_ != NULL);
391 return *null_function_;
392 }
389 static const TypeArguments& null_type_arguments() { 393 static const TypeArguments& null_type_arguments() {
390 ASSERT(null_type_arguments_ != NULL); 394 ASSERT(null_type_arguments_ != NULL);
391 return *null_type_arguments_; 395 return *null_type_arguments_;
392 } 396 }
393 397
394 static const Array& empty_array() { 398 static const Array& empty_array() {
395 ASSERT(empty_array_ != NULL); 399 ASSERT(empty_array_ != NULL);
396 return *empty_array_; 400 return *empty_array_;
397 } 401 }
398 static const Array& zero_array() { 402 static const Array& zero_array() {
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 static RawClass* language_error_class_; // Class of LanguageError. 784 static RawClass* language_error_class_; // Class of LanguageError.
781 static RawClass* unhandled_exception_class_; // Class of UnhandledException. 785 static RawClass* unhandled_exception_class_; // Class of UnhandledException.
782 static RawClass* unwind_error_class_; // Class of UnwindError. 786 static RawClass* unwind_error_class_; // Class of UnwindError.
783 787
784 // The static values below are read-only handle pointers for singleton 788 // The static values below are read-only handle pointers for singleton
785 // objects that are shared between the different isolates. 789 // objects that are shared between the different isolates.
786 static Object* null_object_; 790 static Object* null_object_;
787 static Array* null_array_; 791 static Array* null_array_;
788 static String* null_string_; 792 static String* null_string_;
789 static Instance* null_instance_; 793 static Instance* null_instance_;
794 static Function* null_function_;
790 static TypeArguments* null_type_arguments_; 795 static TypeArguments* null_type_arguments_;
791 static Array* empty_array_; 796 static Array* empty_array_;
792 static Array* zero_array_; 797 static Array* zero_array_;
793 static ObjectPool* empty_object_pool_; 798 static ObjectPool* empty_object_pool_;
794 static PcDescriptors* empty_descriptors_; 799 static PcDescriptors* empty_descriptors_;
795 static LocalVarDescriptors* empty_var_descriptors_; 800 static LocalVarDescriptors* empty_var_descriptors_;
796 static ExceptionHandlers* empty_exception_handlers_; 801 static ExceptionHandlers* empty_exception_handlers_;
797 static Array* extractor_parameter_types_; 802 static Array* extractor_parameter_types_;
798 static Array* extractor_parameter_names_; 803 static Array* extractor_parameter_names_;
799 static Instance* sentinel_; 804 static Instance* sentinel_;
(...skipping 7235 matching lines...) Expand 10 before | Expand all | Expand 10 after
8035 8040
8036 8041
8037 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 8042 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
8038 intptr_t index) { 8043 intptr_t index) {
8039 return array.At((index * kEntryLength) + kTargetFunctionIndex); 8044 return array.At((index * kEntryLength) + kTargetFunctionIndex);
8040 } 8045 }
8041 8046
8042 } // namespace dart 8047 } // namespace dart
8043 8048
8044 #endif // VM_OBJECT_H_ 8049 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698