OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |