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

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

Issue 2601503002: Add Object::IsNullOrUndefined(Isolate*) helper method (Closed)
Patch Set: fixing merge conflicts Created 3 years, 11 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 | « src/runtime/runtime-regexp.cc ('k') | 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 <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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 Add("%o", f); 474 Add("%o", f);
475 Add("/* warning: no JSFunction object or function name found */ "); 475 Add("/* warning: no JSFunction object or function name found */ ");
476 } 476 }
477 } 477 }
478 478
479 479
480 void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) { 480 void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) {
481 Object* name = fun->shared()->name(); 481 Object* name = fun->shared()->name();
482 bool print_name = false; 482 bool print_name = false;
483 Isolate* isolate = fun->GetIsolate(); 483 Isolate* isolate = fun->GetIsolate();
484 if (receiver->IsNull(isolate) || receiver->IsUndefined(isolate) || 484 if (receiver->IsNullOrUndefined(isolate) || receiver->IsTheHole(isolate) ||
485 receiver->IsTheHole(isolate) || receiver->IsJSProxy()) { 485 receiver->IsJSProxy()) {
486 print_name = true; 486 print_name = true;
487 } else if (isolate->context() != nullptr) { 487 } else if (isolate->context() != nullptr) {
488 if (!receiver->IsJSObject()) { 488 if (!receiver->IsJSObject()) {
489 receiver = receiver->GetPrototypeChainRootMap(isolate)->prototype(); 489 receiver = receiver->GetPrototypeChainRootMap(isolate)->prototype();
490 } 490 }
491 491
492 for (PrototypeIterator iter(isolate, JSObject::cast(receiver), 492 for (PrototypeIterator iter(isolate, JSObject::cast(receiver),
493 kStartAtReceiver); 493 kStartAtReceiver);
494 !iter.IsAtEnd(); iter.Advance()) { 494 !iter.IsAtEnd(); iter.Advance()) {
495 if (iter.GetCurrent()->IsJSProxy()) break; 495 if (iter.GetCurrent()->IsJSProxy()) break;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 MemCopy(new_space, space_, *bytes); 532 MemCopy(new_space, space_, *bytes);
533 *bytes = new_bytes; 533 *bytes = new_bytes;
534 DeleteArray(space_); 534 DeleteArray(space_);
535 space_ = new_space; 535 space_ = new_space;
536 return new_space; 536 return new_space;
537 } 537 }
538 538
539 539
540 } // namespace internal 540 } // namespace internal
541 } // namespace v8 541 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-regexp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698