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

Side by Side Diff: src/code-stubs.cc

Issue 15735020: trace compare_nil_ic state in --trace-ic output (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/code-stubs.h ('k') | src/ic.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 types_ = Types::FullCompare(); 426 types_ = Types::FullCompare();
427 } else if (IsMonomorphic()) { 427 } else if (IsMonomorphic()) {
428 types_ = Types::FullCompare(); 428 types_ = Types::FullCompare();
429 } else { 429 } else {
430 types_.Add(MONOMORPHIC_MAP); 430 types_.Add(MONOMORPHIC_MAP);
431 } 431 }
432 } 432 }
433 } 433 }
434 434
435 435
436 void CompareNilICStub::Types::TraceTransition(Types to) const {
437 #ifdef DEBUG
438 if (!FLAG_trace_ic) return;
439 char buffer[100];
440 NoAllocationStringAllocator allocator(buffer,
441 static_cast<unsigned>(sizeof(buffer)));
442 StringStream stream(&allocator);
443 stream.Add("[CompareNilIC : ");
444 Print(&stream);
445 stream.Add("=>");
446 to.Print(&stream);
447 stream.Add("]\n");
448 stream.OutputToStdOut();
449 #endif
450 }
451
452
436 void CompareNilICStub::PrintName(StringStream* stream) { 453 void CompareNilICStub::PrintName(StringStream* stream) {
437 stream->Add("CompareNilICStub_"); 454 stream->Add("CompareNilICStub_");
438 types_.Print(stream); 455 types_.Print(stream);
439 stream->Add((nil_value_ == kNullValue) ? "(NullValue|": 456 stream->Add((nil_value_ == kNullValue) ? "(NullValue|":
440 "(UndefinedValue|"); 457 "(UndefinedValue|");
441 stream->Add((equality_kind_ == kStrictEquality) ? "StrictEquality)": 458 stream->Add((equality_kind_ == kStrictEquality) ? "StrictEquality)":
442 "NonStrictEquality)"); 459 "NonStrictEquality)");
443 } 460 }
444 461
445 462
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 if (Contains(SMI)) printer.Add("Smi"); 587 if (Contains(SMI)) printer.Add("Smi");
571 if (Contains(SPEC_OBJECT)) printer.Add("SpecObject"); 588 if (Contains(SPEC_OBJECT)) printer.Add("SpecObject");
572 if (Contains(STRING)) printer.Add("String"); 589 if (Contains(STRING)) printer.Add("String");
573 if (Contains(SYMBOL)) printer.Add("Symbol"); 590 if (Contains(SYMBOL)) printer.Add("Symbol");
574 if (Contains(HEAP_NUMBER)) printer.Add("HeapNumber"); 591 if (Contains(HEAP_NUMBER)) printer.Add("HeapNumber");
575 stream->Add(")"); 592 stream->Add(")");
576 } 593 }
577 594
578 595
579 void ToBooleanStub::Types::TraceTransition(Types to) const { 596 void ToBooleanStub::Types::TraceTransition(Types to) const {
597 #ifdef DEBUG
580 if (!FLAG_trace_ic) return; 598 if (!FLAG_trace_ic) return;
581 char buffer[100]; 599 char buffer[100];
582 NoAllocationStringAllocator allocator(buffer, 600 NoAllocationStringAllocator allocator(buffer,
583 static_cast<unsigned>(sizeof(buffer))); 601 static_cast<unsigned>(sizeof(buffer)));
584 StringStream stream(&allocator); 602 StringStream stream(&allocator);
585 stream.Add("[ToBooleanIC ("); 603 stream.Add("[ToBooleanIC : ");
586 Print(&stream); 604 Print(&stream);
587 stream.Add("->"); 605 stream.Add("=>");
588 to.Print(&stream); 606 to.Print(&stream);
589 stream.Add(")]\n"); 607 stream.Add("]\n");
590 stream.OutputToStdOut(); 608 stream.OutputToStdOut();
609 #endif
591 } 610 }
592 611
593 612
594 bool ToBooleanStub::Types::Record(Handle<Object> object) { 613 bool ToBooleanStub::Types::Record(Handle<Object> object) {
595 if (object->IsUndefined()) { 614 if (object->IsUndefined()) {
596 Add(UNDEFINED); 615 Add(UNDEFINED);
597 return false; 616 return false;
598 } else if (object->IsBoolean()) { 617 } else if (object->IsBoolean()) {
599 Add(BOOLEAN); 618 Add(BOOLEAN);
600 return object->IsTrue(); 619 return object->IsTrue();
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 } else if (argument_count >= 2) { 762 } else if (argument_count >= 2) {
744 argument_count_ = MORE_THAN_ONE; 763 argument_count_ = MORE_THAN_ONE;
745 } else { 764 } else {
746 UNREACHABLE(); 765 UNREACHABLE();
747 } 766 }
748 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); 767 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
749 } 768 }
750 769
751 770
752 } } // namespace v8::internal 771 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698