Index: src/debug.cc |
=================================================================== |
--- src/debug.cc (revision 9327) |
+++ src/debug.cc (working copy) |
@@ -401,15 +401,15 @@ |
// Step in can only be prepared if currently positioned on an IC call, |
// construct call or CallFunction stub call. |
Address target = rinfo()->target_address(); |
- Handle<Code> code(Code::GetCodeFromTargetAddress(target)); |
- if (code->is_call_stub() || code->is_keyed_call_stub()) { |
+ Handle<Code> target_code(Code::GetCodeFromTargetAddress(target)); |
+ if (target_code->is_call_stub() || target_code->is_keyed_call_stub()) { |
// Step in through IC call is handled by the runtime system. Therefore make |
// sure that the any current IC is cleared and the runtime system is |
// called. If the executing code has a debug break at the location change |
// the call in the original code as it is the code there that will be |
// executed in place of the debug break call. |
- Handle<Code> stub = ComputeCallDebugPrepareStepIn(code->arguments_count(), |
- code->kind()); |
+ Handle<Code> stub = ComputeCallDebugPrepareStepIn( |
+ target_code->arguments_count(), target_code->kind()); |
if (IsDebugBreak()) { |
original_rinfo()->set_target_address(stub->entry()); |
} else { |
@@ -419,7 +419,7 @@ |
#ifdef DEBUG |
// All the following stuff is needed only for assertion checks so the code |
// is wrapped in ifdef. |
- Handle<Code> maybe_call_function_stub = code; |
+ Handle<Code> maybe_call_function_stub = target_code; |
if (IsDebugBreak()) { |
Address original_target = original_rinfo()->target_address(); |
maybe_call_function_stub = |
@@ -436,8 +436,9 @@ |
// Step in through CallFunction stub should also be prepared by caller of |
// this function (Debug::PrepareStep) which should flood target function |
// with breakpoints. |
- ASSERT(RelocInfo::IsConstructCall(rmode()) || code->is_inline_cache_stub() |
- || is_call_function_stub); |
+ ASSERT(RelocInfo::IsConstructCall(rmode()) || |
+ target_code->is_inline_cache_stub() || |
+ is_call_function_stub); |
#endif |
} |
} |
@@ -474,11 +475,11 @@ |
RelocInfo::Mode mode = rmode(); |
if (RelocInfo::IsCodeTarget(mode)) { |
Address target = rinfo()->target_address(); |
- Handle<Code> code(Code::GetCodeFromTargetAddress(target)); |
+ Handle<Code> target_code(Code::GetCodeFromTargetAddress(target)); |
// Patch the code to invoke the builtin debug break function matching the |
// calling convention used by the call site. |
- Handle<Code> dbgbrk_code(Debug::FindDebugBreak(code, mode)); |
+ Handle<Code> dbgbrk_code(Debug::FindDebugBreak(target_code, mode)); |
rinfo()->set_target_address(dbgbrk_code->entry()); |
} |
} |
@@ -1997,9 +1998,10 @@ |
// Perform two GCs to get rid of all unreferenced scripts. The first GC gets |
// rid of all the cached script wrappers and the second gets rid of the |
- // scripts which are no longer referenced. |
- heap->CollectAllGarbage(false); |
- heap->CollectAllGarbage(false); |
+ // scripts which are no longer referenced. The second also sweeps precisely, |
+ // which saves us doing yet another GC to make the heap iterable. |
+ heap->CollectAllGarbage(Heap::kNoGCFlags); |
+ heap->CollectAllGarbage(Heap::kMakeHeapIterableMask); |
ASSERT(script_cache_ == NULL); |
script_cache_ = new ScriptCache(); |
@@ -2007,6 +2009,8 @@ |
// Scan heap for Script objects. |
int count = 0; |
HeapIterator iterator; |
+ AssertNoAllocation no_allocation; |
+ |
for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { |
if (obj->IsScript() && Script::cast(obj)->HasValidSource()) { |
script_cache_->Add(Handle<Script>(Script::cast(obj))); |
@@ -2047,7 +2051,7 @@ |
// Perform GC to get unreferenced scripts evicted from the cache before |
// returning the content. |
- isolate_->heap()->CollectAllGarbage(false); |
+ isolate_->heap()->CollectAllGarbage(Heap::kNoGCFlags); |
// Get the scripts from the cache. |
return script_cache_->GetScripts(); |