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

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

Issue 3031005: [Isolates] Avoid dereferencing Isolate::Current() to check oddball identities... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 10 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 | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | src/stub-cache.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 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 } 370 }
371 break; 371 break;
372 default: 372 default:
373 break; 373 break;
374 } 374 }
375 } 375 }
376 } 376 }
377 377
378 378
379 void StringStream::PrintFixedArray(FixedArray* array, unsigned int limit) { 379 void StringStream::PrintFixedArray(FixedArray* array, unsigned int limit) {
380 Heap* heap = HEAP;
380 for (unsigned int i = 0; i < 10 && i < limit; i++) { 381 for (unsigned int i = 0; i < 10 && i < limit; i++) {
381 Object* element = array->get(i); 382 Object* element = array->get(i);
382 if (element != HEAP->the_hole_value()) { 383 if (element != heap->the_hole_value()) {
383 for (int len = 1; len < 18; len++) 384 for (int len = 1; len < 18; len++)
384 Put(' '); 385 Put(' ');
385 Add("%d: %o\n", i, array->get(i)); 386 Add("%d: %o\n", i, array->get(i));
386 } 387 }
387 } 388 }
388 if (limit >= 10) { 389 if (limit >= 10) {
389 Add(" ...\n"); 390 Add(" ...\n");
390 } 391 }
391 } 392 }
392 393
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 return; 526 return;
526 } 527 }
527 Add("/* warning: Invalid JSFunction object found */ "); 528 Add("/* warning: Invalid JSFunction object found */ ");
528 } 529 }
529 } 530 }
530 531
531 532
532 void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) { 533 void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) {
533 Object* name = fun->shared()->name(); 534 Object* name = fun->shared()->name();
534 bool print_name = false; 535 bool print_name = false;
535 for (Object* p = receiver; p != HEAP->null_value(); p = p->GetPrototype()) { 536 Heap* heap = HEAP;
537 for (Object* p = receiver; p != heap->null_value(); p = p->GetPrototype()) {
536 if (p->IsJSObject()) { 538 if (p->IsJSObject()) {
537 Object* key = JSObject::cast(p)->SlowReverseLookup(fun); 539 Object* key = JSObject::cast(p)->SlowReverseLookup(fun);
538 if (key != HEAP->undefined_value()) { 540 if (key != heap->undefined_value()) {
539 if (!name->IsString() || 541 if (!name->IsString() ||
540 !key->IsString() || 542 !key->IsString() ||
541 !String::cast(name)->Equals(String::cast(key))) { 543 !String::cast(name)->Equals(String::cast(key))) {
542 print_name = true; 544 print_name = true;
543 } 545 }
544 if (name->IsString() && String::cast(name)->length() == 0) { 546 if (name->IsString() && String::cast(name)->length() == 0) {
545 print_name = false; 547 print_name = false;
546 } 548 }
547 name = key; 549 name = key;
548 } 550 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 583
582 // Only grow once to the maximum allowable size. 584 // Only grow once to the maximum allowable size.
583 char* NoAllocationStringAllocator::grow(unsigned* bytes) { 585 char* NoAllocationStringAllocator::grow(unsigned* bytes) {
584 ASSERT(size_ >= *bytes); 586 ASSERT(size_ >= *bytes);
585 *bytes = size_; 587 *bytes = size_;
586 return space_; 588 return space_;
587 } 589 }
588 590
589 591
590 } } // namespace v8::internal 592 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698