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

Side by Side Diff: src/runtime.cc

Issue 19520006: Fix GC issue in Runtime_DebugEvaluate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 12596 matching lines...) Expand 10 before | Expand all | Expand 10 after
12607 // Add the materialized object in a with-scope to shadow the stack locals. 12607 // Add the materialized object in a with-scope to shadow the stack locals.
12608 context = isolate->factory()->NewWithContext(function, context, materialized); 12608 context = isolate->factory()->NewWithContext(function, context, materialized);
12609 12609
12610 Handle<Object> receiver(frame->receiver(), isolate); 12610 Handle<Object> receiver(frame->receiver(), isolate);
12611 Object* evaluate_result_object; 12611 Object* evaluate_result_object;
12612 { MaybeObject* maybe_result = 12612 { MaybeObject* maybe_result =
12613 DebugEvaluate(isolate, context, context_extension, receiver, source); 12613 DebugEvaluate(isolate, context, context_extension, receiver, source);
12614 if (!maybe_result->ToObject(&evaluate_result_object)) return maybe_result; 12614 if (!maybe_result->ToObject(&evaluate_result_object)) return maybe_result;
12615 } 12615 }
12616 12616
12617 Handle<Object> result(evaluate_result_object, isolate);
12618
12617 // Write back potential changes to materialized stack locals to the stack. 12619 // Write back potential changes to materialized stack locals to the stack.
12618 UpdateStackLocalsFromMaterializedObject( 12620 UpdateStackLocalsFromMaterializedObject(
12619 isolate, materialized, function, frame, inlined_jsframe_index); 12621 isolate, materialized, function, frame, inlined_jsframe_index);
12620 12622
12621 return evaluate_result_object; 12623 return *result;
12622 } 12624 }
12623 12625
12624 12626
12625 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugEvaluateGlobal) { 12627 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugEvaluateGlobal) {
12626 HandleScope scope(isolate); 12628 HandleScope scope(isolate);
12627 12629
12628 // Check the execution state and decode arguments frame and source to be 12630 // Check the execution state and decode arguments frame and source to be
12629 // evaluated. 12631 // evaluated.
12630 ASSERT(args.length() == 4); 12632 ASSERT(args.length() == 4);
12631 Object* check_result; 12633 Object* check_result;
(...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after
13986 // Handle last resort GC and make sure to allow future allocations 13988 // Handle last resort GC and make sure to allow future allocations
13987 // to grow the heap without causing GCs (if possible). 13989 // to grow the heap without causing GCs (if possible).
13988 isolate->counters()->gc_last_resort_from_js()->Increment(); 13990 isolate->counters()->gc_last_resort_from_js()->Increment();
13989 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13991 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13990 "Runtime::PerformGC"); 13992 "Runtime::PerformGC");
13991 } 13993 }
13992 } 13994 }
13993 13995
13994 13996
13995 } } // namespace v8::internal 13997 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698