Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: src/code-stubs.cc

Issue 7329049: Patch RecordWriteStub after adding it to the stub cache not during generation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
}
}

Powered by Google App Engine
This is Rietveld 408576698