Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 209c2ade04a077b1b340251f295bbfcbdd061e12..d6391c6cf36d8295a72df22c3294267ea17f320e 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -3424,6 +3424,13 @@ bool Map::is_observed() { |
return IsObserved::decode(bit_field3()); |
} |
+void Map::NotifyObjectLayoutChange() { |
+ DeoptimizeDependentCodes(DependentCodes::kPrototypeCheckGroup); |
+} |
+ |
+bool Map::CanOmitPrototypeChecks() { |
+ return !HasTransitionArray() && !is_dictionary_map(); |
+} |
void Map::AddDependentCode(DependentCodes::DependencyGroup group, |
Handle<Code> code) { |
@@ -3468,20 +3475,12 @@ void DependentCodes::clear_code_at(int i) { |
} |
-void DependentCodes::ComputeGroupStartIndexes(GroupStartIndexes starts) { |
- starts[0] = 0; |
- for (int g = 1; g <= kGroupCount; g++) { |
- int count = number_of_codes(static_cast<DependencyGroup>(g - 1)); |
- starts[g] = starts[g - 1] + count; |
- } |
-} |
- |
- |
void DependentCodes::ExtendGroup(DependencyGroup group) { |
- GroupStartIndexes starts; |
- ComputeGroupStartIndexes(starts); |
- for (int g = kGroupCount - 2; g > group; g--) { |
- set_code_at(starts[g + 1], code_at(starts[g])); |
+ GroupStartIndexes starts(this); |
+ for (int g = kGroupCount - 1; g > group; g--) { |
+ if (starts.at(g) < starts.at(g + 1)) { |
+ set_code_at(starts.at(g + 1), code_at(starts.at(g))); |
+ } |
} |
} |