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

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

Issue 209093002: Make all objects print at least their type in PrintToJSONStream. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | runtime/vm/object_test.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 #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 3987 matching lines...) Expand 10 before | Expand all | Expand 10 after
3998 const char* format = "unresolved class '%s'"; 3998 const char* format = "unresolved class '%s'";
3999 const char* cname = String::Handle(Name()).ToCString(); 3999 const char* cname = String::Handle(Name()).ToCString();
4000 intptr_t len = OS::SNPrint(NULL, 0, format, cname) + 1; 4000 intptr_t len = OS::SNPrint(NULL, 0, format, cname) + 1;
4001 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 4001 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
4002 OS::SNPrint(chars, len, format, cname); 4002 OS::SNPrint(chars, len, format, cname);
4003 return chars; 4003 return chars;
4004 } 4004 }
4005 4005
4006 4006
4007 void UnresolvedClass::PrintToJSONStream(JSONStream* stream, bool ref) const { 4007 void UnresolvedClass::PrintToJSONStream(JSONStream* stream, bool ref) const {
4008 JSONObject jsobj(stream); 4008 Object::PrintToJSONStream(stream, ref);
4009 } 4009 }
4010 4010
4011 4011
4012 static intptr_t FinalizeHash(uword hash) { 4012 static intptr_t FinalizeHash(uword hash) {
4013 hash += hash << 3; 4013 hash += hash << 3;
4014 hash ^= hash >> 11; 4014 hash ^= hash >> 11;
4015 hash += hash << 15; 4015 hash += hash << 15;
4016 return hash; 4016 return hash;
4017 } 4017 }
4018 4018
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
4708 const Class& cls = Class::Handle(patched_class()); 4708 const Class& cls = Class::Handle(patched_class());
4709 const char* cls_name = cls.ToCString(); 4709 const char* cls_name = cls.ToCString();
4710 intptr_t len = OS::SNPrint(NULL, 0, kFormat, cls_name) + 1; 4710 intptr_t len = OS::SNPrint(NULL, 0, kFormat, cls_name) + 1;
4711 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 4711 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
4712 OS::SNPrint(chars, len, kFormat, cls_name); 4712 OS::SNPrint(chars, len, kFormat, cls_name);
4713 return chars; 4713 return chars;
4714 } 4714 }
4715 4715
4716 4716
4717 void PatchClass::PrintToJSONStream(JSONStream* stream, bool ref) const { 4717 void PatchClass::PrintToJSONStream(JSONStream* stream, bool ref) const {
4718 JSONObject jsobj(stream); 4718 Object::PrintToJSONStream(stream, ref);
4719 } 4719 }
4720 4720
4721 4721
4722 RawPatchClass* PatchClass::New(const Class& patched_class, 4722 RawPatchClass* PatchClass::New(const Class& patched_class,
4723 const Class& source_class) { 4723 const Class& source_class) {
4724 const PatchClass& result = PatchClass::Handle(PatchClass::New()); 4724 const PatchClass& result = PatchClass::Handle(PatchClass::New());
4725 result.set_patched_class(patched_class); 4725 result.set_patched_class(patched_class);
4726 result.set_source_class(source_class); 4726 result.set_source_class(source_class);
4727 return result.raw(); 4727 return result.raw();
4728 } 4728 }
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after
6392 return reinterpret_cast<RawClosureData*>(raw); 6392 return reinterpret_cast<RawClosureData*>(raw);
6393 } 6393 }
6394 6394
6395 6395
6396 const char* ClosureData::ToCString() const { 6396 const char* ClosureData::ToCString() const {
6397 return "ClosureData class"; 6397 return "ClosureData class";
6398 } 6398 }
6399 6399
6400 6400
6401 void ClosureData::PrintToJSONStream(JSONStream* stream, bool ref) const { 6401 void ClosureData::PrintToJSONStream(JSONStream* stream, bool ref) const {
6402 JSONObject jsobj(stream); 6402 Object::PrintToJSONStream(stream, ref);
6403 } 6403 }
6404 6404
6405 6405
6406 void RedirectionData::set_type(const Type& value) const { 6406 void RedirectionData::set_type(const Type& value) const {
6407 ASSERT(!value.IsNull()); 6407 ASSERT(!value.IsNull());
6408 StorePointer(&raw_ptr()->type_, value.raw()); 6408 StorePointer(&raw_ptr()->type_, value.raw());
6409 } 6409 }
6410 6410
6411 6411
6412 void RedirectionData::set_identifier(const String& value) const { 6412 void RedirectionData::set_identifier(const String& value) const {
(...skipping 14 matching lines...) Expand all
6427 return reinterpret_cast<RawRedirectionData*>(raw); 6427 return reinterpret_cast<RawRedirectionData*>(raw);
6428 } 6428 }
6429 6429
6430 6430
6431 const char* RedirectionData::ToCString() const { 6431 const char* RedirectionData::ToCString() const {
6432 return "RedirectionData class"; 6432 return "RedirectionData class";
6433 } 6433 }
6434 6434
6435 6435
6436 void RedirectionData::PrintToJSONStream(JSONStream* stream, bool ref) const { 6436 void RedirectionData::PrintToJSONStream(JSONStream* stream, bool ref) const {
6437 JSONObject jsobj(stream); 6437 Object::PrintToJSONStream(stream, ref);
6438 } 6438 }
6439 6439
6440 6440
6441 RawString* Field::GetterName(const String& field_name) { 6441 RawString* Field::GetterName(const String& field_name) {
6442 CompilerStats::make_accessor_name++; 6442 CompilerStats::make_accessor_name++;
6443 return String::Concat(Symbols::GetterPrefix(), field_name); 6443 return String::Concat(Symbols::GetterPrefix(), field_name);
6444 } 6444 }
6445 6445
6446 6446
6447 RawString* Field::GetterSymbol(const String& field_name) { 6447 RawString* Field::GetterSymbol(const String& field_name) {
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
6899 } 6899 }
6900 6900
6901 6901
6902 const char* LiteralToken::ToCString() const { 6902 const char* LiteralToken::ToCString() const {
6903 const String& token = String::Handle(literal()); 6903 const String& token = String::Handle(literal());
6904 return token.ToCString(); 6904 return token.ToCString();
6905 } 6905 }
6906 6906
6907 6907
6908 void LiteralToken::PrintToJSONStream(JSONStream* stream, bool ref) const { 6908 void LiteralToken::PrintToJSONStream(JSONStream* stream, bool ref) const {
6909 JSONObject jsobj(stream); 6909 Object::PrintToJSONStream(stream, ref);
6910 } 6910 }
6911 6911
6912 6912
6913 RawArray* TokenStream::TokenObjects() const { 6913 RawArray* TokenStream::TokenObjects() const {
6914 return raw_ptr()->token_objects_; 6914 return raw_ptr()->token_objects_;
6915 } 6915 }
6916 6916
6917 6917
6918 void TokenStream::SetTokenObjects(const Array& value) const { 6918 void TokenStream::SetTokenObjects(const Array& value) const {
6919 StorePointer(&raw_ptr()->token_objects_, value.raw()); 6919 StorePointer(&raw_ptr()->token_objects_, value.raw());
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
7344 return result.raw(); 7344 return result.raw();
7345 } 7345 }
7346 7346
7347 7347
7348 const char* TokenStream::ToCString() const { 7348 const char* TokenStream::ToCString() const {
7349 return "TokenStream"; 7349 return "TokenStream";
7350 } 7350 }
7351 7351
7352 7352
7353 void TokenStream::PrintToJSONStream(JSONStream* stream, bool ref) const { 7353 void TokenStream::PrintToJSONStream(JSONStream* stream, bool ref) const {
7354 JSONObject jsobj(stream); 7354 Object::PrintToJSONStream(stream, ref);
7355 } 7355 }
7356 7356
7357 7357
7358 TokenStream::Iterator::Iterator(const TokenStream& tokens, 7358 TokenStream::Iterator::Iterator(const TokenStream& tokens,
7359 intptr_t token_pos, 7359 intptr_t token_pos,
7360 Iterator::StreamType stream_type) 7360 Iterator::StreamType stream_type)
7361 : tokens_(TokenStream::Handle(tokens.raw())), 7361 : tokens_(TokenStream::Handle(tokens.raw())),
7362 data_(ExternalTypedData::Handle(tokens.GetStream())), 7362 data_(ExternalTypedData::Handle(tokens.GetStream())),
7363 stream_(reinterpret_cast<uint8_t*>(data_.DataAddr(0)), data_.Length()), 7363 stream_(reinterpret_cast<uint8_t*>(data_.DataAddr(0)), data_.Length()),
7364 token_objects_(Array::Handle(tokens.TokenObjects())), 7364 token_objects_(Array::Handle(tokens.TokenObjects())),
(...skipping 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after
9208 const char* kFormat = "LibraryPrefix:'%s'"; 9208 const char* kFormat = "LibraryPrefix:'%s'";
9209 const String& prefix = String::Handle(name()); 9209 const String& prefix = String::Handle(name());
9210 intptr_t len = OS::SNPrint(NULL, 0, kFormat, prefix.ToCString()) + 1; 9210 intptr_t len = OS::SNPrint(NULL, 0, kFormat, prefix.ToCString()) + 1;
9211 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 9211 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
9212 OS::SNPrint(chars, len, kFormat, prefix.ToCString()); 9212 OS::SNPrint(chars, len, kFormat, prefix.ToCString());
9213 return chars; 9213 return chars;
9214 } 9214 }
9215 9215
9216 9216
9217 void LibraryPrefix::PrintToJSONStream(JSONStream* stream, bool ref) const { 9217 void LibraryPrefix::PrintToJSONStream(JSONStream* stream, bool ref) const {
9218 JSONObject jsobj(stream); 9218 Object::PrintToJSONStream(stream, ref);
9219 } 9219 }
9220 9220
9221 9221
9222 void Namespace::set_metadata_field(const Field& value) const { 9222 void Namespace::set_metadata_field(const Field& value) const {
9223 StorePointer(&raw_ptr()->metadata_field_, value.raw()); 9223 StorePointer(&raw_ptr()->metadata_field_, value.raw());
9224 } 9224 }
9225 9225
9226 9226
9227 void Namespace::AddMetadata(intptr_t token_pos, const Class& owner_class) { 9227 void Namespace::AddMetadata(intptr_t token_pos, const Class& owner_class) {
9228 ASSERT(Field::Handle(metadata_field()).IsNull()); 9228 ASSERT(Field::Handle(metadata_field()).IsNull());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
9262 const char* kFormat = "Namespace for library '%s'"; 9262 const char* kFormat = "Namespace for library '%s'";
9263 const Library& lib = Library::Handle(library()); 9263 const Library& lib = Library::Handle(library());
9264 intptr_t len = OS::SNPrint(NULL, 0, kFormat, lib.ToCString()) + 1; 9264 intptr_t len = OS::SNPrint(NULL, 0, kFormat, lib.ToCString()) + 1;
9265 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 9265 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
9266 OS::SNPrint(chars, len, kFormat, lib.ToCString()); 9266 OS::SNPrint(chars, len, kFormat, lib.ToCString());
9267 return chars; 9267 return chars;
9268 } 9268 }
9269 9269
9270 9270
9271 void Namespace::PrintToJSONStream(JSONStream* stream, bool ref) const { 9271 void Namespace::PrintToJSONStream(JSONStream* stream, bool ref) const {
9272 JSONObject jsobj(stream); 9272 Object::PrintToJSONStream(stream, ref);
9273 } 9273 }
9274 9274
9275 9275
9276 bool Namespace::HidesName(const String& name) const { 9276 bool Namespace::HidesName(const String& name) const {
9277 // Quick check for common case with no combinators. 9277 // Quick check for common case with no combinators.
9278 if (hide_names() == show_names()) { 9278 if (hide_names() == show_names()) {
9279 ASSERT(hide_names() == Array::null()); 9279 ASSERT(hide_names() == Array::null());
9280 return false; 9280 return false;
9281 } 9281 }
9282 const String* plain_name = &name; 9282 const String* plain_name = &name;
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
9528 return result.raw(); 9528 return result.raw();
9529 } 9529 }
9530 9530
9531 9531
9532 const char* Instructions::ToCString() const { 9532 const char* Instructions::ToCString() const {
9533 return "Instructions"; 9533 return "Instructions";
9534 } 9534 }
9535 9535
9536 9536
9537 void Instructions::PrintToJSONStream(JSONStream* stream, bool ref) const { 9537 void Instructions::PrintToJSONStream(JSONStream* stream, bool ref) const {
9538 JSONObject jsobj(stream); 9538 Object::PrintToJSONStream(stream, ref);
9539 } 9539 }
9540 9540
9541 9541
9542 intptr_t PcDescriptors::Length() const { 9542 intptr_t PcDescriptors::Length() const {
9543 return Smi::Value(raw_ptr()->length_); 9543 return Smi::Value(raw_ptr()->length_);
9544 } 9544 }
9545 9545
9546 9546
9547 void PcDescriptors::SetLength(intptr_t value) const { 9547 void PcDescriptors::SetLength(intptr_t value) const {
9548 // This is only safe because we create a new Smi, which does not cause 9548 // This is only safe because we create a new Smi, which does not cause
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
9682 KindAsStr(i), 9682 KindAsStr(i),
9683 DeoptId(i), 9683 DeoptId(i),
9684 TokenPos(i), 9684 TokenPos(i),
9685 TryIndex(i)); 9685 TryIndex(i));
9686 } 9686 }
9687 return buffer; 9687 return buffer;
9688 } 9688 }
9689 9689
9690 9690
9691 void PcDescriptors::PrintToJSONStream(JSONStream* stream, bool ref) const { 9691 void PcDescriptors::PrintToJSONStream(JSONStream* stream, bool ref) const {
9692 JSONObject jsobj(stream); 9692 Object::PrintToJSONStream(stream, ref);
9693 } 9693 }
9694 9694
9695 9695
9696 // Verify assumptions (in debug mode only). 9696 // Verify assumptions (in debug mode only).
9697 // - No two deopt descriptors have the same deoptimization id. 9697 // - No two deopt descriptors have the same deoptimization id.
9698 // - No two ic-call descriptors have the same deoptimization id (type feedback). 9698 // - No two ic-call descriptors have the same deoptimization id (type feedback).
9699 // A function without unique ids is marked as non-optimizable (e.g., because of 9699 // A function without unique ids is marked as non-optimizable (e.g., because of
9700 // finally blocks). 9700 // finally blocks).
9701 void PcDescriptors::Verify(const Function& function) const { 9701 void PcDescriptors::Verify(const Function& function) const {
9702 #if defined(DEBUG) 9702 #if defined(DEBUG)
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
9837 for (intptr_t i = 0; i < Length(); i++) { 9837 for (intptr_t i = 0; i < Length(); i++) {
9838 chars[index++] = IsObject(i) ? '1' : '0'; 9838 chars[index++] = IsObject(i) ? '1' : '0';
9839 } 9839 }
9840 chars[index] = '\0'; 9840 chars[index] = '\0';
9841 return chars; 9841 return chars;
9842 } 9842 }
9843 } 9843 }
9844 9844
9845 9845
9846 void Stackmap::PrintToJSONStream(JSONStream* stream, bool ref) const { 9846 void Stackmap::PrintToJSONStream(JSONStream* stream, bool ref) const {
9847 JSONObject jsobj(stream); 9847 Object::PrintToJSONStream(stream, ref);
9848 } 9848 }
9849 9849
9850 9850
9851 RawString* LocalVarDescriptors::GetName(intptr_t var_index) const { 9851 RawString* LocalVarDescriptors::GetName(intptr_t var_index) const {
9852 ASSERT(var_index < Length()); 9852 ASSERT(var_index < Length());
9853 const Array& names = Array::Handle(raw_ptr()->names_); 9853 const Array& names = Array::Handle(raw_ptr()->names_);
9854 ASSERT(Length() == names.Length()); 9854 ASSERT(Length() == names.Length());
9855 String& name = String::Handle(); 9855 String& name = String::Handle();
9856 name ^= names.At(var_index); 9856 name ^= names.At(var_index);
9857 return name.raw(); 9857 return name.raw();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
9907 info.begin_pos, 9907 info.begin_pos,
9908 info.end_pos, 9908 info.end_pos,
9909 var_name.ToCString()); 9909 var_name.ToCString());
9910 } 9910 }
9911 return buffer; 9911 return buffer;
9912 } 9912 }
9913 9913
9914 9914
9915 void LocalVarDescriptors::PrintToJSONStream(JSONStream* stream, 9915 void LocalVarDescriptors::PrintToJSONStream(JSONStream* stream,
9916 bool ref) const { 9916 bool ref) const {
9917 JSONObject jsobj(stream); 9917 Object::PrintToJSONStream(stream, ref);
9918 } 9918 }
9919 9919
9920 9920
9921 RawLocalVarDescriptors* LocalVarDescriptors::New(intptr_t num_variables) { 9921 RawLocalVarDescriptors* LocalVarDescriptors::New(intptr_t num_variables) {
9922 ASSERT(Object::var_descriptors_class() != Class::null()); 9922 ASSERT(Object::var_descriptors_class() != Class::null());
9923 if (num_variables < 0 || num_variables > kMaxElements) { 9923 if (num_variables < 0 || num_variables > kMaxElements) {
9924 // This should be caught before we reach here. 9924 // This should be caught before we reach here.
9925 FATAL1("Fatal error in LocalVarDescriptors::New: " 9925 FATAL1("Fatal error in LocalVarDescriptors::New: "
9926 "invalid num_variables %" Pd "\n", num_variables); 9926 "invalid num_variables %" Pd "\n", num_variables);
9927 } 9927 }
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
10091 (len - num_chars), 10091 (len - num_chars),
10092 kFormat2, k, type.ToCString()); 10092 kFormat2, k, type.ToCString());
10093 } 10093 }
10094 } 10094 }
10095 return buffer; 10095 return buffer;
10096 } 10096 }
10097 10097
10098 10098
10099 void ExceptionHandlers::PrintToJSONStream(JSONStream* stream, 10099 void ExceptionHandlers::PrintToJSONStream(JSONStream* stream,
10100 bool ref) const { 10100 bool ref) const {
10101 JSONObject jsobj(stream); 10101 Object::PrintToJSONStream(stream, ref);
10102 } 10102 }
10103 10103
10104 10104
10105 intptr_t DeoptInfo::Length() const { 10105 intptr_t DeoptInfo::Length() const {
10106 return Smi::Value(raw_ptr()->length_); 10106 return Smi::Value(raw_ptr()->length_);
10107 } 10107 }
10108 10108
10109 10109
10110 intptr_t DeoptInfo::FromIndex(intptr_t index) const { 10110 intptr_t DeoptInfo::FromIndex(intptr_t index) const {
10111 return *(EntryAddr(index, kFromIndex)); 10111 return *(EntryAddr(index, kFromIndex));
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
10208 ToInstructions(deopt_table, &unpacked); 10208 ToInstructions(deopt_table, &unpacked);
10209 ASSERT(unpacked.length() == original.length()); 10209 ASSERT(unpacked.length() == original.length());
10210 for (intptr_t i = 0; i < unpacked.length(); ++i) { 10210 for (intptr_t i = 0; i < unpacked.length(); ++i) {
10211 ASSERT(unpacked[i]->Equals(*original[i])); 10211 ASSERT(unpacked[i]->Equals(*original[i]));
10212 } 10212 }
10213 return true; 10213 return true;
10214 } 10214 }
10215 10215
10216 10216
10217 void DeoptInfo::PrintToJSONStream(JSONStream* stream, bool ref) const { 10217 void DeoptInfo::PrintToJSONStream(JSONStream* stream, bool ref) const {
10218 JSONObject jsobj(stream); 10218 Object::PrintToJSONStream(stream, ref);
10219 } 10219 }
10220 10220
10221 10221
10222 RawDeoptInfo* DeoptInfo::New(intptr_t num_commands) { 10222 RawDeoptInfo* DeoptInfo::New(intptr_t num_commands) {
10223 ASSERT(Object::deopt_info_class() != Class::null()); 10223 ASSERT(Object::deopt_info_class() != Class::null());
10224 if ((num_commands < 0) || (num_commands > kMaxElements)) { 10224 if ((num_commands < 0) || (num_commands > kMaxElements)) {
10225 FATAL1("Fatal error in DeoptInfo::New(): invalid num_commands %" Pd "\n", 10225 FATAL1("Fatal error in DeoptInfo::New(): invalid num_commands %" Pd "\n",
10226 num_commands); 10226 num_commands);
10227 } 10227 }
10228 DeoptInfo& result = DeoptInfo::Handle(); 10228 DeoptInfo& result = DeoptInfo::Handle();
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
10906 intptr_t len = OS::SNPrint(NULL, 0, kFormat, 10906 intptr_t len = OS::SNPrint(NULL, 0, kFormat,
10907 num_variables(), parent_str) + 1; 10907 num_variables(), parent_str) + 1;
10908 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 10908 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
10909 OS::SNPrint(chars, len, kFormat, num_variables(), parent_str); 10909 OS::SNPrint(chars, len, kFormat, num_variables(), parent_str);
10910 return chars; 10910 return chars;
10911 } 10911 }
10912 } 10912 }
10913 10913
10914 10914
10915 void Context::PrintToJSONStream(JSONStream* stream, bool ref) const { 10915 void Context::PrintToJSONStream(JSONStream* stream, bool ref) const {
10916 JSONObject jsobj(stream); 10916 Object::PrintToJSONStream(stream, ref);
10917 } 10917 }
10918 10918
10919 10919
10920 RawContextScope* ContextScope::New(intptr_t num_variables) { 10920 RawContextScope* ContextScope::New(intptr_t num_variables) {
10921 ASSERT(Object::context_scope_class() != Class::null()); 10921 ASSERT(Object::context_scope_class() != Class::null());
10922 if (num_variables < 0 || num_variables > kMaxElements) { 10922 if (num_variables < 0 || num_variables > kMaxElements) {
10923 // This should be caught before we reach here. 10923 // This should be caught before we reach here.
10924 FATAL1("Fatal error in ContextScope::New: invalid num_variables %" Pd "\n", 10924 FATAL1("Fatal error in ContextScope::New: invalid num_variables %" Pd "\n",
10925 num_variables); 10925 num_variables);
10926 } 10926 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
11025 VariableDescAddr(scope_index)->context_level = Smi::New(context_level); 11025 VariableDescAddr(scope_index)->context_level = Smi::New(context_level);
11026 } 11026 }
11027 11027
11028 11028
11029 const char* ContextScope::ToCString() const { 11029 const char* ContextScope::ToCString() const {
11030 return "ContextScope"; 11030 return "ContextScope";
11031 } 11031 }
11032 11032
11033 11033
11034 void ContextScope::PrintToJSONStream(JSONStream* stream, bool ref) const { 11034 void ContextScope::PrintToJSONStream(JSONStream* stream, bool ref) const {
11035 JSONObject jsobj(stream); 11035 Object::PrintToJSONStream(stream, ref);
11036 } 11036 }
11037 11037
11038 11038
11039 const char* ICData::ToCString() const { 11039 const char* ICData::ToCString() const {
11040 const char* kFormat = "ICData target:'%s' num-args: %" Pd 11040 const char* kFormat = "ICData target:'%s' num-args: %" Pd
11041 " num-checks: %" Pd ""; 11041 " num-checks: %" Pd "";
11042 const String& name = String::Handle(target_name()); 11042 const String& name = String::Handle(target_name());
11043 const intptr_t num_args = num_args_tested(); 11043 const intptr_t num_args = num_args_tested();
11044 const intptr_t num_checks = NumberOfChecks(); 11044 const intptr_t num_checks = NumberOfChecks();
11045 intptr_t len = OS::SNPrint(NULL, 0, kFormat, name.ToCString(), 11045 intptr_t len = OS::SNPrint(NULL, 0, kFormat, name.ToCString(),
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
11499 intptr_t len = result.TestEntryLength(); 11499 intptr_t len = result.TestEntryLength();
11500 // IC data array must be null terminated (sentinel entry). 11500 // IC data array must be null terminated (sentinel entry).
11501 const Array& ic_data = Array::Handle(Array::New(len, Heap::kOld)); 11501 const Array& ic_data = Array::Handle(Array::New(len, Heap::kOld));
11502 result.set_ic_data(ic_data); 11502 result.set_ic_data(ic_data);
11503 result.WriteSentinel(ic_data); 11503 result.WriteSentinel(ic_data);
11504 return result.raw(); 11504 return result.raw();
11505 } 11505 }
11506 11506
11507 11507
11508 void ICData::PrintToJSONStream(JSONStream* stream, bool ref) const { 11508 void ICData::PrintToJSONStream(JSONStream* stream, bool ref) const {
11509 JSONObject jsobj(stream); 11509 Object::PrintToJSONStream(stream, ref);
11510 } 11510 }
11511 11511
11512 11512
11513 RawArray* MegamorphicCache::buckets() const { 11513 RawArray* MegamorphicCache::buckets() const {
11514 return raw_ptr()->buckets_; 11514 return raw_ptr()->buckets_;
11515 } 11515 }
11516 11516
11517 11517
11518 void MegamorphicCache::set_buckets(const Array& buckets) const { 11518 void MegamorphicCache::set_buckets(const Array& buckets) const {
11519 StorePointer(&raw_ptr()->buckets_, buckets.raw()); 11519 StorePointer(&raw_ptr()->buckets_, buckets.raw());
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
11615 UNREACHABLE(); 11615 UNREACHABLE();
11616 } 11616 }
11617 11617
11618 11618
11619 const char* MegamorphicCache::ToCString() const { 11619 const char* MegamorphicCache::ToCString() const {
11620 return ""; 11620 return "";
11621 } 11621 }
11622 11622
11623 11623
11624 void MegamorphicCache::PrintToJSONStream(JSONStream* stream, bool ref) const { 11624 void MegamorphicCache::PrintToJSONStream(JSONStream* stream, bool ref) const {
11625 JSONObject jsobj(stream); 11625 Object::PrintToJSONStream(stream, ref);
11626 } 11626 }
11627 11627
11628 11628
11629 RawSubtypeTestCache* SubtypeTestCache::New() { 11629 RawSubtypeTestCache* SubtypeTestCache::New() {
11630 ASSERT(Object::subtypetestcache_class() != Class::null()); 11630 ASSERT(Object::subtypetestcache_class() != Class::null());
11631 SubtypeTestCache& result = SubtypeTestCache::Handle(); 11631 SubtypeTestCache& result = SubtypeTestCache::Handle();
11632 { 11632 {
11633 // SubtypeTestCache objects are long living objects, allocate them in the 11633 // SubtypeTestCache objects are long living objects, allocate them in the
11634 // old generation. 11634 // old generation.
11635 RawObject* raw = Object::Allocate(SubtypeTestCache::kClassId, 11635 RawObject* raw = Object::Allocate(SubtypeTestCache::kClassId,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
11691 *test_result ^= data.At(data_pos + kTestResult); 11691 *test_result ^= data.At(data_pos + kTestResult);
11692 } 11692 }
11693 11693
11694 11694
11695 const char* SubtypeTestCache::ToCString() const { 11695 const char* SubtypeTestCache::ToCString() const {
11696 return "SubtypeTestCache"; 11696 return "SubtypeTestCache";
11697 } 11697 }
11698 11698
11699 11699
11700 void SubtypeTestCache::PrintToJSONStream(JSONStream* stream, bool ref) const { 11700 void SubtypeTestCache::PrintToJSONStream(JSONStream* stream, bool ref) const {
11701 JSONObject jsobj(stream); 11701 Object::PrintToJSONStream(stream, ref);
11702 } 11702 }
11703 11703
11704 11704
11705 const char* Error::ToErrorCString() const { 11705 const char* Error::ToErrorCString() const {
11706 UNREACHABLE(); 11706 UNREACHABLE();
11707 return "Internal Error"; 11707 return "Internal Error";
11708 } 11708 }
11709 11709
11710 11710
11711 const char* Error::ToCString() const { 11711 const char* Error::ToCString() const {
(...skipping 6249 matching lines...) Expand 10 before | Expand all | Expand 10 after
17961 return "_MirrorReference"; 17961 return "_MirrorReference";
17962 } 17962 }
17963 17963
17964 17964
17965 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 17965 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
17966 Instance::PrintToJSONStream(stream, ref); 17966 Instance::PrintToJSONStream(stream, ref);
17967 } 17967 }
17968 17968
17969 17969
17970 } // namespace dart 17970 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698