24#if V8_ENABLE_WEBASSEMBLY
39 v8_context->set_debug_context_id(i::Smi::FromInt(
id));
46 return (IsSmi(value)) ? i::Smi::ToInt(value) : 0;
52 if (inspector ==
nullptr) {
53 i_isolate->set_inspector(
nullptr);
55 i_isolate->set_inspector(inspector);
62 return i_isolate->inspector();
71 int radix = (i_bigint->Words64Count() > 100 * 1000) ? 16 : 10;
73 i::BigInt::ToString(i_isolate, i_bigint, radix,
i::kDontThrow)
76 if (i_bigint->IsNegative()) {
82 string_value, 1, string_value->length() - 1))
104 GetBigIntStringPresentationHandle(i_isolate, i_bigint);
105 return Utils::ToLocal(string_value);
114 GetBigIntStringPresentationHandle(i_isolate, i_bigint);
120 return Utils::ToLocal(description);
129 i::ToDateStringMode::kLocalDateAndTime);
130 return Utils::ToLocal(i_isolate->
factory()
137 auto i_isolate =
receiver->GetIsolate();
140 return Utils::ToLocal(
145#if V8_ENABLE_WEBASSEMBLY
146 if (js_function->shared()->HasWasmExportedFunctionData()) {
148 js_function->shared()->wasm_exported_function_data(), i_isolate);
149 int func_index = function_data->function_index();
151 function_data->instance_data(), i_isolate);
152 if (instance_data->module()->origin == i::wasm::kWasmOrigin) {
161 return Utils::ToLocal(builder.
Finish().ToHandleChecked());
165 return Utils::ToLocal(i::JSFunction::ToString(js_function));
167 return Utils::ToLocal(
168 receiver->GetIsolate()->factory()->function_native_code_string());
189 if (!i::Runtime::GetInternalProperties(isolate, val).ToHandle(&
result))
191 return Utils::ToLocal(
result);
198using ContextLocalIterator = std::function<void(
203 const VariableModeFilter& var_mode_filter,
204 const FlagFilter& flag_filter,
205 const ContextLocalIterator& context_local_it) {
208 for (
auto it : i::ScopeInfo::IterateLocalNames(scope_info)) {
211 if (!var_mode_filter(mode)) {
214 i::IsStaticFlag flag = scope_info->ContextLocalIsStaticFlag(it->index());
215 if (!flag_filter(flag)) {
218 int context_index = scope_info->ContextHeaderLength() + it->index();
220 context_local_it(mode, name, slot_value);
233 bool include_methods =
235 bool include_fields =
237 bool include_accessors =
239 bool include_methods_or_accessors = include_methods || include_accessors;
241 auto var_mode_filter =
247 return flag == i::IsStaticFlag::kNotStatic;
250 return flag == i::IsStaticFlag::kStatic;
260 i::KeyAccumulator::GetKeys(isolate,
receiver,
261 i::KeyCollectionMode::kOwnOnly, key_filter,
262 i::GetKeysConversion::kConvertToString),
266 int private_entries_count = 0;
267 auto count_private_entry =
270 for (
int i = 0;
i < keys->
length(); ++
i) {
273 if (
key->is_private_brand()) {
274 if (include_methods_or_accessors) {
277 isolate, value, i::Object::GetProperty(isolate,
receiver,
key),
282 ForEachContextLocal(isolate, value_context, var_mode_filter,
283 instance_filter, count_private_entry);
285 }
else if (include_fields) {
286 private_entries_count++;
291 bool has_static_private_methods_or_accessors =
false;
292 if (include_methods_or_accessors) {
297 if (shared->is_class_constructor() &&
298 shared->has_static_private_methods_or_accessors()) {
299 has_static_private_methods_or_accessors =
true;
301 ForEachContextLocal(isolate, func_context, var_mode_filter,
302 static_filter, count_private_entry);
308 names_out->
reserve(private_entries_count);
310 values_out->
reserve(private_entries_count);
316 IsJSFunction(*value));
318 IsAccessorPair(*value));
319 names_out->
push_back(Utils::ToLocal(name));
320 values_out->
push_back(Utils::ToLocal(value));
322 if (has_static_private_methods_or_accessors) {
325 ForEachContextLocal(isolate, receiver_context, var_mode_filter,
326 static_filter, add_private_entry);
329 for (
int i = 0;
i < keys->
length(); ++
i) {
335 isolate, value, i::Object::GetProperty(isolate,
receiver,
key),
false);
336 if (
key->is_private_brand()) {
337 if (include_methods_or_accessors) {
338 DCHECK(IsContext(*value));
341 ForEachContextLocal(isolate, value_context, var_mode_filter,
342 instance_filter, add_private_entry);
344 }
else if (include_fields) {
347 names_out->
push_back(Utils::ToLocal(name));
348 values_out->
push_back(Utils::ToLocal(value));
362 return value->GetCreationContext();
380 isolate->debug()->set_break_points_active(is_active);
386 CHECK(isolate->debug()->CheckExecutionState());
388 isolate->debug()->ClearStepping();
390 isolate->debug()->PrepareStep(
static_cast<i::StepAction>(action));
396 CHECK(isolate->debug()->CheckExecutionState());
399 if (it.Done() || !it.CanBeRestarted())
return false;
402 isolate->debug()->ClearStepping();
411 isolate->debug()->ClearStepping();
425 isolate->debug()->SetTerminateOnResume();
431 return !isolate->debug()->AllFramesOnStackAreBlackboxed();
436 if (IsString(*source)) {
443#if V8_ENABLE_WEBASSEMBLY
445 if (WasmBytecode().To(&wasm_bytecode)) {
446 return wasm_bytecode.
size();
450 if (!IsString(*source))
return 0;
452 return string->length() * (
string->IsTwoByteRepresentation() ? 2 : 1);
461#if V8_ENABLE_WEBASSEMBLY
472 return reinterpret_cast<Isolate*
>(
482 i::Script::CompilationState::kCompiled;
502#if V8_ENABLE_WEBASSEMBLY
503 if (script->type() == i::Script::Type::kWasm)
return 0;
505 if (!IsString(script->source())) {
506 return script->line_offset();
510 i::Script::PositionInfo
info;
511 i::Script::GetPositionInfo(
518#if V8_ENABLE_WEBASSEMBLY
519 if (script->type() == i::Script::Type::kWasm) {
520 return script->wasm_native_module()->wire_bytes().length();
523 if (!IsString(script->source())) {
524 return script->column_offset();
528 i::Script::PositionInfo
info;
529 i::Script::GetPositionInfo(
562 i::Script::GetScriptHash(isolate, script,
true);
563 return Utils::ToLocal(value);
569 if (IsSmi(value))
return Just(i::Smi::ToInt(value));
576#if V8_ENABLE_WEBASSEMBLY
577 if (script->type() == i::Script::Type::kWasm) {
579 script->wasm_managed_native_module(), isolate);
587#if V8_ENABLE_WEBASSEMBLY
588bool Script::IsWasm()
const {
600 return i::Smi::ToInt(array->get(index));
612 std::vector<BreakLocation>* locations)
const {
615#if V8_ENABLE_WEBASSEMBLY
616 if (script->type() == i::Script::Type::kWasm) {
617 i::wasm::NativeModule* native_module = script->wasm_native_module();
618 return i::WasmScript::GetPossibleBreakpoints(native_module,
start,
end,
625 int start_offset, end_offset;
630 end_offset = std::numeric_limits<int>::max();
635 if (start_offset >= end_offset)
return true;
637 std::vector<i::BreakLocation> v8_locations;
638 if (!isolate->debug()->GetPossibleBreakpoints(
639 script, start_offset, end_offset, restrict_to_function,
644 std::sort(v8_locations.begin(), v8_locations.end(), CompareBreakLocation);
645 for (
const auto& v8_location : v8_locations) {
656#if V8_ENABLE_WEBASSEMBLY
657 if (script->type() == i::Script::Type::kWasm) {
665 if (!script->HasSourceURLComment()) {
670 line -= script->line_offset();
671 if (line == 0) column -= script->column_offset();
674 i::Script::InitLineEnds(script->GetIsolate(), script);
683 if (line >= line_ends->length()) {
685 return Just(GetSmiValue(line_ends, line_ends->length() - 1));
697 int prev_line_end_offset = GetSmiValue(line_ends, line - 1);
698 offset += prev_line_end_offset + 1;
700 int line_end_offset = GetSmiValue(line_ends, line);
701 if (
offset > line_end_offset) {
706 return Just(line_end_offset);
715 i::Script::PositionInfo
info;
716 i::Script::GetPositionInfo(script,
offset, &info);
717 if (script->HasSourceURLComment()) {
722 info.line -= script->line_offset();
723 if (info.line == 0) info.column -= script->column_offset();
725 return Location(info.line, info.column);
729 bool allow_top_frame_live_editing,
735 allow_top_frame_live_editing,
result);
746 if (!isolate->debug()->SetBreakPointForScript(
757#if V8_ENABLE_WEBASSEMBLY
758 if (script->type() == i::Script::Type::kWasm) {
759 isolate->debug()->SetInstrumentationBreakpointForWasmScript(script,
id);
763 i::SharedFunctionInfo::ScriptIterator it(isolate, *script);
766 if (sfi->is_toplevel()) {
767 return isolate->debug()->SetBreakpointForFunction(
768 handle(sfi, isolate), isolate->factory()->empty_string(),
id,
775#if V8_ENABLE_WEBASSEMBLY
779 isolate->
debug()->RemoveBreakpointForWasmScript(script,
id);
786 isolate->debug()->RemoveBreakpoint(
id);
794 i::EmbedderStackStateOrigin::kImplicitThroughTask, embedder_stack_state);
795 isolate->LowMemoryNotification();
798#if V8_ENABLE_WEBASSEMBLY
799WasmScript* WasmScript::Cast(
Script* script) {
800 CHECK(script->IsWasm());
801 return static_cast<WasmScript*
>(script);
804Maybe<WasmScript::DebugSymbols::Type> GetDebugSymbolType(
805 i::wasm::WasmDebugSymbols::Type type) {
807 case i::wasm::WasmDebugSymbols::Type::EmbeddedDWARF:
808 return Just(WasmScript::DebugSymbols::Type::EmbeddedDWARF);
809 case i::wasm::WasmDebugSymbols::Type::ExternalDWARF:
810 return Just(WasmScript::DebugSymbols::Type::ExternalDWARF);
811 case i::wasm::WasmDebugSymbols::Type::SourceMap:
812 return Just(WasmScript::DebugSymbols::Type::SourceMap);
813 case i::wasm::WasmDebugSymbols::Type::None:
818std::vector<WasmScript::DebugSymbols> WasmScript::GetDebugSymbols()
const {
820 DCHECK_EQ(i::Script::Type::kWasm, script->type());
822 std::vector<WasmScript::DebugSymbols> debug_symbols;
823 auto symbols = script->wasm_native_module()->module()->debug_symbols;
824 for (
size_t i = 0;
i < symbols.
size(); ++
i) {
825 const i::wasm::WasmDebugSymbols& symbol = symbols[
i];
826 Maybe<WasmScript::DebugSymbols::Type> type =
827 GetDebugSymbolType(symbol.type);
828 if (type.IsNothing())
continue;
830 internal::wasm::ModuleWireBytes wire_bytes(
831 script->wasm_native_module()->wire_bytes());
832 i::wasm::WasmName external_url =
833 wire_bytes.GetNameOrNull(symbol.external_url);
834 MemorySpan<const char> span = {external_url.data(), external_url.size()};
835 debug_symbols.push_back({type.FromJust(), span});
837 return debug_symbols;
840int WasmScript::NumFunctions()
const {
843 DCHECK_EQ(i::Script::Type::kWasm, script->type());
844 i::wasm::NativeModule* native_module = script->wasm_native_module();
845 const i::wasm::WasmModule* module = native_module->module();
847 return static_cast<int>(
module->functions.size());
850int WasmScript::NumImportedFunctions()
const {
853 DCHECK_EQ(i::Script::Type::kWasm, script->type());
854 i::wasm::NativeModule* native_module = script->wasm_native_module();
855 const i::wasm::WasmModule* module = native_module->module();
857 return static_cast<int>(
module->num_imported_functions);
860std::pair<int, int> WasmScript::GetFunctionRange(
int function_index)
const {
863 DCHECK_EQ(i::Script::Type::kWasm, script->type());
864 i::wasm::NativeModule* native_module = script->wasm_native_module();
865 const i::wasm::WasmModule* module = native_module->module();
867 DCHECK_GT(module->functions.size(), function_index);
868 const i::wasm::WasmFunction& func =
module->functions[function_index];
871 return std::make_pair(
static_cast<int>(func.code.offset()),
872 static_cast<int>(func.code.end_offset()));
875int WasmScript::GetContainingFunction(
int byte_offset)
const {
878 DCHECK_EQ(i::Script::Type::kWasm, script->type());
879 i::wasm::NativeModule* native_module = script->wasm_native_module();
880 const i::wasm::WasmModule* module = native_module->module();
883 return i::wasm::GetContainingWasmFunction(module, byte_offset);
886void WasmScript::Disassemble(DisassemblyCollector* collector,
887 std::vector<int>* function_body_offsets) {
890 DCHECK_EQ(i::Script::Type::kWasm, script->type());
891 i::wasm::NativeModule* native_module = script->wasm_native_module();
892 const i::wasm::WasmModule* module = native_module->module();
893 i::wasm::ModuleWireBytes wire_bytes(native_module->wire_bytes());
894 i::wasm::Disassemble(module, wire_bytes, native_module->GetNamesProvider(),
895 collector, function_body_offsets);
898void Disassemble(base::Vector<const uint8_t> wire_bytes,
899 DisassemblyCollector* collector,
900 std::vector<int>* function_body_offsets) {
901 i::wasm::Disassemble(wire_bytes, collector, function_body_offsets);
904uint32_t WasmScript::GetFunctionHash(
int function_index) {
907 DCHECK_EQ(i::Script::Type::kWasm, script->type());
908 i::wasm::NativeModule* native_module = script->wasm_native_module();
909 const i::wasm::WasmModule* module = native_module->module();
911 DCHECK_GT(module->functions.size(), function_index);
912 const i::wasm::WasmFunction& func =
module->functions[function_index];
913 i::wasm::ModuleWireBytes wire_bytes(native_module->wire_bytes());
914 base::Vector<const uint8_t> function_bytes =
915 wire_bytes.GetFunctionBytes(&func);
917 return i::StringHasher::HashSequentialString(function_bytes.begin(),
918 function_bytes.length(), 0);
921Maybe<v8::MemorySpan<const uint8_t>> WasmScript::GetModuleBuildId()
const {
924 DCHECK_EQ(i::Script::Type::kWasm, script->type());
925 i::wasm::NativeModule* native_module = script->wasm_native_module();
926 const i::wasm::WasmModule* wasm_module = native_module->module();
927 const i::wasm::WireBytesRef& build_id = wasm_module->build_id;
928 if (build_id.is_empty()) {
931 return Just(MemorySpan<const uint8_t>{
932 native_module->wire_bytes().begin() + build_id.offset(),
936int WasmScript::CodeOffset()
const {
938 DCHECK_EQ(i::Script::Type::kWasm, script->type());
939 i::wasm::NativeModule* native_module = script->wasm_native_module();
940 const i::wasm::WasmModule* module = native_module->module();
945 module->code.offset() != 0);
946 return module->code.offset();
951 : line_number_(line_number),
952 column_number_(column_number),
956 : line_number_(
Function::kLineOffsetNotFound),
957 column_number_(
Function::kLineOffsetNotFound),
978 i::Script::Iterator iterator(isolate);
980 script = iterator.Next()) {
981#if V8_ENABLE_WEBASSEMBLY
982 if (script->type() != i::Script::Type::kNormal &&
983 script->type() != i::Script::Type::kWasm) {
987 if (script->type() != i::Script::Type::kNormal)
continue;
989 if (!script->HasValidSource())
continue;
1009 i::Compiler::GetSharedFunctionInfoForScriptWithCachedData(
1015 &compilation_details);
1022#if V8_ENABLE_WEBASSEMBLY
1023void EnterDebuggingForIsolate(
Isolate* v8_isolate) {
1025 i::wasm::GetWasmEngine()->EnterDebuggingForIsolate(isolate);
1028void LeaveDebuggingForIsolate(Isolate* v8_isolate) {
1030 i::wasm::GetWasmEngine()->LeaveDebuggingForIsolate(isolate);
1040 reinterpret_cast<i::Isolate*
>(v8_isolate)->set_async_event_delegate(delegate);
1047 i::SharedFunctionInfo::ScriptIterator iter(isolate,
1050 info = iter.Next()) {
1051 if (
auto debug_info = isolate->debug()->TryGetDebugInfo(info)) {
1052 debug_info.value()->set_computed_debug_is_blackboxed(
false);
1062 CHECK(IsHeapObject(*
object));
1068 Utils::ApiCheck(i::IsAccessorPair(*obj),
"v8::debug::AccessorPair::Cast",
1069 "Value is not a v8::debug::AccessorPair");
1072#if V8_ENABLE_WEBASSEMBLY
1073void WasmValueObject::CheckCast(
Value* that) {
1076 "v8::debug::WasmValueObject::Cast",
1077 "Value is not a v8::debug::WasmValueObject");
1080bool WasmValueObject::IsWasmValueObject(
Local<Value> that) {
1082 return i::IsWasmValueObject(*obj);
1085Local<String> WasmValueObject::type()
const {
1089 return Utils::ToLocal(type);
1099 i::Builtin builtin = i::Builtin::kStringPrototypeToLocaleLowerCase;
1106 info->set_language_mode(i::LanguageMode::kStrict);
1108 i::Factory::JSFunctionBuilder{
isolate,
info, context}
1109 .set_map(isolate->strict_function_without_prototype_map())
1118 if (delegate ==
nullptr) {
1119 isolate->set_console_delegate(
nullptr);
1121 isolate->set_console_delegate(delegate);
1128 values_(info.values_),
1134 values_(
args.length() > 1 ?
args.address_of_first_argument() : nullptr),
1143 return Utils::MessageToLocal(
1150 if (!IsScript(maybe_script))
return {};
1158 return Utils::ToLocal(direct_handle(obj->function(), obj->GetIsolate()));
1163 CHECK(obj->is_suspended());
1165 if (!IsScript(maybe_script))
return Location();
1168 i::Script::PositionInfo
info;
1169 i::SharedFunctionInfo::EnsureSourcePositionsAvailable(
1171 i::Script::GetPositionInfo(script, obj->source_position(), &info);
1172 return Location(info.line, info.column);
1180 CHECK(value->IsGeneratorObject());
1187 bool throw_on_side_effect) {
1188 auto isolate =
reinterpret_cast<i::Isolate*
>(context->GetIsolate());
1195 i::DisableBreak disable_break_scope(isolate->debug(), throw_on_side_effect);
1196 if (throw_on_side_effect) {
1197 isolate->debug()->StartSideEffectCheckMode();
1201 i::Execution::Call(isolate, self, recv_obj, {arguments,
args.size()}),
1203 if (throw_on_side_effect) {
1204 isolate->debug()->StopSideEffectCheckMode();
1216 i::REPLMode repl_mode = repl ? i::REPLMode::kYes : i::REPLMode::kNo;
1231 context->native_context()->script_context_table(), isolate);
1234 DCHECK(script_context->IsScriptContext());
1237 for (
auto it : i::ScopeInfo::IterateLocalNames(scope_info)) {
1238 if (i::ScopeInfo::VariableIsSynthetic(it->name()))
continue;
1239 names->emplace_back(
reinterpret_cast<Isolate*
>(isolate),
1240 Utils::ToLocal(direct_handle(it->name(), isolate)));
1251 return reinterpret_cast<i::Isolate*
>(v8_isolate)
1252 ->random_number_generator()
1258 if (!IsJSFunction(*callable))
return i::DebugInfo::kNoDebuggingId;
1260 int id = func->GetIsolate()->debug()->GetFunctionDebuggingId(func);
1261 DCHECK_NE(i::DebugInfo::kNoDebuggingId,
id);
1268 if (!IsJSFunction(*callable))
return false;
1270 i::Isolate* isolate = jsfunction->GetIsolate();
1275 return isolate->debug()->SetBreakpointForFunction(
1276 handle(jsfunction->shared(), isolate), condition_string,
id);
1282 i::StackGuard::API_INTERRUPT)) {}
1288 reinterpret_cast<
i::
Isolate*>(isolate)->debug())) {}
1325 return script_->functions.size();
1333 std::shared_ptr<i::Coverage> coverage)
1344 i::Coverage::CollectPrecise(
reinterpret_cast<i::Isolate*
>(isolate)));
1349 i::Coverage::CollectBestEffort(
reinterpret_cast<i::Isolate*
>(isolate)));
1353 i::Coverage::SelectMode(
reinterpret_cast<i::Isolate*
>(isolate), mode);
1361 DCHECK(IsJSReceiver(*internal_key));
1365 if (IsTheHole(*value))
return {};
1366 return Utils::ToLocal(value);
1375 DCHECK(IsJSReceiver(*internal_key));
1378 i::EphemeronHashTable::Put(self, internal_key, internal_value));
1387 i::EphemeronHashTable::New(i_isolate, 0);
1397 i::Isolate* isolate = accessors->GetIsolate();
1399 return Utils::ToLocal(
getter);
1404 i::Isolate* isolate = accessors->GetIsolate();
1406 return Utils::ToLocal(
setter);
1418 isolate->factory()->promise_debug_message_symbol();
1420 i::JSReceiver::GetDataProperty(isolate, promise,
key);
1449 reinterpret_cast<i::Isolate*
>(context->GetIsolate());
1450 if (isolate->is_execution_terminating()) {
1455 return i::DebugPropertyIterator::Create(
1464 if (
isolate_->is_execution_terminating()) {
1465 return Nothing<bool>();
1471 if (!AdvanceInternal()) {
1473 return Nothing<bool>();
#define RETURN_ON_FAILED_EXECUTION(T)
#define DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate)
#define PREPARE_FOR_DEBUG_INTERFACE_EXECUTION_WITH_ISOLATE(i_isolate, context, T)
#define ENTER_V8_BASIC(i_isolate)
#define ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate)
#define API_RCS_SCOPE(i_isolate, class_name, function_name)
#define RETURN_ESCAPED(value)
@ kAsyncStackTaggingCreateTaskCall
bool empty() const noexcept
size_t size() const noexcept
void push_back(const Local< T > &x)
constexpr size_t size() const
@ kNoCacheBecauseInspector
static v8::internal::Handle< To > OpenHandle(v8::Local< From > handle)
static Local< To > Convert(v8::internal::DirectHandle< From > obj)
static v8::internal::DirectHandle< To > OpenDirectHandle(v8::Local< From > handle)
static V8_INLINE bool ApiCheck(bool condition, const char *location, const char *message)
static void CheckCast(v8::Value *obj)
v8::Local< v8::Value > setter()
static bool IsAccessorPair(v8::Local< v8::Value > obj)
v8::Local< v8::Value > getter()
ConsoleCallArguments(const v8::FunctionCallbackInfo< v8::Value > &)
i::CoverageBlock * block_
bool HasBlockCoverage() const
BlockData GetBlockData(size_t i) const
MaybeLocal< String > Name() const
size_t BlockCount() const
FunctionData GetFunctionData(size_t i) const
size_t FunctionCount() const
ScriptData(size_t index, std::shared_ptr< i::Coverage > c)
Local< debug::Script > GetScript() const
static void SelectMode(Isolate *isolate, CoverageMode mode)
Coverage(std::shared_ptr< i::Coverage > coverage)
static Coverage CollectPrecise(Isolate *isolate)
static Coverage CollectBestEffort(Isolate *isolate)
ScriptData GetScriptData(size_t i) const
std::shared_ptr< i::Coverage > coverage_
size_t ScriptCount() const
DisableBreakScope(v8::Isolate *isolate)
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT v8::MaybeLocal< v8::Value > Get(v8::Isolate *isolate, v8::Local< v8::Value > key)
static V8_EXPORT_PRIVATE Local< EphemeronTable > New(v8::Isolate *isolate)
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT v8::Local< EphemeronTable > Set(v8::Isolate *isolate, v8::Local< v8::Value > key, v8::Local< v8::Value > value)
static V8_INLINE EphemeronTable * Cast(Value *obj)
static v8::Local< debug::GeneratorObject > Cast(v8::Local< v8::Value > value)
debug::Location SuspendedLocation()
v8::MaybeLocal< debug::Script > Script()
v8::Local< v8::Function > Function()
int GetColumnNumber() const
int GetLineNumber() const
PostponeInterruptsScope(v8::Isolate *isolate)
~PostponeInterruptsScope()
static V8_WARN_UNUSED_RESULT std::unique_ptr< PropertyIterator > Create(v8::Local< v8::Context > context, v8::Local< v8::Object > object, bool skip_indices=false)
MaybeLocal< String > JavaScriptCode() const
MaybeLocal< String > Name() const
MaybeLocal< String > SourceURL() const
MaybeLocal< String > GetSha256Hash() const
bool SetScriptSource(v8::Local< v8::String > newSource, bool preview, bool allow_top_frame_live_editing, LiveEditResult *result) const
Local< ScriptSource > Source() const
bool GetPossibleBreakpoints(const debug::Location &start, const debug::Location &end, bool restrict_to_function, std::vector< debug::BreakLocation > *locations) const
Maybe< int > ContextId() const
v8::debug::Location GetSourceLocation(int offset) const
ScriptOriginOptions OriginOptions() const
v8::Isolate * GetIsolate() const
Maybe< int > GetSourceOffset(const debug::Location &location, GetSourceOffsetMode mode=GetSourceOffsetMode::kStrict) const
bool SetInstrumentationBreakpoint(BreakpointId *id) const
MaybeLocal< String > SourceMappingURL() const
bool SetBreakpoint(v8::Local< v8::String > condition, debug::Location *location, BreakpointId *id) const
void SetDebugDelegate(debug::DebugDelegate *delegate)
void NotifyDebuggerPausedEventSent()
void SetIsolateId(uint64_t id)
void ChangeBreakOnException(ExceptionBreakType type, bool enable)
void SetBreakOnNextFunctionCall()
uint64_t IsolateId() const
bool SetScriptSource(Handle< Script > script, Handle< String > source, bool preview, bool allow_top_frame_live_editing, debug::LiveEditResult *result)
void ClearBreakOnNextFunctionCall()
void set_return_value(Tagged< Object > value)
V8_WARN_UNUSED_RESULT HandleType< String >::MaybeType NewConsString(HandleType< String > left, HandleType< String > right, AllocationType allocation=AllocationType::kYoung)
Handle< String > NewStringFromAsciiChecked(const char *str, AllocationType allocation=AllocationType::kYoung)
Handle< SharedFunctionInfo > NewSharedFunctionInfoForBuiltin(MaybeDirectHandle< String > name, Builtin builtin, int len, AdaptArguments adapt, FunctionKind kind=FunctionKind::kNormalFunction)
V8_WARN_UNUSED_RESULT MaybeHandle< String > NewStringFromUtf8(base::Vector< const char > str, AllocationType allocation=AllocationType::kYoung)
Handle< String > NewProperSubString(DirectHandle< String > str, uint32_t begin, uint32_t end)
HandleType< T > CloseAndEscape(HandleType< T > handle_value)
MaybeDirectHandle< String > Finish()
V8_INLINE void AppendString(std::string_view str)
V8_INLINE void AppendCStringLiteral(const char(&literal)[N])
DateCache * date_cache() const
void CountUsage(v8::Isolate::UseCounterFeature feature)
Handle< NativeContext > native_context()
v8::internal::Factory * factory()
V8_WARN_UNUSED_RESULT V8_INLINE bool ToHandle(DirectHandle< S > *out) const
V8_INLINE constexpr bool is_null() const
const JSFunctionRef function_
std::atomic< bool > is_empty_
Handle< SharedFunctionInfo > info
DeclarationScope * scope_
#define ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value)
base::Vector< const DirectHandle< Object > > args
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in allocation gc speed threshold for starting incremental marking via a task in percent of available threshold for starting incremental marking immediately in percent of available Use a single schedule for determining a marking schedule between JS and C objects schedules the minor GC task with kUserVisible priority max worker number of concurrent for NumberOfWorkerThreads start background threads that allocate memory concurrent_array_buffer_sweeping use parallel threads to clear weak refs in the atomic pause trace progress of the incremental marking trace object counts and memory usage report a tick only when allocated zone memory changes by this amount TracingFlags::gc_stats TracingFlags::gc_stats track native contexts that are expected to be garbage collected verify heap pointers before and after GC memory reducer runs GC with ReduceMemoryFootprint flag Maximum number of memory reducer GCs scheduled Old gen GC speed is computed directly from gc tracer counters Perform compaction on full GCs based on V8 s default heuristics Perform compaction on every full GC Perform code space compaction when finalizing a full GC with stack Stress GC compaction to flush out bugs with moving objects flush of baseline code when it has not been executed recently Use time base code flushing instead of age Use a progress bar to scan large objects in increments when incremental marking is active force incremental marking for small heaps and run it more often force marking at random points between and force scavenge at random points between and reclaim otherwise unreachable unmodified wrapper objects when possible less compaction in non memory reducing mode use high priority threads for concurrent Marking Test mode only flag It allows an unit test to select evacuation candidates use incremental marking for CppHeap cppheap_concurrent_marking c value for membalancer A special constant to balance between memory and space tradeoff The smaller the more memory it uses enable use of SSE4 instructions if available enable use of AVX VNNI instructions if available enable use of POPCNT instruction if available force all emitted branches to be in long mode(MIPS/PPC only)") DEFINE_BOOL(partial_constant_pool
SharedFunctionInfoRef shared
ZoneVector< RpoNumber > & result
InstructionOperand source
constexpr Vector< T > VectorOf(T *start, size_t size)
void SetBreakPointsActive(Isolate *v8_isolate, bool is_active)
int EstimatedValueSize(Isolate *v8_isolate, Local< Value > value)
bool PrepareRestartFrame(Isolate *v8_isolate, int callFrameOrdinal)
MaybeLocal< Value > CallFunctionOn(Local< Context > context, Local< Function > function, Local< Value > recv, base::Vector< Local< Value > > args, bool throw_on_side_effect)
void ResetBlackboxedStateCache(Isolate *v8_isolate, Local< Script > script)
void GlobalLexicalScopeNames(v8::Local< v8::Context > v8_context, std::vector< v8::Global< v8::String > > *names)
void BreakRightNow(Isolate *v8_isolate, base::EnumSet< debug::BreakReason > break_reasons)
void SetReturnValue(v8::Isolate *v8_isolate, v8::Local< v8::Value > value)
void SetBreakOnNextFunctionCall(Isolate *isolate)
bool CanBreakProgram(Isolate *v8_isolate)
bool GetPrivateMembers(Local< Context > context, Local< Object > object, int filter, LocalVector< Value > *names_out, LocalVector< Value > *values_out)
void ForceGarbageCollection(Isolate *isolate, StackState embedder_stack_state)
void ChangeBreakOnException(Isolate *isolate, ExceptionBreakState type)
MaybeLocal< UnboundScript > CompileInspectorScript(Isolate *v8_isolate, Local< String > source)
Local< Function > GetBuiltin(Isolate *v8_isolate, Builtin requested_builtin)
bool SetFunctionBreakpoint(v8::Local< v8::Function > function, v8::Local< v8::String > condition, BreakpointId *id)
void SetConsoleDelegate(Isolate *v8_isolate, ConsoleDelegate *delegate)
MaybeLocal< Array > GetInternalProperties(Isolate *v8_isolate, Local< Value > value)
int GetContextId(Local< Context > context)
@ BreakOnUncaughtException
void SetIsolateId(v8::Isolate *v8_isolate, uint64_t id)
void SetTerminateOnResume(Isolate *v8_isolate)
Local< String > GetDateDescription(Local< Date > date)
MaybeLocal< v8::Value > EvaluateGlobal(v8::Isolate *isolate, v8::Local< v8::String > source, EvaluateGlobalMode mode, bool repl)
Local< String > GetFunctionDescription(Local< Function > function)
int64_t GetNextRandomInt64(v8::Isolate *v8_isolate)
void PrepareStep(Isolate *v8_isolate, StepAction action)
void ClearStepping(Isolate *v8_isolate)
MaybeLocal< Message > GetMessageFromPromise(Local< Promise > p)
void RemoveBreakpoint(Isolate *v8_isolate, BreakpointId id)
Platform * GetCurrentPlatform()
void RecordAsyncStackTaggingCreateTaskCall(v8::Isolate *v8_isolate)
int GetDebuggingId(v8::Local< v8::Function > function)
Local< String > GetBigIntStringValue(Isolate *isolate, Local< BigInt > bigint)
void GetLoadedScripts(Isolate *v8_isolate, std::vector< v8::Global< Script > > &scripts)
void SetAsyncEventDelegate(Isolate *v8_isolate, AsyncEventDelegate *delegate)
void ClearBreakOnNextFunctionCall(Isolate *isolate)
void NotifyDebuggerPausedEventSent(v8::Isolate *v8_isolate)
void SetInspector(Isolate *isolate, v8_inspector::V8Inspector *inspector)
uint64_t GetIsolateId(v8::Isolate *v8_isolate)
void SetContextId(Local< Context > context, int id)
v8_inspector::V8Inspector * GetInspector(Isolate *isolate)
v8::Local< v8::Message > CreateMessageFromException(Isolate *v8_isolate, v8::Local< v8::Value > v8_error)
void SetDebugDelegate(Isolate *v8_isolate, DebugDelegate *delegate)
MaybeLocal< Context > GetCreationContext(Local< Object > value)
Local< String > GetBigIntDescription(Isolate *isolate, Local< BigInt > bigint)
void Disassemble(const WasmModule *module, ModuleWireBytes wire_bytes, NamesProvider *names, v8::debug::DisassemblyCollector *collector, std::vector< int > *function_body_offsets)
constexpr int kTaggedSize
@ kIgnoreIfAllFramesBlackboxed
ReadOnlyRoots GetReadOnlyRoots()
bool IsPrivateMethodVariableMode(VariableMode mode)
DateBuffer ToDateString(double time_val, DateCache *date_cache, ToDateStringMode mode)
V8_INLINE DirectHandle< T > direct_handle(Tagged< T > object, Isolate *isolate)
constexpr AdaptArguments kAdapt
V8_EXPORT_PRIVATE FlagValues v8_flags
bool IsPrivateAccessorVariableMode(VariableMode mode)
bool IsPrivateMethodOrAccessorVariableMode(VariableMode mode)
DirectHandle< String > GetWasmFunctionDebugName(Isolate *isolate, DirectHandle< WasmTrustedInstanceData > instance_data, uint32_t func_index)
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
bool ToLocal(v8::internal::MaybeDirectHandle< v8::internal::Object > maybe, Local< T > *local)
v8::Local< T > ToApiHandle(v8::internal::DirectHandle< v8::internal::Object > obj)
static constexpr AcquireLoadTag kAcquireLoad
Maybe< T > Just(const T &t)
#define DCHECK_LE(v1, v2)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK_NE(v1, v2)
#define DCHECK_GE(v1, v2)
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
#define DCHECK_GT(v1, v2)
#define END_ALLOW_USE_DEPRECATED()
#define START_ALLOW_USE_DEPRECATED()
std::unique_ptr< ValueMirror > value
std::unique_ptr< ValueMirror > key