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

Unified Diff: src/liveedit.cc

Issue 291193002: Revert "Fix Heap::IsHeapIterable." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/liveedit.cc
diff --git a/src/liveedit.cc b/src/liveedit.cc
index a538c0c76e08d320b5dd97dc9cca7d39e4466468..e6bb4b29a636297d25d1d69c9ca7ff3a7b1edb52 100644
--- a/src/liveedit.cc
+++ b/src/liveedit.cc
@@ -939,10 +939,13 @@ static void ReplaceCodeObject(Handle<Code> original,
// to code objects (that are never in new space) without worrying about
// write barriers.
Heap* heap = original->GetHeap();
- HeapIterator iterator(heap);
+ heap->CollectAllGarbage(Heap::kMakeHeapIterableMask,
+ "liveedit.cc ReplaceCodeObject");
ASSERT(!heap->InNewSpace(*substitution));
+ DisallowHeapAllocation no_allocation;
+
ReplacingVisitor visitor(*original, *substitution);
// Iterate over all roots. Stack frames may have pointer into original code,
@@ -952,6 +955,7 @@ static void ReplaceCodeObject(Handle<Code> original,
// Now iterate over all pointers of all objects, including code_target
// implicit pointers.
+ HeapIterator iterator(heap);
for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
obj->Iterate(&visitor);
}
@@ -1015,6 +1019,8 @@ class LiteralFixer {
template<typename Visitor>
static void IterateJSFunctions(SharedFunctionInfo* shared_info,
Visitor* visitor) {
+ DisallowHeapAllocation no_allocation;
+
HeapIterator iterator(shared_info->GetHeap());
for (HeapObject* obj = iterator.next(); obj != NULL;
obj = iterator.next()) {
@@ -1159,7 +1165,7 @@ void LiveEdit::ReplaceFunctionCode(
Handle<SharedFunctionInfo> shared_info = shared_info_wrapper.GetInfo();
- isolate->heap()->MakeHeapIterable();
+ isolate->heap()->EnsureHeapIsIterable();
if (IsJSFunctionCode(shared_info->code())) {
Handle<Code> code = compile_info_wrapper.GetFunctionCode();
@@ -1396,7 +1402,7 @@ void LiveEdit::PatchFunctionPositions(Handle<JSArray> shared_info_array,
info->set_end_position(new_function_end);
info->set_function_token_position(new_function_token_pos);
- info->GetIsolate()->heap()->MakeHeapIterable();
+ info->GetIsolate()->heap()->EnsureHeapIsIterable();
if (IsJSFunctionCode(info->code())) {
// Patch relocation info section of the code.
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698