Lines Matching refs:function
177 Handle<JSBoundFunction> function) { in GetFunctionRealm() argument
178 DCHECK(function->map().is_constructor()); in GetFunctionRealm()
180 handle(function->bound_target_function(), function->GetIsolate())); in GetFunctionRealm()
185 Handle<JSBoundFunction> function) { in GetName() argument
190 while (function->bound_target_function().IsJSBoundFunction()) { in GetName()
194 function = handle(JSBoundFunction::cast(function->bound_target_function()), in GetName()
197 if (function->bound_target_function().IsJSFunction()) { in GetName()
199 JSFunction::cast(function->bound_target_function()), isolate); in GetName()
210 Handle<JSBoundFunction> function) { in GetLength() argument
211 int nof_bound_arguments = function->bound_arguments().length(); in GetLength()
212 while (function->bound_target_function().IsJSBoundFunction()) { in GetLength()
213 function = handle(JSBoundFunction::cast(function->bound_target_function()), in GetLength()
218 int length = function->bound_arguments().length(); in GetLength()
227 Handle<JSFunction> target(JSFunction::cast(function->bound_target_function()), in GetLength()
236 Handle<String> JSBoundFunction::ToString(Handle<JSBoundFunction> function) { in ToString() argument
237 Isolate* const isolate = function->GetIsolate(); in ToString()
243 Handle<JSFunction> function) { in GetName() argument
244 if (function->shared().name_should_print_as_anonymous()) { in GetName()
247 return handle(function->shared().Name(), isolate); in GetName()
252 Handle<JSFunction> function) { in GetFunctionRealm() argument
253 DCHECK(function->map().is_constructor()); in GetFunctionRealm()
254 return handle(function->context().native_context(), function->GetIsolate()); in GetFunctionRealm()
258 void JSFunction::EnsureClosureFeedbackCellArray(Handle<JSFunction> function) { in EnsureClosureFeedbackCellArray() argument
259 Isolate* const isolate = function->GetIsolate(); in EnsureClosureFeedbackCellArray()
260 DCHECK(function->shared().is_compiled()); in EnsureClosureFeedbackCellArray()
261 DCHECK(function->shared().HasFeedbackMetadata()); in EnsureClosureFeedbackCellArray()
262 if (function->has_closure_feedback_cell_array() || in EnsureClosureFeedbackCellArray()
263 function->has_feedback_vector()) { in EnsureClosureFeedbackCellArray()
266 if (function->shared().HasAsmWasmData()) return; in EnsureClosureFeedbackCellArray()
268 Handle<SharedFunctionInfo> shared(function->shared(), isolate); in EnsureClosureFeedbackCellArray()
269 DCHECK(function->shared().HasBytecodeArray()); in EnsureClosureFeedbackCellArray()
278 if (function->raw_feedback_cell() == isolate->heap()->many_closures_cell()) { in EnsureClosureFeedbackCellArray()
281 function->set_raw_feedback_cell(*feedback_cell); in EnsureClosureFeedbackCellArray()
283 function->raw_feedback_cell().set_value(*feedback_cell_array); in EnsureClosureFeedbackCellArray()
288 void JSFunction::EnsureFeedbackVector(Handle<JSFunction> function, in EnsureFeedbackVector() argument
290 Isolate* const isolate = function->GetIsolate(); in EnsureFeedbackVector()
292 DCHECK(function->shared().HasFeedbackMetadata()); in EnsureFeedbackVector()
293 if (function->has_feedback_vector()) return; in EnsureFeedbackVector()
294 if (function->shared().HasAsmWasmData()) return; in EnsureFeedbackVector()
296 Handle<SharedFunctionInfo> shared(function->shared(), isolate); in EnsureFeedbackVector()
297 DCHECK(function->shared().HasBytecodeArray()); in EnsureFeedbackVector()
299 EnsureClosureFeedbackCellArray(function); in EnsureFeedbackVector()
301 handle(function->closure_feedback_cell_array(), isolate); in EnsureFeedbackVector()
307 DCHECK(function->raw_feedback_cell() != in EnsureFeedbackVector()
309 function->raw_feedback_cell().set_value(*feedback_vector); in EnsureFeedbackVector()
310 function->raw_feedback_cell().SetInterruptBudget(); in EnsureFeedbackVector()
314 void JSFunction::InitializeFeedbackCell(Handle<JSFunction> function, in InitializeFeedbackCell() argument
316 Isolate* const isolate = function->GetIsolate(); in InitializeFeedbackCell()
318 if (function->has_feedback_vector()) { in InitializeFeedbackCell()
319 CHECK_EQ(function->feedback_vector().length(), in InitializeFeedbackCell()
320 function->feedback_vector().metadata().slot_count()); in InitializeFeedbackCell()
326 function->shared().may_have_cached_code() || in InitializeFeedbackCell()
333 EnsureFeedbackVector(function, is_compiled_scope); in InitializeFeedbackCell()
335 EnsureClosureFeedbackCellArray(function); in InitializeFeedbackCell()
341 void SetInstancePrototype(Isolate* isolate, Handle<JSFunction> function, in SetInstancePrototype() argument
345 if (function->has_initial_map()) { in SetInstancePrototype()
350 function->CompleteInobjectSlackTrackingIfActive(); in SetInstancePrototype()
352 Handle<Map> initial_map(function->initial_map(), isolate); in SetInstancePrototype()
359 function->set_prototype_or_initial_map(*value); in SetInstancePrototype()
363 JSFunction::SetInitialMap(function, new_map, value); in SetInstancePrototype()
367 Handle<Context> native_context(function->context().native_context(), in SetInstancePrototype()
372 *function == JSFunction::cast(*array_function)) { in SetInstancePrototype()
384 function->set_prototype_or_initial_map(*value); in SetInstancePrototype()
394 void JSFunction::SetPrototype(Handle<JSFunction> function, in SetPrototype() argument
396 DCHECK(function->IsConstructor() || in SetPrototype()
397 IsGeneratorFunction(function->shared().kind())); in SetPrototype()
398 Isolate* isolate = function->GetIsolate(); in SetPrototype()
410 Map::Copy(isolate, handle(function->map(), isolate), "SetPrototype"); in SetPrototype()
412 JSObject::MigrateToMap(isolate, function, new_map); in SetPrototype()
416 FunctionKind kind = function->shared().kind(); in SetPrototype()
417 Handle<Context> native_context(function->context().native_context(), in SetPrototype()
429 function->map().set_has_non_instance_prototype(false); in SetPrototype()
432 SetInstancePrototype(isolate, function, construct_prototype); in SetPrototype()
435 void JSFunction::SetInitialMap(Handle<JSFunction> function, Handle<Map> map, in SetInitialMap() argument
438 Map::SetPrototype(function->GetIsolate(), map, prototype); in SetInitialMap()
440 function->set_prototype_or_initial_map(*map); in SetInitialMap()
441 map->SetConstructor(*function); in SetInitialMap()
443 LOG(function->GetIsolate(), MapEvent("InitialMap", Handle<Map>(), map, "", in SetInitialMap()
444 handle(function->shared().DebugName(), in SetInitialMap()
445 function->GetIsolate()))); in SetInitialMap()
449 void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { in EnsureHasInitialMap() argument
450 DCHECK(function->has_prototype_slot()); in EnsureHasInitialMap()
451 DCHECK(function->IsConstructor() || in EnsureHasInitialMap()
452 IsResumableFunction(function->shared().kind())); in EnsureHasInitialMap()
453 if (function->has_initial_map()) return; in EnsureHasInitialMap()
454 Isolate* isolate = function->GetIsolate(); in EnsureHasInitialMap()
457 CalculateExpectedNofProperties(isolate, function); in EnsureHasInitialMap()
462 if (function->has_initial_map()) return; in EnsureHasInitialMap()
467 if (IsResumableFunction(function->shared().kind())) { in EnsureHasInitialMap()
468 instance_type = IsAsyncGeneratorFunction(function->shared().kind()) in EnsureHasInitialMap()
486 if (function->has_instance_prototype()) { in EnsureHasInitialMap()
487 prototype = handle(function->instance_prototype(), isolate); in EnsureHasInitialMap()
489 prototype = isolate->factory()->NewFunctionPrototype(function); in EnsureHasInitialMap()
495 JSFunction::SetInitialMap(function, map, prototype); in EnsureHasInitialMap()
671 Handle<JSFunction> function = Handle<JSFunction>::cast(new_target); in GetDerivedMap() local
672 if (FastInitializeDerivedMap(isolate, function, constructor, in GetDerivedMap()
674 return handle(function->initial_map(), isolate); in GetDerivedMap()
683 Handle<JSFunction> function = Handle<JSFunction>::cast(new_target); in GetDerivedMap() local
684 if (function->has_prototype_slot()) { in GetDerivedMap()
686 EnsureHasInitialMap(function); in GetDerivedMap()
687 prototype = handle(function->prototype(), isolate); in GetDerivedMap()
744 Handle<String> JSFunction::GetName(Handle<JSFunction> function) { in GetName() argument
745 Isolate* isolate = function->GetIsolate(); in GetName()
747 JSReceiver::GetDataProperty(function, isolate->factory()->name_string()); in GetName()
749 return handle(function->shared().DebugName(), isolate); in GetName()
752 Handle<String> JSFunction::GetDebugName(Handle<JSFunction> function) { in GetDebugName() argument
753 Isolate* isolate = function->GetIsolate(); in GetDebugName()
755 function, isolate->factory()->display_name_string()); in GetDebugName()
757 return JSFunction::GetName(function); in GetDebugName()
760 bool JSFunction::SetName(Handle<JSFunction> function, Handle<Name> name, in SetName() argument
762 Isolate* isolate = function->GetIsolate(); in SetName()
777 function, isolate->factory()->name_string(), function_name, in SetName()
798 Handle<String> JSFunction::ToString(Handle<JSFunction> function) { in ToString() argument
799 Isolate* const isolate = function->GetIsolate(); in ToString()
800 Handle<SharedFunctionInfo> shared_info(function->shared(), isolate); in ToString()
809 function, isolate->factory()->class_positions_symbol()); in ToString()
857 Handle<JSFunction> function) { in CalculateExpectedNofProperties() argument
859 for (PrototypeIterator iter(isolate, function, kStartAtReceiver); in CalculateExpectedNofProperties()