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

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

Issue 2005763002: Don't access context during OOM reporting if it's not available. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed the problem the other way Created 4 years, 7 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
« no previous file with comments | « no previous file | 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 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 "src/handles-inl.h" 7 #include "src/handles-inl.h"
8 #include "src/prototype.h" 8 #include "src/prototype.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 } 522 }
523 } 523 }
524 524
525 525
526 void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) { 526 void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) {
527 Object* name = fun->shared()->name(); 527 Object* name = fun->shared()->name();
528 bool print_name = false; 528 bool print_name = false;
529 Isolate* isolate = fun->GetIsolate(); 529 Isolate* isolate = fun->GetIsolate();
530 if (receiver->IsNull() || receiver->IsUndefined() || receiver->IsJSProxy()) { 530 if (receiver->IsNull() || receiver->IsUndefined() || receiver->IsJSProxy()) {
531 print_name = true; 531 print_name = true;
532 } else { 532 } else if (isolate->context() != nullptr) {
533 if (!receiver->IsJSObject()) { 533 if (!receiver->IsJSObject()) {
534 receiver = receiver->GetRootMap(isolate)->prototype(); 534 receiver = receiver->GetRootMap(isolate)->prototype();
535 } 535 }
536 536
537 for (PrototypeIterator iter(isolate, JSObject::cast(receiver), 537 for (PrototypeIterator iter(isolate, JSObject::cast(receiver),
538 PrototypeIterator::START_AT_RECEIVER); 538 PrototypeIterator::START_AT_RECEIVER);
539 !iter.IsAtEnd(); iter.Advance()) { 539 !iter.IsAtEnd(); iter.Advance()) {
540 if (iter.GetCurrent()->IsJSProxy()) break; 540 if (iter.GetCurrent()->IsJSProxy()) break;
541 Object* key = iter.GetCurrent<JSObject>()->SlowReverseLookup(fun); 541 Object* key = iter.GetCurrent<JSObject>()->SlowReverseLookup(fun);
542 if (!key->IsUndefined()) { 542 if (!key->IsUndefined()) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 MemCopy(new_space, space_, *bytes); 577 MemCopy(new_space, space_, *bytes);
578 *bytes = new_bytes; 578 *bytes = new_bytes;
579 DeleteArray(space_); 579 DeleteArray(space_);
580 space_ = new_space; 580 space_ = new_space;
581 return new_space; 581 return new_space;
582 } 582 }
583 583
584 584
585 } // namespace internal 585 } // namespace internal
586 } // namespace v8 586 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698