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

Unified Diff: src/code-stubs.cc

Issue 15806005: fix the compare nil ic (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 side-by-side diff with in-line comments
Download patch
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 312febc1aa5701d0de3d3a10534d809f0db74647..59d56375da1305e73c420dd4a78b59fca0887ae2 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -45,7 +45,8 @@ CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor()
function_mode_(NOT_JS_FUNCTION_STUB_MODE),
register_params_(NULL),
deoptimization_handler_(NULL),
- miss_handler_(IC_Utility(IC::kUnreachable), Isolate::Current()) { }
+ miss_handler_(IC_Utility(IC::kUnreachable), Isolate::Current()),
+ has_miss_handler_(false) { }
bool CodeStub::FindCodeInCache(Code** code_out, Isolate* isolate) {
@@ -410,6 +411,7 @@ void ICCompareStub::Generate(MacroAssembler* masm) {
void CompareNilICStub::Record(Handle<Object> object) {
ASSERT(types_ != Types::FullCompare());
+ Types old_types(types_);
if (equality_kind_ == kStrictEquality) {
// When testing for strict equality only one value will evaluate to true
types_.RemoveAll();
@@ -430,6 +432,22 @@ void CompareNilICStub::Record(Handle<Object> object) {
types_.Add(MONOMORPHIC_MAP);
}
}
+ old_types.TraceTransition(types_);
+}
+
+
+void CompareNilICStub::Types::TraceTransition(Types to) const {
+ if (!FLAG_trace_ic) return;
+ char buffer[100];
+ NoAllocationStringAllocator allocator(buffer,
+ static_cast<unsigned>(sizeof(buffer)));
+ StringStream stream(&allocator);
+ stream.Add("[CompareNilIC (");
+ Print(&stream);
+ stream.Add("->");
+ to.Print(&stream);
+ stream.Add(")]\n");
+ stream.OutputToStdOut();
}
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | src/code-stubs-hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698