Lines Matching refs:function
162 // Set the positions to the end of the function.
329 // function twice might happen when stepping in a function with an exception
330 // handler as the handler and the function is the same.
403 // because caller of this function (Debug::PrepareStep) is expected to
404 // flood the top frame's function with one shot breakpoints.
406 // this function (Debug::PrepareStep) which should flood target function
415 // Check whether the break point is at a position which will exit the function.
442 // Find the builtin debug break function matching the calling convention
495 // Patch the code to invoke the builtin debug break function matching the
696 // We need to clear all breakpoints associated with the function to restore
698 // the function will live in the heap until next gc, and can be found by
756 // Execute the shared function in the debugger context.
757 Handle<JSFunction> function =
762 function, handle(context->global_proxy()), 0, NULL, &maybe_exception);
783 Handle<Script> script(Script::cast(function->shared()->script()));
886 Handle<SharedFunctionInfo>(frame->function()->shared());
989 // triggered. This function returns a JSArray with the break point objects
1034 // Get the function IsBreakPointTriggered (defined in debug-debugger.js).
1061 // Check whether the function has debug information.
1067 // Return the debug info for this function. EnsureDebugInfo must be called
1075 bool Debug::SetBreakPoint(Handle<JSFunction> function,
1082 // Make sure the function is compiled and has set up the debug info.
1083 Handle<SharedFunctionInfo> shared(function->shared());
1084 if (!EnsureDebugInfo(shared, function)) {
1113 // Obtain shared function info for the function.
1117 // Make sure the function has set up the debug info.
1124 // Find position within function. The script position might be before the
1125 // source position of the first function.
1169 // function.
1197 void Debug::FloodWithOneShot(Handle<JSFunction> function) {
1200 // Make sure the function is compiled and has set up the debug info.
1201 Handle<SharedFunctionInfo> shared(function->shared());
1202 if (!EnsureDebugInfo(shared, function)) {
1207 // Flood the function with break points.
1216 void Debug::FloodBoundFunctionWithOneShot(Handle<JSFunction> function) {
1217 Handle<FixedArray> new_bindings(function->function_bindings());
1239 // Flood the function with the catch block with break points
1240 FloodWithOneShot(Handle<JSFunction>(frame->function()));
1314 // If the function on the top frame is unresolved perform step out. This will
1317 if (!frame->function()->IsJSFunction()) {
1321 // Fill the function to return to with one-shot break points.
1322 JSFunction* function = frames_it.frame()->function();
1323 FloodWithOneShot(Handle<JSFunction>(function));
1328 Handle<JSFunction> function(frame->function());
1329 Handle<SharedFunctionInfo> shared(function->shared());
1330 if (!EnsureDebugInfo(shared, function)) {
1396 frames_it.frame()->function()->IsFromNativeScript()) {
1402 // Fill the function to return to with one-shot break points.
1403 JSFunction* function = frames_it.frame()->function();
1404 FloodWithOneShot(Handle<JSFunction>(function));
1413 // Fill the current function with one-shot break points.
1414 FloodWithOneShot(function);
1422 // to function which is going to be restarted.
1428 // If it's CallFunction stub ensure target function is compiled and flood
1435 // expected arguments of the called function.
1445 // Find target function on the expression stack.
1451 // Function to call
1476 // It will also compile target function if it's not compiled yet.
1482 // Fill the current function with one-shot break points even for step in on
1483 // a call target as the function called might be a native function for
1486 FloodWithOneShot(function);
1509 // flooded with one-shot break points. This function helps to perform several
1524 // Never continue if returning from function.
1550 // Simple function for returning the source positions for active break points.
1592 // Handle stepping into a function.
1593 void Debug::HandleStepIn(Handle<JSFunction> function,
1597 Isolate* isolate = function->GetIsolate();
1610 // Flood the function with one-shot break points if it is called from where
1613 if (function->shared()->bound()) {
1614 // Handle Function.prototype.bind
1615 Debug::FloodBoundFunctionWithOneShot(function);
1616 } else if (!function->IsFromNativeScript()) {
1618 if (function->shared()->code() ==
1620 function->shared()->code() ==
1622 // Handle function.apply and function.call separately to flood the
1623 // function to be called and not the code for Builtins::FunctionApply or
1625 // function.
1631 // Handle Function.prototype.bind
1636 Debug::FloodWithOneShot(function);
1656 // function is called each time a break point is hit as one shot break points
1660 // last break point for a function is removed that function is automatically
1719 JSFunction* function = functions[i];
1720 active_functions->Add(Handle<JSFunction>(function));
1721 function->shared()->code()->set_gc_metadata(active_code_marker);
1723 } else if (frame->function()->IsJSFunction()) {
1724 JSFunction* function = frame->function();
1725 DCHECK(frame->LookupCode()->kind() == Code::FUNCTION);
1726 active_functions->Add(Handle<JSFunction>(function));
1727 function->shared()->code()->set_gc_metadata(active_code_marker);
1738 DCHECK_EQ(code->kind(), Code::FUNCTION);
1761 DCHECK_EQ(code->kind(), Code::FUNCTION);
1792 if (frame->is_optimized() || !frame->function()->IsJSFunction()) continue;
1794 JSFunction* function = frame->function();
1796 DCHECK(frame->LookupCode()->kind() == Code::FUNCTION);
1801 Handle<Code> new_code(function->shared()->code());
1802 if (new_code->kind() != Code::FUNCTION ||
1874 static void EnsureFunctionHasDebugBreakSlots(Handle<JSFunction> function) {
1875 if (function->code()->kind() == Code::FUNCTION &&
1876 function->code()->has_debug_break_slots()) {
1877 // Nothing to do. Function code already had debug break slots.
1882 if (!function->shared()->code()->has_debug_break_slots()) {
1883 MaybeHandle<Code> code = Compiler::GetDebugCode(function);
1885 if (!code.is_null()) function->ReplaceCode(*code.ToHandleChecked());
1888 function->ReplaceCode(function->shared()->code());
1896 Handle<JSFunction> fun(generators[i]->function());
1966 // function and mark them for lazy compilation.
1970 JSFunction* function = JSFunction::cast(obj);
1971 SharedFunctionInfo* shared = function->shared();
1975 if (function->IsFromNativeScript()) continue;
1979 generator_functions.Add(Handle<JSFunction>(function, isolate_));
1983 Code::Kind kind = function->code()->kind();
1984 if (kind == Code::FUNCTION &&
1985 !function->code()->has_debug_break_slots()) {
1986 function->ReplaceCode(*lazy_compile);
1987 function->shared()->ReplaceCode(*lazy_compile);
1989 (function->IsInOptimizationQueue() ||
1990 function->IsMarkedForOptimization() ||
1991 function->IsMarkedForConcurrentOptimization())) {
1993 Code* shared_code = function->shared()->code();
1994 if (shared_code->kind() == Code::FUNCTION &&
1996 function->ReplaceCode(shared_code);
1998 function->ReplaceCode(*lazy_compile);
1999 function->shared()->ReplaceCode(*lazy_compile);
2006 JSFunction* fun = gen->function();
2007 DCHECK_EQ(fun->code()->kind(), Code::FUNCTION);
2025 Handle<JSFunction> function = active_functions[i];
2026 function->shared()->code()->set_gc_metadata(Smi::FromInt(0));
2037 Handle<JSFunction> &function = generator_functions[i];
2038 if (function->code()->kind() != Code::FUNCTION) continue;
2039 if (function->code()->has_debug_break_slots()) continue;
2040 function->ReplaceCode(*lazy_compile);
2041 function->shared()->ReplaceCode(*lazy_compile);
2050 Handle<JSFunction> function = active_functions[i];
2051 Handle<SharedFunctionInfo> shared(function->shared());
2058 EnsureFunctionHasDebugBreakSlots(function);
2079 // compiled function and the actual requested break point might be in one of
2096 Handle<JSFunction> function;
2099 function = Handle<JSFunction>(JSFunction::cast(obj));
2100 shared = Handle<SharedFunctionInfo>(function->shared());
2120 // If there is no candidate or this function is within the current
2124 target_function = function;
2129 // If a top-level function contains only one function
2130 // declaration the source for the top-level and the function
2131 // is the same. In that case prefer the non top-level function.
2134 target_function = function;
2139 // This containment check includes equality as a function
2140 // inside a top-level function can share either start or end
2141 // position with the top-level function.
2143 target_function = function;
2178 Handle<JSFunction> function) {
2190 // Ensure function is compiled. Return false if this failed.
2191 if (!function.is_null() &&
2192 !Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) {
2247 // Get the executing function in which the debug break occurred.
2248 Handle<JSFunction> function(JSFunction::cast(frame->function()));
2249 Handle<SharedFunctionInfo> shared(function->shared());
2250 if (!EnsureDebugInfo(shared, function)) {
2322 // function and therefore no "original code" is available.
2341 // Get the executing function in which the debug break occurred.
2342 Handle<JSFunction> function(JSFunction::cast(frame->function()));
2343 Handle<SharedFunctionInfo> shared(function->shared());
2344 if (!EnsureDebugInfo(shared, function)) {
2421 // For eval scripts add information on the function from which eval was
2425 script->set_eval_from_shared(it.frame()->function()->shared());
2635 // Get the function UpdateScriptBreakPoints (defined in debug-debugger.js).
2727 // a JavaScript function. Don't call event listener for v8::Break
3037 Object* fun = it.frame()->function();