Lines Matching refs:Function
343 // context in which the function was created and we use the object
344 // function from this context to create the object literal. We do
345 // not use the object function from the current global context
346 // because this might be the object function from another context
351 // In case we have function literals, we want the object to be in
426 // containing function literals we defer this operation until after all
428 // constant function properties.
1314 // Copy the function
1317 Handle<JSFunction> function =
1321 value = function;
1343 // function declarations. To mimic this behavior, we do not allow
1344 // the invocation of setters for function values. This makes a
1346 // handlers such as "function onload() {}". Firefox does call the
1388 // Declarations are always made in a function or global context. In the
1425 // function context or the global object of a global context.
1435 // The property is not in the function context. It needs to be
1436 // "declared" in the function context's extension context or as a
1606 // assigned a function value.
1622 // Initializations are always done in a function or global context.
1658 // The property was present in some function's context extension object,
1669 // function f() { eval("delete x; const x;"); }
1912 JSFunction* function = JSFunction::cast(callable);
1914 SharedFunctionInfo* shared = function->shared();
1922 function->context()->global()->global_context();
1935 // Get the RegExp function from the context in the literals array.
1936 // This is the RegExp function from the context in which the
1937 // function was created. We do not use the RegExp function from the
1938 // current global context because this might be the RegExp function
2092 CONVERT_ARG_CHECKED(JSFunction, function, 0);
2099 if (function->HasFastProperties()) {
2101 DescriptorArray* instance_desc = function->map()->instance_descriptors();
2121 { MaybeObject* maybe_map_unchecked = function->map()->CopyDropDescriptors();
2128 function->set_map(new_map);
2131 int entry = function->property_dictionary()->FindEntry(name);
2133 PropertyDetails details = function->property_dictionary()->DetailsAt(entry);
2138 function->property_dictionary()->DetailsAtPut(entry, new_details);
2140 return function;
2183 // and the length of the target function.
2190 // Set the source code of the target function to undefined.
2230 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
2233 SetExpectedNofProperties(function, num);
3891 // Arguments array to replace function is match, captures, index and
4645 // Set the native flag on the function.
5155 Object* function = frame->function();
5156 if (function->IsJSFunction() &&
5157 !JSFunction::cast(function)->shared()->is_classic_mode()) {
5161 return function;
6052 // This function is only useful when it can be inlined and the
6059 // Use strict inequalities since in edge cases the function could be
7425 // custom powi() function than the generic pow().
7739 // Find the arguments of the JavaScript function invocation that called
7796 // TODO(lrn): Create bound function in C++ code from premade shared info.
7798 // Get all arguments of calling function (Function.prototype.bind).
7808 // Initialize array of bindings (function, this, and any existing arguments
7809 // if the function was already bound).
7852 Handle<JSFunction> function = Handle<JSFunction>::cast(callable);
7853 if (function->shared()->bound()) {
7854 Handle<FixedArray> bindings(function->function_bindings());
7866 // First argument is a function to use as a constructor.
7867 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
7868 RUNTIME_ASSERT(function->shared()->bound());
7870 // The argument is a bound function. Extract its bound arguments
7873 Handle<FixedArray>(FixedArray::cast(function->function_bindings()));
7909 Handle<JSFunction> function) {
7911 if (function->has_instance_prototype()) {
7912 prototype = Handle<Object>(function->instance_prototype(), isolate);
7914 if (function->shared()->CanGenerateInlineConstructor(*prototype)) {
7916 Handle<Code> code = compiler.CompileConstructStub(function);
7917 function->shared()->set_construct_stub(*code);
7928 // If the constructor isn't a proper function we throw a type error.
7936 Handle<JSFunction> function = Handle<JSFunction>::cast(constructor);
7938 // If function should not have prototype, construction is not allowed. In this
7939 // case generated code bailouts here, since function has no initial_map.
7940 if (!function->should_have_prototype() && !function->shared()->bound()) {
7951 debug->HandleStepIn(function, Handle<Object>::null(), 0, true);
7955 if (function->has_initial_map()) {
7956 if (function->initial_map()->instance_type() == JS_FUNCTION_TYPE) {
7957 // The 'Function' function ignores the receiver object when
7963 // the shared part of the function. Since the receiver is
7966 // reported the same way whether or not 'Function' is called
7972 // The function
7974 // compilation through the shared function info which makes it
7976 if (!function->is_compiled()) {
7977 JSFunction::CompileLazy(function, CLEAR_EXCEPTION);
7980 Handle<SharedFunctionInfo> shared(function->shared(), isolate);
7981 if (!function->has_initial_map() &&
7983 // The tracking is already in progress for another function. We can only
7985 // function is called as a constructor for the first time.
7990 Handle<JSObject> result = isolate->factory()->NewJSObject(function);
7994 TrySettingInlineConstructStub(isolate, function);
8008 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
8009 function->shared()->CompleteInobjectSlackTracking();
8010 TrySettingInlineConstructStub(isolate, function);
8020 Handle<JSFunction> function = args.at<JSFunction>(0);
8022 if (FLAG_trace_lazy && !function->shared()->is_compiled()) {
8024 function->PrintName();
8029 // Compile the target function.
8030 ASSERT(!function->is_compiled());
8031 if (!JSFunction::CompileLazy(function, KEEP_EXCEPTION)) {
8036 ASSERT(function->is_compiled());
8037 return function->code();
8044 Handle<JSFunction> function = args.at<JSFunction>(0);
8046 // If the function is not compiled ignore the lazy
8048 // the function is returned to the not compiled state.
8049 if (!function->shared()->is_compiled()) {
8050 function->ReplaceCode(function->shared()->code());
8051 return function->code();
8054 // If the function is not optimizable or debugger is active continue using the
8056 if (!function->shared()->code()->optimizable() ||
8060 function->PrintName();
8062 function->shared()->code()->optimizable() ? "T" : "F",
8065 function->ReplaceCode(function->shared()->code());
8066 return function->code();
8068 function->shared()->code()->set_profiler_ticks(0);
8069 if (JSFunction::CompileOptimized(function,
8072 return function->code();
8076 function->PrintName();
8079 function->ReplaceCode(function->shared()->code());
8080 return function->code();
8086 explicit ActivationsFinder(JSFunction* function)
8087 : function_(function), has_activations_(false) {}
8094 if (frame->is_optimized() && frame->function() == function_) {
8111 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate);
8119 Accessors::FunctionGetArguments(*function,
8150 RUNTIME_ASSERT(frame->function()->IsJSFunction());
8151 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate);
8155 RUNTIME_ASSERT(function->IsOptimized());
8164 // Find other optimized activations of the function.
8168 if (frame->is_optimized() && frame->function() == *function) {
8176 ActivationsFinder activations_finder(*function);
8184 function->PrintName();
8187 function->ReplaceCode(function->shared()->code());
8189 Deoptimizer::DeoptimizeFunction(*function);
8205 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
8206 if (!function->IsOptimized()) return isolate->heap()->undefined_value();
8208 Deoptimizer::DeoptimizeFunction(*function);
8226 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
8228 if (!function->IsOptimizable()) return isolate->heap()->undefined_value();
8229 function->MarkForLazyRecompilation();
8231 Code* unoptimized = function->shared()->code();
8233 unoptimized->kind() == Code::FUNCTION) {
8236 isolate->runtime_profiler()->AttemptOnStackReplacement(*function);
8249 // function is currently optimized, regardless of reason.
8256 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
8257 return function->IsOptimized() ? Smi::FromInt(1) // 1 == "yes".
8265 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
8266 return Smi::FromInt(function->shared()->opt_count());
8273 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
8275 // We're not prepared to handle a function with arguments object.
8276 ASSERT(!function->shared()->uses_arguments());
8278 // We have hit a back edge in an unoptimized frame for a function that was
8280 Handle<Code> unoptimized(function->shared()->code(), isolate);
8285 // activations of the function, it means (a) the function is directly or
8288 // Check for optimized activations of this function.
8292 succeeded = !frame->is_optimized() || frame->function() != *function;
8299 // The top JS function is this one, the PC is somewhere in the
8303 ASSERT(frame->function() == *function);
8326 function->PrintName();
8333 if (JSFunction::CompileOptimized(function, ast_id, CLEAR_EXCEPTION) &&
8334 function->IsOptimized()) {
8336 function->code()->deoptimization_data());
8356 function->PrintName();
8384 ASSERT(function->code()->kind() == Code::OPTIMIZED_FUNCTION);
8387 if (function->IsMarkedForLazyRecompilation()) {
8388 function->ReplaceCode(function->shared()->code());
8498 CONVERT_ARG_CHECKED(JSFunction, function, 0);
8499 int length = function->shared()->scope_info()->ContextLength();
8502 isolate->heap()->AllocateFunctionContext(length, function);
8535 JSFunction* function;
8538 // than some function. There is a canonical empty function that can be
8540 function = isolate->context()->global_context()->closure();
8542 function = JSFunction::cast(args[1]);
8547 isolate->heap()->AllocateWithContext(function,
8561 JSFunction* function;
8564 // than some function. There is a canonical empty function that can be
8566 function = isolate->context()->global_context()->closure();
8568 function = JSFunction::cast(args[2]);
8572 isolate->heap()->AllocateCatchContext(function,
8586 JSFunction* function;
8589 // than some function. There is a canonical empty function that can be
8591 function = isolate->context()->global_context()->closure();
8593 function = JSFunction::cast(args[1]);
8597 isolate->heap()->AllocateBlockContext(function,
8683 // Get the context extension function.
8769 // GetProperty function.
8958 // function result
9187 // and return the compiled function bound in the local context.
9229 // This utility adjusts the property attributes for newly created Function
9230 // object ("new Function(...)") by changing the map.
9636 * A helper function that visits elements of a JSArray in numerical
10008 // Adds a JavaScript function as a debug event listener.
10009 // args[0]: debug event listener function to set or null or undefined for
10010 // clearing the event listener function
10098 // 3: Getter function if defined
10099 // 4: Setter function if defined
10347 : frame_->function();
10421 // 2: Function
10482 Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction()));
10483 Handle<SharedFunctionInfo> shared(function->shared());
10556 // the provided parameters whereas the function frame always have the number
10565 // parameters for the function and fill more if more parameters are provided.
10580 // Add the function (same as in function frame).
10638 // Add locals name and value from the temporary copy from the function frame.
10648 // Add the receiver (same as in function frame).
10655 // If the receiver is not a JSObject and the function is not a
10707 Handle<JSFunction> function(JSFunction::cast(frame_inspector->GetFunction()));
10708 Handle<SharedFunctionInfo> shared(function->shared());
10712 // heap locals and extension properties of the debugged function.
10753 // Finally copy any properties from the function context extension.
10755 if (function_context->closure() == *function) {
10805 // Allocate and initialize a JSObject with all the content of this function
10816 // Finally copy any properties from the function context extension. This will
10870 // heap locals and extension properties of the debugged function.
10929 function_(JSFunction::cast(frame->function())),
10933 // Catch the case when the debugger stops in an internal function.
10958 // provide the function scope.
10973 // Check whether we are in global, eval or function code.
10986 scope = info.function()->scope();
10989 // Function code
10992 scope = info.function()->scope();
11411 // Set a break point in a function
11412 // args[0]: function
11413 // args[1]: number: break source position (within the function source)
11441 // compiled function and the actual requested break point might be in one of
11465 // If there is no candidate or this function is within the current
11473 // If a top-level function contain only one function
11475 // function is the same. In that case prefer the non
11476 // top-level function.
11483 // This containment check includes equality as a function
11484 // inside a top-level function can share either start or end
11485 // position with the top-level function.
11537 // Find position within function. The script position might be before the
11538 // source position of the first function.
11577 // function will default to affecting caught exceptions.
11654 // is linked to the function context supplied.
11656 Handle<JSFunction> function,
11685 isolate->factory()->NewCatchContext(function,
11696 // Allocate a new function context for the debug evaluation and set the
11700 function);
11709 isolate->factory()->NewWithContext(function, context, extension);
11717 // Helper function to find or create the arguments object for
11725 // found (that is the debugged function does not reference 'arguments' and
11745 Handle<JSFunction> function(JSFunction::cast(frame_inspector->GetFunction()));
11748 isolate->factory()->NewArgumentsObject(function, length);
11762 "(function(arguments,__source__){return eval(__source__);})";
11767 // extension part has all the parameters and locals of the function on the
11768 // stack frame. A function which calls eval with the code to evaluate is then
11770 // replaces the context of the function on the stack frame a new (empty)
11771 // function is created as well to be used as the closure for the context.
11772 // This function and the context acts as replacements for the function on the
11775 // where the function on the stack frame is currently stopped.
11803 Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction()));
11804 Handle<ScopeInfo> scope_info(function->shared()->scope_info());
11813 // Create the (empty) function replacing the function on the stack frame for
11815 // that this function does not describe any parameters and local variables
11822 go_between->set_context(function->context());
11843 // Get the function's context if it has one.
11859 // Wrap the evaluation statement in a new function compiled in the newly
11860 // created context. The function has one parameter which has to be called
11862 // the function being debugged.
11863 // function(arguments,__source__) {return eval(__source__);}
11881 // Invoke the result of the compilation to get the evaluation function.
11895 // Invoke the evaluation function and return the result.
11953 // the context of the debugged function and the eval code to be executed.
11976 // Invoke the result of the compilation to get the evaluation function.
12016 // Helper function used by Runtime_DebugReferencedBy below.
12088 // args[1]: constructor function for instances to exclude (Mirror)
12110 // Get the constructor function for context extension and arguments array.
12147 // Helper function used by Runtime_DebugConstructedBy below.
12179 // Scan the heap for objects constructed by a specific function.
12271 // Get the function and make sure it is compiled.
12287 // Get the function and make sure it is compiled.
12381 // each function with all its descendant is always stored in a continues range
12382 // with the function itself going first. The root function is a script function.
12461 // and we check it in this function.
12468 // In a code of a parent function replaces original function as embedded object
12485 // Updates positions of a shared function info (first parameter) according
12531 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
12534 Handle<Code> code(function->code(), isolate);
12536 if (code->kind() != Code::FUNCTION &&
12562 // Calls specified function with or without entering the debugger.
12568 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
12575 result = Execution::Call(function, isolate->global(), 0, NULL,
12579 result = Execution::Call(function, isolate->global(), 0, NULL,
12836 // heap traversal to find the function generated for the source position
12889 // call to this function is encountered it is skipped. The seen_caller
12900 Object* raw_fun = frame->function();
12913 // an internal function.
12928 // element segments each containing a receiver, function, code and
12945 // If the caller parameter is a function we skip frames until we're
12956 // function.
12972 Handle<JSFunction> fun = frames[i].function();
13048 // There is no value in the cache. Invoke the function and cache result.
13076 // Function invocation may have cleared the cache. Reread all the data.
13258 static const Runtime::Function kIntrinsicFunctions[] = {
13292 const Runtime::Function* Runtime::FunctionForSymbol(Handle<String> name) {
13304 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {