Chromium Code Reviews| Index: src/code-stubs.cc |
| diff --git a/src/code-stubs.cc b/src/code-stubs.cc |
| index d12def85efa03dd539341af65f32bec7349e2984..da5d97890c36eb931c1ac0237dd3f750cb9663da 100644 |
| --- a/src/code-stubs.cc |
| +++ b/src/code-stubs.cc |
| @@ -120,8 +120,10 @@ Handle<Code> CodeStub::GetCode() { |
| GetKey(), |
| new_object); |
| heap->public_set_code_stubs(*dict); |
| - |
| code = *new_object; |
| + if (MajorKey() == RecordWrite) { |
| + heap->incremental_marking()->ActivateGeneratedStub(code); |
|
Lasse Reichstein
2011/07/12 06:44:16
Seems like the wrong direction of dependency, to m
Vyacheslav Egorov (Chromium)
2011/07/12 11:17:11
I did not want to introduce two virtual function f
|
| + } |
| } |
| ASSERT(!NeedsImmovableCode() || heap->lo_space()->Contains(code)); |
| @@ -160,6 +162,14 @@ MaybeObject* CodeStub::TryGetCode() { |
| heap->code_stubs()->AtNumberPut(GetKey(), code); |
| if (maybe_new_object->ToObject(&new_object)) { |
| heap->public_set_code_stubs(NumberDictionary::cast(new_object)); |
| + } else if (MajorKey() == RecordWrite) { |
|
Lasse Reichstein
2011/07/12 06:44:16
Again, create a virtual function, e.g., MustBeCach
Vyacheslav Egorov (Chromium)
2011/07/12 11:17:11
Done.
|
| + // All RecordWrite stubs have to be registered in the stub cache. |
| + return maybe_new_object; |
| + } |
| + |
| + // If this is a RecordWrite stub we need to patch it to ensure correct state. |
| + if (MajorKey() == RecordWrite) { |
| + heap->incremental_marking()->ActivateGeneratedStub(code); |
|
Lasse Reichstein
2011/07/12 06:44:16
And again.
Vyacheslav Egorov (Chromium)
2011/07/12 11:17:11
Done.
|
| } |
| } |