[compiler] Verify that type feedback vector structure is the same on recompile.
authormvstanton <mvstanton@chromium.org>
Mon, 3 Aug 2015 08:14:41 +0000 (01:14 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 3 Aug 2015 08:14:49 +0000 (08:14 +0000)
Use a CHECK statement to find any violations of this rule.

Review URL: https://codereview.chromium.org/1255383004

Cr-Commit-Position: refs/heads/master@{#29965}

src/compiler.cc

index 7f060dc..ccf4171 100644 (file)
@@ -211,11 +211,14 @@ bool CompilationInfo::ShouldSelfOptimize() {
 
 
 void CompilationInfo::EnsureFeedbackVector() {
-  if (feedback_vector_.is_null() ||
-      feedback_vector_->SpecDiffersFrom(function()->feedback_vector_spec())) {
+  if (feedback_vector_.is_null()) {
     feedback_vector_ = isolate()->factory()->NewTypeFeedbackVector(
         function()->feedback_vector_spec());
   }
+
+  // It's very important that recompiles do not alter the structure of the
+  // type feedback vector.
+  CHECK(!feedback_vector_->SpecDiffersFrom(function()->feedback_vector_spec()));
 }