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

Side by Side Diff: src/string-stream.cc

Issue 149458: Remove the descriptor stream abstractions.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 5 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
« src/factory.cc ('K') | « src/spaces.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 336
337 337
338 void StringStream::PrintUsingMap(JSObject* js_object) { 338 void StringStream::PrintUsingMap(JSObject* js_object) {
339 Map* map = js_object->map(); 339 Map* map = js_object->map();
340 if (!Heap::Contains(map) || 340 if (!Heap::Contains(map) ||
341 !map->IsHeapObject() || 341 !map->IsHeapObject() ||
342 !map->IsMap()) { 342 !map->IsMap()) {
343 Add("<Invalid map>\n"); 343 Add("<Invalid map>\n");
344 return; 344 return;
345 } 345 }
346 for (DescriptorReader r(map->instance_descriptors()); !r.eos(); r.advance()) { 346 DescriptorArray* descs = map->instance_descriptors();
347 switch (r.type()) { 347 for (int i = 0; i < descs->number_of_descriptors(); i++) {
348 switch (descs->GetType(i)) {
348 case FIELD: { 349 case FIELD: {
349 Object* key = r.GetKey(); 350 Object* key = descs->GetKey(i);
350 if (key->IsString() || key->IsNumber()) { 351 if (key->IsString() || key->IsNumber()) {
351 int len = 3; 352 int len = 3;
352 if (key->IsString()) { 353 if (key->IsString()) {
353 len = String::cast(key)->length(); 354 len = String::cast(key)->length();
354 } 355 }
355 for (; len < 18; len++) 356 for (; len < 18; len++)
356 Put(' '); 357 Put(' ');
357 if (key->IsString()) { 358 if (key->IsString()) {
358 Put(String::cast(key)); 359 Put(String::cast(key));
359 } else { 360 } else {
360 key->ShortPrint(); 361 key->ShortPrint();
361 } 362 }
362 Add(": "); 363 Add(": ");
363 Object* value = js_object->FastPropertyAt(r.GetFieldIndex()); 364 Object* value = js_object->FastPropertyAt(descs->GetFieldIndex(i));
364 Add("%o\n", value); 365 Add("%o\n", value);
365 } 366 }
366 } 367 }
367 break; 368 break;
368 default: 369 default:
369 break; 370 break;
370 } 371 }
371 } 372 }
372 } 373 }
373 374
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 574
574 // Only grow once to the maximum allowable size. 575 // Only grow once to the maximum allowable size.
575 char* NoAllocationStringAllocator::grow(unsigned* bytes) { 576 char* NoAllocationStringAllocator::grow(unsigned* bytes) {
576 ASSERT(size_ >= *bytes); 577 ASSERT(size_ >= *bytes);
577 *bytes = size_; 578 *bytes = size_;
578 return space_; 579 return space_;
579 } 580 }
580 581
581 582
582 } } // namespace v8::internal 583 } } // namespace v8::internal
OLDNEW
« src/factory.cc ('K') | « src/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698