Index: src/lithium.cc |
diff --git a/src/lithium.cc b/src/lithium.cc |
index f23503afdd3ff37cde5c4a0901bb1b7d71a12a3d..ecb5a5863563f84f14b3037e6a214617b7bea9ea 100644 |
--- a/src/lithium.cc |
+++ b/src/lithium.cc |
@@ -233,7 +233,8 @@ LChunk::LChunk(CompilationInfo* info, HGraph* graph) |
graph_(graph), |
instructions_(32, graph->zone()), |
pointer_maps_(8, graph->zone()), |
- inlined_closures_(1, graph->zone()) { |
+ inlined_closures_(1, graph->zone()), |
+ deprecation_dependencies_(MapLess(), MapAllocator(graph->zone())) { |
} |
@@ -372,6 +373,19 @@ Representation LChunk::LookupLiteralRepresentation( |
} |
+void LChunk::CommitDependencies(Handle<Code> code) const { |
+ for (MapSet::const_iterator it = deprecation_dependencies_.begin(), |
+ iend = deprecation_dependencies_.end(); it != iend; ++it) { |
+ Handle<Map> map = *it; |
+ ASSERT(!map->is_deprecated()); |
+ ASSERT(map->CanBeDeprecated()); |
+ Map::AddDependentCode(map, DependentCode::kTransitionGroup, code); |
+ } |
+ |
+ info_->CommitDependencies(code); |
+} |
+ |
+ |
LChunk* LChunk::NewChunk(HGraph* graph) { |
DisallowHandleAllocation no_handles; |
DisallowHeapAllocation no_gc; |
@@ -415,6 +429,7 @@ Handle<Code> LChunk::Codegen() { |
Handle<Code> code = |
CodeGenerator::MakeCodeEpilogue(&assembler, flags, info()); |
generator.FinishCode(code); |
+ CommitDependencies(code); |
code->set_is_crankshafted(true); |
void* jit_handler_data = |
assembler.positions_recorder()->DetachJITHandlerData(); |