void BreakLocation::SetBreakPoint(Handle<Object> break_point_object) {
// If there is not already a real break point here patch code with debug
// break.
+ DCHECK(code()->has_debug_break_slots());
if (!HasBreakPoint()) SetDebugBreak();
DCHECK(IsDebugBreak() || IsDebuggerStatement());
// Set the break point information.
void Debug::FloodWithOneShot(Handle<JSFunction> function,
BreakLocatorType type) {
- // Do not ever break in native functions.
- if (function->IsFromNativeScript()) return;
+ // Do not ever break in native and extension functions.
+ if (!function->IsSubjectToDebugging()) return;
PrepareForBreakPoints();
isolate_);
if (!bindee.is_null() && bindee->IsJSFunction() &&
- !JSFunction::cast(*bindee)->IsFromNativeScript()) {
+ JSFunction::cast(*bindee)->IsSubjectToDebugging()) {
Handle<JSFunction> bindee_function(JSFunction::cast(*bindee));
FloodWithOneShotGeneric(bindee_function);
}
DCHECK(location.IsExit());
frames_it.Advance();
}
- // Skip builtin functions on the stack.
+ // Skip native and extension functions on the stack.
while (!frames_it.done() &&
- frames_it.frame()->function()->IsFromNativeScript()) {
+ !frames_it.frame()->function()->IsSubjectToDebugging()) {
frames_it.Advance();
}
// Step out: If there is a JavaScript caller frame, we need to
for (int i = 0; i < active_functions.length(); i++) {
Handle<JSFunction> function = active_functions[i];
Handle<SharedFunctionInfo> shared(function->shared());
-
- // If recompilation is not possible just skip it.
- if (!shared->allows_lazy_compilation()) continue;
+ if (!shared->allows_lazy_compilation()) {
+ // Ignore functions that cannot be recompiled. Fortunately, those are
+ // only ones that are not subject to debugging in the first place.
+ DCHECK(!function->IsSubjectToDebugging());
+ continue;
+ }
if (shared->code()->kind() == Code::BUILTIN) continue;
EnsureFunctionHasDebugBreakSlots(function);
if (receiver->IsJSBuiltinsObject()) return false;
if (fun->IsBuiltin()) {
return fun->shared()->native();
- } else if (fun->IsFromNativeScript() || fun->IsFromExtensionScript()) {
+ } else if (!fun->IsSubjectToDebugging()) {
return false;
}
}
for (int i = 1; i < elements_limit; i += 4) {
Handle<JSFunction> fun =
handle(JSFunction::cast(elements->get(i + 1)), this);
- if (fun->IsFromNativeScript()) continue;
+ if (!fun->IsSubjectToDebugging()) continue;
Object* script = fun->shared()->script();
if (script->IsScript() &&
// Tells whether this function is defined in an extension script.
inline bool IsFromExtensionScript();
+ // Tells whether this function should be subject to debugging.
+ inline bool IsSubjectToDebugging();
+
// Tells whether or not the function needs arguments adaption.
inline bool NeedsArgumentsAdaption();
List<FrameSummary> frames(FLAG_max_inlining_levels + 1);
it.frame()->Summarize(&frames);
for (int i = frames.length() - 1; i >= 0; i--) {
- // Omit functions from native scripts.
- if (!frames[i].function()->IsFromNativeScript()) n++;
+ // Omit functions from native and extension scripts.
+ if (frames[i].function()->IsSubjectToDebugging()) n++;
}
}
return Smi::FromInt(n);
List<FrameSummary> frames(FLAG_max_inlining_levels + 1);
it->frame()->Summarize(&frames);
for (int i = frames.length() - 1; i >= 0; i--) {
- // Omit functions from native scripts.
- if (frames[i].function()->IsFromNativeScript()) continue;
+ // Omit functions from native and extension scripts.
+ if (!frames[i].function()->IsSubjectToDebugging()) continue;
if (++count == index) return i;
}
}