void CompilationInfo::EnsureFeedbackVector() {
- if (feedback_vector_.is_null()) {
+ if (feedback_vector_.is_null() ||
+ feedback_vector_->SpecDiffersFrom(function()->feedback_vector_spec())) {
feedback_vector_ = isolate()->factory()->NewTypeFeedbackVector(
function()->feedback_vector_spec());
}
}
+bool TypeFeedbackVector::SpecDiffersFrom(
+ const ZoneFeedbackVectorSpec* other_spec) const {
+ if (other_spec->slots() != Slots() || other_spec->ic_slots() != ICSlots()) {
+ return true;
+ }
+
+ int ic_slots = ICSlots();
+ for (int i = 0; i < ic_slots; i++) {
+ if (GetKind(FeedbackVectorICSlot(i)) != other_spec->GetKind(i)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+
// This logic is copied from
// StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget.
static bool ClearLogic(Heap* heap) {
inline int ic_metadata_length() const;
+ bool SpecDiffersFrom(const ZoneFeedbackVectorSpec* other_spec) const;
+
int Slots() const {
if (length() == 0) return 0;
return Max(
--- /dev/null
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --always-opt --expose-gc
+
+function __f_0(message, a) {
+ eval(), message;
+ (function blue() {
+ 'use strict';
+ eval(), eval(), message;
+ gc();
+ })();
+}
+__f_0();