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

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

Issue 12319144: Avoid TLS accesses in Object::Lookup and Object::GetPrototype. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Simplified Object::GetPrototype a bit Created 7 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 | « 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 return; 526 return;
527 } 527 }
528 Add("/* warning: Invalid JSFunction object found */ "); 528 Add("/* warning: Invalid JSFunction object found */ ");
529 } 529 }
530 } 530 }
531 531
532 532
533 void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) { 533 void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) {
534 Object* name = fun->shared()->name(); 534 Object* name = fun->shared()->name();
535 bool print_name = false; 535 bool print_name = false;
536 Heap* heap = HEAP; 536 Isolate* isolate = fun->GetIsolate();
537 for (Object* p = receiver; p != heap->null_value(); p = p->GetPrototype()) { 537 for (Object* p = receiver;
538 p != isolate->heap()->null_value();
539 p = p->GetPrototype(isolate)) {
538 if (p->IsJSObject()) { 540 if (p->IsJSObject()) {
539 Object* key = JSObject::cast(p)->SlowReverseLookup(fun); 541 Object* key = JSObject::cast(p)->SlowReverseLookup(fun);
540 if (key != heap->undefined_value()) { 542 if (key != isolate->heap()->undefined_value()) {
541 if (!name->IsString() || 543 if (!name->IsString() ||
542 !key->IsString() || 544 !key->IsString() ||
543 !String::cast(name)->Equals(String::cast(key))) { 545 !String::cast(name)->Equals(String::cast(key))) {
544 print_name = true; 546 print_name = true;
545 } 547 }
546 if (name->IsString() && String::cast(name)->length() == 0) { 548 if (name->IsString() && String::cast(name)->length() == 0) {
547 print_name = false; 549 print_name = false;
548 } 550 }
549 name = key; 551 name = key;
550 } 552 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 585
584 // Only grow once to the maximum allowable size. 586 // Only grow once to the maximum allowable size.
585 char* NoAllocationStringAllocator::grow(unsigned* bytes) { 587 char* NoAllocationStringAllocator::grow(unsigned* bytes) {
586 ASSERT(size_ >= *bytes); 588 ASSERT(size_ >= *bytes);
587 *bytes = size_; 589 *bytes = size_;
588 return space_; 590 return space_;
589 } 591 }
590 592
591 593
592 } } // namespace v8::internal 594 } } // 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