Reviewers: Jakob,

Description:
Use 0 instead of undefined for uninitialized stub key.

The CPU profiler looks at uninitialized code objects, which triggers an
assertion.

[email protected]

Please review this at https://codereview.chromium.org/404113003/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+2, -2 lines):
  M src/factory.cc
  M src/objects-debug.cc


Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 3a6c2e1da26ada573b89cf3465c13f626253f236..4bdb657fd7b84a972b4a776fc4554466873ad056 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1437,7 +1437,7 @@ Handle<Code> Factory::NewCode(const CodeDesc& desc,
   code->set_raw_kind_specific_flags2(0);
   code->set_is_crankshafted(crankshafted);
   code->set_deoptimization_data(*empty_fixed_array(), SKIP_WRITE_BARRIER);
-  code->set_raw_type_feedback_info(*undefined_value());
+  code->set_raw_type_feedback_info(Smi::FromInt(0));
   code->set_next_code_link(*undefined_value());
   code->set_handler_table(*empty_fixed_array(), SKIP_WRITE_BARRIER);
   code->set_prologue_offset(prologue_offset);
Index: src/objects-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index b374021c1ec0ad06095f6cbd89b36649519cc0e2..df71c0b5baf5ce181a4d0e07ce798c4866dcd1f8 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -639,7 +639,7 @@ void Code::CodeVerify() {
       last_gc_pc = it.rinfo()->pc();
     }
   }
-  CHECK(raw_type_feedback_info()->IsUndefined() ||
+  CHECK(raw_type_feedback_info() == Smi::FromInt(0) ||
         raw_type_feedback_info()->IsSmi() == IsCodeStubOrIC());
 }



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to