Lines Matching defs:isolate
9 #include "src/execution/isolate.h"
179 void JSFunction::MarkForOptimization(Isolate* isolate, CodeKind target_kind,
181 if (!isolate->concurrent_recompilation_enabled() ||
182 isolate->bootstrapper()->IsActive()) {
214 void JSFunction::SetInterruptBudget(Isolate* isolate) {
216 TieringManager::InterruptBudgetFor(isolate, *this));
221 Isolate* isolate,
230 isolate->factory()->function_length_accessor();
231 LookupIterator length_lookup(isolate, target,
232 isolate->factory()->length_string(), target,
237 Handle<Object> length(Smi::zero(), isolate);
243 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, target_length,
247 length = isolate->factory()->NewNumber(std::max(
251 LookupIterator it(isolate, function, isolate->factory()->length_string(),
254 RETURN_ON_EXCEPTION_VALUE(isolate,
266 isolate->factory()->function_name_accessor();
267 LookupIterator name_lookup(isolate, target, isolate->factory()->name_string(),
274 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, target_name,
280 isolate, name,
281 Name::ToFunctionName(isolate, Handle<String>::cast(target_name)),
285 isolate, name, isolate->factory()->NewConsString(prefix, name),
289 name = isolate->factory()->empty_string();
293 LookupIterator it(isolate, function, isolate->factory()->name_string());
295 RETURN_ON_EXCEPTION_VALUE(isolate,
305 MaybeHandle<String> JSBoundFunction::GetName(Isolate* isolate,
307 Handle<String> prefix = isolate->factory()->bound__string();
309 Factory* factory = isolate->factory();
312 ASSIGN_RETURN_ON_EXCEPTION(isolate, target_name,
316 isolate);
320 JSWrappedFunction::cast(function->bound_target_function()), isolate);
323 isolate, name, JSWrappedFunction::GetName(isolate, target), String);
328 JSFunction::cast(function->bound_target_function()), isolate);
329 Handle<String> name = JSFunction::GetName(isolate, target);
337 Maybe<int> JSBoundFunction::GetLength(Isolate* isolate,
342 isolate);
355 JSWrappedFunction::cast(function->bound_target_function()), isolate);
358 isolate, target_length, JSWrappedFunction::GetLength(isolate, target),
366 isolate);
375 Isolate* const isolate = function->GetIsolate();
376 return isolate->factory()->function_native_code_string();
381 Isolate* isolate, Handle<JSWrappedFunction> function) {
382 STACK_CHECK(isolate, MaybeHandle<String>());
383 Factory* factory = isolate->factory();
386 handle(function->wrapped_target_function(), isolate);
389 isolate,
391 isolate));
394 isolate,
395 handle(JSFunction::cast(function->wrapped_target_function()), isolate));
402 Maybe<int> JSWrappedFunction::GetLength(Isolate* isolate,
404 STACK_CHECK(isolate, Nothing<int>());
406 handle(function->wrapped_target_function(), isolate);
409 isolate,
411 isolate));
420 Isolate* const isolate = function->GetIsolate();
421 return isolate->factory()->function_native_code_string();
426 Isolate* isolate, Handle<NativeContext> creation_context,
437 Handle<JSReceiver>(target_wrapped->wrapped_target_function(), isolate);
449 isolate->factory()->NewJSWrappedFunction(creation_context, value);
454 isolate, wrapped, value, Handle<String>(), 0);
458 DCHECK(isolate->has_pending_exception());
459 isolate->clear_pending_exception();
467 isolate,
469 isolate),
480 Handle<String> JSFunction::GetName(Isolate* isolate,
483 return isolate->factory()->anonymous_string();
485 return handle(function->shared().Name(), isolate);
491 Isolate* const isolate = function->GetIsolate();
498 Handle<SharedFunctionInfo> shared(function->shared(), isolate);
511 function->SetInterruptBudget(isolate);
519 ClosureFeedbackCellArray::New(isolate, shared);
526 if (function->raw_feedback_cell() == isolate->heap()->many_closures_cell()) {
528 isolate->factory()->NewOneClosureCell(feedback_cell_array);
530 function->SetInterruptBudget(isolate);
538 void JSFunction::EnsureFeedbackVector(Isolate* isolate,
548 CreateAndAttachFeedbackVector(isolate, function, compiled_scope);
553 Isolate* isolate, Handle<JSFunction> function,
562 Handle<SharedFunctionInfo> shared(function->shared(), isolate);
567 handle(function->closure_feedback_cell_array(), isolate);
569 isolate, shared, closure_feedback_cell_array, compiled_scope);
574 isolate->heap()->many_closures_cell());
576 function->SetInterruptBudget(isolate);
583 Isolate* const isolate = function->GetIsolate();
609 FLAG_log_function_events || !isolate->is_best_effort_code_coverage() ||
610 isolate->is_collecting_type_profile();
613 CreateAndAttachFeedbackVector(isolate, function, is_compiled_scope);
622 void SetInstancePrototype(Isolate* isolate, Handle<JSFunction> function,
633 Handle<Map> initial_map(function->initial_map(), isolate);
635 if (!isolate->bootstrapper()->IsActive() &&
643 Map::Copy(isolate, initial_map, "SetInstancePrototype");
644 JSFunction::SetInitialMap(isolate, function, new_map, value);
645 DCHECK_IMPLIES(!isolate->bootstrapper()->IsActive(),
651 isolate, DependentCode::kInitialMapChangedGroup);
670 Isolate* isolate = function->GetIsolate();
682 Map::Copy(isolate, handle(function->map(), isolate), "SetPrototype");
686 JSObject::MigrateToMap(isolate, function, new_map);
689 Handle<Context> native_context(function->native_context(), isolate);
697 isolate);
703 SetInstancePrototype(isolate, function, construct_prototype);
706 void JSFunction::SetInitialMap(Isolate* isolate, Handle<JSFunction> function,
708 SetInitialMap(isolate, function, map, prototype, function);
711 void JSFunction::SetInitialMap(Isolate* isolate, Handle<JSFunction> function,
715 Map::SetPrototype(isolate, map, prototype);
720 LOG(isolate, MapEvent("InitialMap", Handle<Map>(), map, "",
722 handle(function->shared(), isolate))));
731 Isolate* isolate = function->GetIsolate();
734 CalculateExpectedNofProperties(isolate, function);
757 Handle<Map> map = isolate->factory()->NewMap(instance_type, instance_size,
764 prototype = handle(function->instance_prototype(), isolate);
766 prototype = isolate->factory()->NewFunctionPrototype(function);
772 JSFunction::SetInitialMap(isolate, function, map, prototype);
910 bool FastInitializeDerivedMap(Isolate* isolate, Handle<JSFunction> new_target,
943 JSFunction::CalculateExpectedNofProperties(isolate, new_target));
954 Map::CopyInitialMap(isolate, constructor_initial_map, instance_size,
957 Handle<HeapObject> prototype(new_target->instance_prototype(), isolate);
958 JSFunction::SetInitialMap(isolate, new_target, map, prototype, constructor);
968 MaybeHandle<Map> JSFunction::GetDerivedMap(Isolate* isolate,
973 Handle<Map> constructor_initial_map(constructor->initial_map(), isolate);
982 if (FastInitializeDerivedMap(isolate, function, constructor,
984 return handle(function->initial_map(), isolate);
997 prototype = handle(function->prototype(), isolate);
1000 prototype = isolate->factory()->undefined_value();
1003 Handle<String> prototype_string = isolate->factory()->prototype_string();
1005 isolate, prototype,
1006 JSReceiver::GetProperty(isolate, new_target, prototype_string), Map);
1010 constructor_initial_map = handle(constructor->initial_map(), isolate);
1019 ASSIGN_RETURN_ON_EXCEPTION(isolate, context,
1023 isolate, constructor,
1024 isolate->factory()->native_context_index_symbol());
1028 isolate);
1029 prototype = handle(realm_constructor->prototype(), isolate);
1032 Handle<Map> map = Map::CopyInitialMap(isolate, constructor_initial_map);
1036 Map::SetPrototype(isolate, map, Handle<HeapObject>::cast(prototype));
1070 Handle<Map> JSFunction::GetDerivedRabGsabMap(Isolate* isolate,
1074 GetDerivedMap(isolate, constructor, new_target).ToHandleChecked();
1077 NativeContext context = isolate->context().native_context();
1083 return handle(Map::cast(context.get(ctor_index)), isolate);
1090 Handle<Map> rab_gsab_map = Map::Copy(isolate, map, "RAB / GSAB");
1096 int JSFunction::ComputeInstanceSizeWithMinSlack(Isolate* isolate) {
1099 int slack = initial_map().ComputeMinObjectSlack(isolate);
1115 bool UseFastFunctionNameLookup(Isolate* isolate, Map map) {
1123 ReadOnlyRoots roots(isolate);
1124 auto descriptors = map.instance_descriptors(isolate);
1128 .GetHeapObjectIfStrong(isolate, &value)) {
1143 Isolate* isolate = function->GetIsolate();
1144 if (!UseFastFunctionNameLookup(isolate, function->map())) {
1153 GetDataProperty(isolate, function, isolate->factory()->name_string());
1156 return SharedFunctionInfo::DebugName(handle(function->shared(), isolate));
1161 Isolate* isolate = function->GetIsolate();
1163 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, function_name,
1164 Name::ToFunctionName(isolate, name), false);
1166 IncrementalStringBuilder builder(isolate);
1170 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, function_name, builder.Finish(),
1174 isolate,
1176 function, isolate->factory()->name_string(), function_name,
1186 Isolate* const isolate = shared_info->GetIsolate();
1187 IncrementalStringBuilder builder(isolate);
1189 builder.AppendString(handle(shared_info->Name(), isolate));
1198 Isolate* const isolate = function->GetIsolate();
1199 Handle<SharedFunctionInfo> shared_info(function->shared(), isolate);
1208 isolate, function, isolate->factory()->class_positions_symbol());
1215 String::cast(Script::cast(shared_info->script()).source()), isolate);
1216 return isolate->factory()->NewSubString(script_source, start_position,
1230 shared_info->wasm_exported_function_data(), isolate);
1237 String::cast(Script::cast(shared_info->script()).source()), isolate);
1238 return isolate->factory()->NewSubString(source, offsets.first,
1248 isolate->CountUsage(
1257 int JSFunction::CalculateExpectedNofProperties(Isolate* isolate,
1260 for (PrototypeIterator iter(isolate, function, kStartAtReceiver);
1268 Handle<SharedFunctionInfo> shared(func->shared(), isolate);
1269 IsCompiledScope is_compiled_scope(shared->is_compiled_scope(isolate));
1271 Compiler::Compile(isolate, func, Compiler::CLEAR_EXCEPTION,
1333 Isolate* isolate = GetIsolate();
1334 if (vector.ClearSlots(isolate)) {
1335 IC::OnFeedbackChanged(isolate, vector, FeedbackSlot::Invalid(),