OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/string-stream.h" | 5 #include "src/string-stream.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/handles-inl.h" | 9 #include "src/handles-inl.h" |
10 #include "src/prototype.h" | 10 #include "src/prototype.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 | 526 |
527 void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) { | 527 void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) { |
528 Object* name = fun->shared()->name(); | 528 Object* name = fun->shared()->name(); |
529 bool print_name = false; | 529 bool print_name = false; |
530 Isolate* isolate = fun->GetIsolate(); | 530 Isolate* isolate = fun->GetIsolate(); |
531 if (receiver->IsNull(isolate) || receiver->IsUndefined(isolate) || | 531 if (receiver->IsNull(isolate) || receiver->IsUndefined(isolate) || |
532 receiver->IsTheHole(isolate) || receiver->IsJSProxy()) { | 532 receiver->IsTheHole(isolate) || receiver->IsJSProxy()) { |
533 print_name = true; | 533 print_name = true; |
534 } else if (isolate->context() != nullptr) { | 534 } else if (isolate->context() != nullptr) { |
535 if (!receiver->IsJSObject()) { | 535 if (!receiver->IsJSObject()) { |
536 receiver = receiver->GetRootMap(isolate)->prototype(); | 536 receiver = receiver->GetPrototypeChainRootMap(isolate)->prototype(); |
537 } | 537 } |
538 | 538 |
539 for (PrototypeIterator iter(isolate, JSObject::cast(receiver), | 539 for (PrototypeIterator iter(isolate, JSObject::cast(receiver), |
540 kStartAtReceiver); | 540 kStartAtReceiver); |
541 !iter.IsAtEnd(); iter.Advance()) { | 541 !iter.IsAtEnd(); iter.Advance()) { |
542 if (iter.GetCurrent()->IsJSProxy()) break; | 542 if (iter.GetCurrent()->IsJSProxy()) break; |
543 Object* key = iter.GetCurrent<JSObject>()->SlowReverseLookup(fun); | 543 Object* key = iter.GetCurrent<JSObject>()->SlowReverseLookup(fun); |
544 if (!key->IsUndefined(isolate)) { | 544 if (!key->IsUndefined(isolate)) { |
545 if (!name->IsString() || | 545 if (!name->IsString() || |
546 !key->IsString() || | 546 !key->IsString() || |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 MemCopy(new_space, space_, *bytes); | 579 MemCopy(new_space, space_, *bytes); |
580 *bytes = new_bytes; | 580 *bytes = new_bytes; |
581 DeleteArray(space_); | 581 DeleteArray(space_); |
582 space_ = new_space; | 582 space_ = new_space; |
583 return new_space; | 583 return new_space; |
584 } | 584 } |
585 | 585 |
586 | 586 |
587 } // namespace internal | 587 } // namespace internal |
588 } // namespace v8 | 588 } // namespace v8 |
OLD | NEW |