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

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

Issue 1330153003: Adding template parameter to PrototypeIterator GetCurrent for casting (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: simplifications Created 5 years, 3 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-object.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 "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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 for (PrototypeIterator iter(isolate, receiver, 530 for (PrototypeIterator iter(isolate, receiver,
531 PrototypeIterator::START_AT_RECEIVER); 531 PrototypeIterator::START_AT_RECEIVER);
532 !iter.IsAtEnd(); iter.Advance()) { 532 !iter.IsAtEnd(); iter.Advance()) {
533 if (iter.GetCurrent()->IsJSObject()) { 533 if (iter.GetCurrent()->IsJSObject()) {
534 Object* key = JSObject::cast(iter.GetCurrent())->SlowReverseLookup(fun); 534 Object* key = iter.GetCurrent<JSObject>()->SlowReverseLookup(fun);
535 if (key != isolate->heap()->undefined_value()) { 535 if (key != isolate->heap()->undefined_value()) {
536 if (!name->IsString() || 536 if (!name->IsString() ||
537 !key->IsString() || 537 !key->IsString() ||
538 !String::cast(name)->Equals(String::cast(key))) { 538 !String::cast(name)->Equals(String::cast(key))) {
539 print_name = true; 539 print_name = true;
540 } 540 }
541 if (name->IsString() && String::cast(name)->length() == 0) { 541 if (name->IsString() && String::cast(name)->length() == 0) {
542 print_name = false; 542 print_name = false;
543 } 543 }
544 name = key; 544 name = key;
(...skipping 26 matching lines...) Expand all
571 MemCopy(new_space, space_, *bytes); 571 MemCopy(new_space, space_, *bytes);
572 *bytes = new_bytes; 572 *bytes = new_bytes;
573 DeleteArray(space_); 573 DeleteArray(space_);
574 space_ = new_space; 574 space_ = new_space;
575 return new_space; 575 return new_space;
576 } 576 }
577 577
578 578
579 } // namespace internal 579 } // namespace internal
580 } // namespace v8 580 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698