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

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

Issue 1715123003: - Add DEBUG_ONLY and NOT_IN_PRODUCT macros. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update status files. Created 4 years, 10 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/globals.h ('k') | runtime/vm/raw_object.h » ('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 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1918 return raw_ptr()->name_; 1918 return raw_ptr()->name_;
1919 } 1919 }
1920 1920
1921 1921
1922 RawString* Class::PrettyName() const { 1922 RawString* Class::PrettyName() const {
1923 return GeneratePrettyName(); 1923 return GeneratePrettyName();
1924 } 1924 }
1925 1925
1926 1926
1927 RawString* Class::UserVisibleName() const { 1927 RawString* Class::UserVisibleName() const {
1928 #if defined(PRODUCT)
1929 return raw_ptr()->name_;
1930 #else // defined(PRODUCT)
1928 ASSERT(raw_ptr()->user_name_ != String::null()); 1931 ASSERT(raw_ptr()->user_name_ != String::null());
1929 return raw_ptr()->user_name_; 1932 return raw_ptr()->user_name_;
1933 #endif // defined(PRODUCT)
1930 } 1934 }
1931 1935
1932 1936
1933 bool Class::IsInFullSnapshot() const { 1937 bool Class::IsInFullSnapshot() const {
1934 NoSafepointScope no_safepoint; 1938 NoSafepointScope no_safepoint;
1935 return raw_ptr()->library_->ptr()->is_in_fullsnapshot_; 1939 return raw_ptr()->library_->ptr()->is_in_fullsnapshot_;
1936 } 1940 }
1937 1941
1938 1942
1939 RawAbstractType* Class::RareType() const { 1943 RawAbstractType* Class::RareType() const {
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
3154 result.set_instance_size(instance_size); 3158 result.set_instance_size(instance_size);
3155 result.set_next_field_offset(ExternalTypedData::NextFieldOffset()); 3159 result.set_next_field_offset(ExternalTypedData::NextFieldOffset());
3156 result.set_is_prefinalized(); 3160 result.set_is_prefinalized();
3157 return result.raw(); 3161 return result.raw();
3158 } 3162 }
3159 3163
3160 3164
3161 void Class::set_name(const String& value) const { 3165 void Class::set_name(const String& value) const {
3162 ASSERT(value.IsSymbol()); 3166 ASSERT(value.IsSymbol());
3163 StorePointer(&raw_ptr()->name_, value.raw()); 3167 StorePointer(&raw_ptr()->name_, value.raw());
3168 NOT_IN_PRODUCT(
3164 if (raw_ptr()->user_name_ == String::null()) { 3169 if (raw_ptr()->user_name_ == String::null()) {
3165 // TODO(johnmccutchan): Eagerly set user name for VM isolate classes, 3170 // TODO(johnmccutchan): Eagerly set user name for VM isolate classes,
3166 // lazily set user name for the other classes. 3171 // lazily set user name for the other classes.
3167 // Generate and set user_name. 3172 // Generate and set user_name.
3168 const String& user_name = String::Handle(GenerateUserVisibleName()); 3173 const String& user_name = String::Handle(GenerateUserVisibleName());
3169 set_user_name(user_name); 3174 set_user_name(user_name);
3170 } 3175 }
3176 )
3171 } 3177 }
3172 3178
3173 3179
3180 NOT_IN_PRODUCT(
3174 void Class::set_user_name(const String& value) const { 3181 void Class::set_user_name(const String& value) const {
3175 StorePointer(&raw_ptr()->user_name_, value.raw()); 3182 StorePointer(&raw_ptr()->user_name_, value.raw());
3176 } 3183 }
3184 )
3177 3185
3178 3186
3179 RawString* Class::GeneratePrettyName() const { 3187 RawString* Class::GeneratePrettyName() const {
3180 const String& name = String::Handle(Name()); 3188 const String& name = String::Handle(Name());
3181 return String::IdentifierPrettyName(name); 3189 return String::IdentifierPrettyName(name);
3182 } 3190 }
3183 3191
3184 3192
3185 RawString* Class::GenerateUserVisibleName() const { 3193 RawString* Class::GenerateUserVisibleName() const {
3186 if (FLAG_show_internal_names) { 3194 if (FLAG_show_internal_names) {
(...skipping 18264 matching lines...) Expand 10 before | Expand all | Expand 10 after
21451 return UserTag::null(); 21459 return UserTag::null();
21452 } 21460 }
21453 21461
21454 21462
21455 const char* UserTag::ToCString() const { 21463 const char* UserTag::ToCString() const {
21456 const String& tag_label = String::Handle(label()); 21464 const String& tag_label = String::Handle(label());
21457 return tag_label.ToCString(); 21465 return tag_label.ToCString();
21458 } 21466 }
21459 21467
21460 } // namespace dart 21468 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/globals.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698