Lines Matching refs:v8
27 v8::MaybeLocal<v8::Array> collectionsEntries(v8::Local<v8::Context> context, in collectionsEntries()
28 v8::Local<v8::Value> value) { in collectionsEntries()
29 v8::Isolate* isolate = context->GetIsolate(); in collectionsEntries()
30 v8::Local<v8::Array> entries; in collectionsEntries()
33 !value.As<v8::Object>()->PreviewEntries(&isKeyValue).ToLocal(&entries)) { in collectionsEntries()
34 return v8::MaybeLocal<v8::Array>(); in collectionsEntries()
37 v8::Local<v8::Array> wrappedEntries = v8::Array::New(isolate); in collectionsEntries()
39 if (!wrappedEntries->SetPrototype(context, v8::Null(isolate)) in collectionsEntries()
41 return v8::MaybeLocal<v8::Array>(); in collectionsEntries()
43 v8::Local<v8::Value> item; in collectionsEntries()
45 v8::Local<v8::Value> value; in collectionsEntries()
47 v8::Local<v8::Object> wrapper = v8::Object::New(isolate); in collectionsEntries()
48 if (!wrapper->SetPrototype(context, v8::Null(isolate)).FromMaybe(false)) in collectionsEntries()
62 return v8::MaybeLocal<v8::Array>(); in collectionsEntries()
67 v8::MaybeLocal<v8::Object> buildLocation(v8::Local<v8::Context> context, in buildLocation()
70 if (scriptId == v8::UnboundScript::kNoScriptId) in buildLocation()
71 return v8::MaybeLocal<v8::Object>(); in buildLocation()
72 if (lineNumber == v8::Function::kLineOffsetNotFound || in buildLocation()
73 columnNumber == v8::Function::kLineOffsetNotFound) { in buildLocation()
74 return v8::MaybeLocal<v8::Object>(); in buildLocation()
76 v8::Isolate* isolate = context->GetIsolate(); in buildLocation()
77 v8::Local<v8::Object> location = v8::Object::New(isolate); in buildLocation()
78 if (!location->SetPrototype(context, v8::Null(isolate)).FromMaybe(false)) { in buildLocation()
79 return v8::MaybeLocal<v8::Object>(); in buildLocation()
85 return v8::MaybeLocal<v8::Object>(); in buildLocation()
89 v8::Integer::New(isolate, lineNumber)) in buildLocation()
91 return v8::MaybeLocal<v8::Object>(); in buildLocation()
95 v8::Integer::New(isolate, columnNumber)) in buildLocation()
97 return v8::MaybeLocal<v8::Object>(); in buildLocation()
100 return v8::MaybeLocal<v8::Object>(); in buildLocation()
105 v8::MaybeLocal<v8::Object> generatorObjectLocation( in generatorObjectLocation()
106 v8::Local<v8::Context> context, v8::Local<v8::Value> value) { in generatorObjectLocation()
107 if (!value->IsGeneratorObject()) return v8::MaybeLocal<v8::Object>(); in generatorObjectLocation()
108 v8::Local<v8::debug::GeneratorObject> generatorObject = in generatorObjectLocation()
109 v8::debug::GeneratorObject::Cast(value); in generatorObjectLocation()
111 v8::Local<v8::Function> func = generatorObject->Function(); in generatorObjectLocation()
115 v8::Local<v8::debug::Script> script; in generatorObjectLocation()
117 return v8::MaybeLocal<v8::Object>(); in generatorObjectLocation()
118 v8::debug::Location suspendedLocation = generatorObject->SuspendedLocation(); in generatorObjectLocation()
134 class MatchPrototypePredicate : public v8::debug::QueryObjectPredicate {
137 v8::Local<v8::Context> context, in MatchPrototypePredicate()
138 v8::Local<v8::Object> prototype) in MatchPrototypePredicate()
141 bool Filter(v8::Local<v8::Object> object) override { in Filter()
142 v8::Local<v8::Context> objectContext = object->CreationContext(); in Filter()
146 for (v8::Local<v8::Value> prototype = object->GetPrototype(); in Filter()
148 prototype = prototype.As<v8::Object>()->GetPrototype()) { in Filter()
156 v8::Local<v8::Context> m_context;
157 v8::Local<v8::Value> m_prototype;
161 V8Debugger::V8Debugger(v8::Isolate* isolate, V8InspectorImpl* inspector) in V8Debugger()
169 m_pauseOnExceptionsState(v8::debug::NoBreakOnException), in V8Debugger()
181 v8::HandleScope scope(m_isolate); in enable()
182 v8::debug::SetDebugDelegate(m_isolate, this); in enable()
184 v8::debug::ChangeBreakOnException(m_isolate, v8::debug::NoBreakOnException); in enable()
185 m_pauseOnExceptionsState = v8::debug::NoBreakOnException; in enable()
207 v8::debug::SetDebugDelegate(m_isolate, nullptr); in disable()
222 v8::HandleScope scope(m_isolate); in getCompiledScripts()
223 v8::PersistentValueVector<v8::debug::Script> scripts(m_isolate); in getCompiledScripts()
224 v8::debug::GetLoadedScripts(m_isolate, scripts); in getCompiledScripts()
226 v8::Local<v8::debug::Script> script = scripts.Get(i); in getCompiledScripts()
247 v8::debug::SetBreakPointsActive(m_isolate, m_breakpointsActiveCount); in setBreakpointsActive()
250 v8::debug::ExceptionBreakState V8Debugger::getPauseOnExceptionsState() { in getPauseOnExceptionsState()
256 v8::debug::ExceptionBreakState pauseOnExceptionsState) { in setPauseOnExceptionsState()
259 v8::debug::ChangeBreakOnException(m_isolate, pauseOnExceptionsState); in setPauseOnExceptionsState()
273 v8::debug::SetBreakOnNextFunctionCall(m_isolate); in setPauseOnNextCall()
275 v8::debug::ClearBreakOnNextFunctionCall(m_isolate); in setPauseOnNextCall()
279 return !v8::debug::AllFramesOnStackAreBlackboxed(m_isolate); in canBreakProgram()
288 v8::debug::BreakRightNow(m_isolate); in breakProgram()
297 [](v8::Isolate* isolate, void*) { v8::debug::BreakRightNow(isolate); }, in interruptAndBreak()
308 if (m_pauseOnExceptionsState == v8::debug::NoBreakOnException) return; in breakProgramOnAssert()
315 v8::debug::BreakRightNow(m_isolate); in breakProgramOnAssert()
325 v8::debug::PrepareStep(m_isolate, v8::debug::StepIn); in stepIntoStatement()
334 v8::debug::PrepareStep(m_isolate, v8::debug::StepNext); in stepOverStatement()
343 v8::debug::PrepareStep(m_isolate, v8::debug::StepOut); in stepOutOfFunction()
349 auto iterator = v8::debug::StackTraceIterator::Create(m_isolate); in asyncStepOutOfFunction()
418 void V8Debugger::terminateExecutionCompletedCallback(v8::Isolate* isolate) { in terminateExecutionCompletedCallback()
424 static_cast<V8InspectorImpl*>(v8::debug::GetInspector(isolate)); in terminateExecutionCompletedCallback()
440 v8::debug::Location v8Location(location->getLineNumber(), in continueToLocation()
474 v8::debug::RemoveBreakpoint(m_isolate, m_continueToLocationBreakpointId); in clearContinueToLocation()
481 v8::Local<v8::Context> pausedContext, v8::Local<v8::Value> exception, in handleProgramBreak()
482 const std::vector<v8::debug::BreakpointId>& breakpointIds, in handleProgramBreak()
489 v8::debug::PrepareStep(m_isolate, v8::debug::StepOut); in handleProgramBreak()
516 v8::Context::Scope contextScope(pausedContext); in handleProgramBreak()
536 v8::Context::Scope scope(pausedContext); in handleProgramBreak()
566 v8::Local<v8::Context> context = thisPtr->m_isolate->GetEnteredContext(); in nearHeapLimitCallback()
570 [](v8::Isolate* isolate, void*) { v8::debug::BreakRightNow(isolate); }, in nearHeapLimitCallback()
575 void V8Debugger::ScriptCompiled(v8::Local<v8::debug::Script> script, in ScriptCompiled()
585 wasmTranslation->AddScript(script.As<v8::debug::WasmScript>(), in ScriptCompiled()
589 v8::Isolate* isolate = m_isolate; in ScriptCompiled()
604 v8::Local<v8::Context> pausedContext, in BreakProgramRequested()
605 const std::vector<v8::debug::BreakpointId>& break_points_hit) { in BreakProgramRequested()
606 handleProgramBreak(pausedContext, v8::Local<v8::Value>(), break_points_hit); in BreakProgramRequested()
609 void V8Debugger::ExceptionThrown(v8::Local<v8::Context> pausedContext, in ExceptionThrown()
610 v8::Local<v8::Value> exception, in ExceptionThrown()
611 v8::Local<v8::Value> promise, in ExceptionThrown()
614 std::vector<v8::debug::BreakpointId> break_points_hit; in ExceptionThrown()
619 bool V8Debugger::IsFunctionBlackboxed(v8::Local<v8::debug::Script> script, in IsFunctionBlackboxed()
620 const v8::debug::Location& start, in IsFunctionBlackboxed()
621 const v8::debug::Location& end) { in IsFunctionBlackboxed()
639 void V8Debugger::AsyncEventOccurred(v8::debug::DebugAsyncActionType type, in AsyncEventOccurred()
645 case v8::debug::kDebugPromiseThen: in AsyncEventOccurred()
649 case v8::debug::kDebugPromiseCatch: in AsyncEventOccurred()
653 case v8::debug::kDebugPromiseFinally: in AsyncEventOccurred()
657 case v8::debug::kDebugWillHandle: in AsyncEventOccurred()
661 case v8::debug::kDebugDidHandle: in AsyncEventOccurred()
665 case v8::debug::kAsyncFunctionSuspended: { in AsyncEventOccurred()
676 case v8::debug::kAsyncFunctionFinished: in AsyncEventOccurred()
691 v8::MaybeLocal<v8::Value> V8Debugger::getTargetScopes( in getTargetScopes()
692 v8::Local<v8::Context> context, v8::Local<v8::Value> value, in getTargetScopes()
694 v8::Local<v8::Value> scopesValue; in getTargetScopes()
695 std::unique_ptr<v8::debug::ScopeIterator> iterator; in getTargetScopes()
698 iterator = v8::debug::ScopeIterator::CreateForFunction( in getTargetScopes()
699 m_isolate, v8::Local<v8::Function>::Cast(value)); in getTargetScopes()
702 v8::Local<v8::debug::GeneratorObject> generatorObject = in getTargetScopes()
703 v8::debug::GeneratorObject::Cast(value); in getTargetScopes()
704 if (!generatorObject->IsSuspended()) return v8::MaybeLocal<v8::Value>(); in getTargetScopes()
706 iterator = v8::debug::ScopeIterator::CreateForGeneratorObject( in getTargetScopes()
707 m_isolate, v8::Local<v8::Object>::Cast(value)); in getTargetScopes()
710 if (!iterator) return v8::MaybeLocal<v8::Value>(); in getTargetScopes()
711 v8::Local<v8::Array> result = v8::Array::New(m_isolate); in getTargetScopes()
712 if (!result->SetPrototype(context, v8::Null(m_isolate)).FromMaybe(false)) { in getTargetScopes()
713 return v8::MaybeLocal<v8::Value>(); in getTargetScopes()
717 v8::Local<v8::Object> scope = v8::Object::New(m_isolate); in getTargetScopes()
719 return v8::MaybeLocal<v8::Value>(); in getTargetScopes()
723 v8::Local<v8::Value> maybe_name = iterator->GetFunctionDebugName(); in getTargetScopes()
727 v8::Local<v8::Object> object = iterator->GetObject(); in getTargetScopes()
738 if (!markAsInternal(context, v8::Local<v8::Array>::Cast(result), in getTargetScopes()
740 return v8::MaybeLocal<v8::Value>(); in getTargetScopes()
744 v8::MaybeLocal<v8::Value> V8Debugger::functionScopes( in functionScopes()
745 v8::Local<v8::Context> context, v8::Local<v8::Function> function) { in functionScopes()
749 v8::MaybeLocal<v8::Value> V8Debugger::generatorScopes( in generatorScopes()
750 v8::Local<v8::Context> context, v8::Local<v8::Value> generator) { in generatorScopes()
754 v8::MaybeLocal<v8::Array> V8Debugger::internalProperties( in internalProperties()
755 v8::Local<v8::Context> context, v8::Local<v8::Value> value) { in internalProperties()
756 v8::Local<v8::Array> properties; in internalProperties()
757 if (!v8::debug::GetInternalProperties(m_isolate, value).ToLocal(&properties)) in internalProperties()
758 return v8::MaybeLocal<v8::Array>(); in internalProperties()
760 v8::Local<v8::Function> function = value.As<v8::Function>(); in internalProperties()
761 v8::Local<v8::Object> location; in internalProperties()
775 v8::True(m_isolate)); in internalProperties()
778 v8::Local<v8::Array> entries; in internalProperties()
785 v8::Local<v8::Object> location; in internalProperties()
792 v8::Local<v8::Value> scopes; in internalProperties()
800 v8::Local<v8::Function> function = value.As<v8::Function>(); in internalProperties()
801 v8::Local<v8::Value> scopes; in internalProperties()
811 v8::Local<v8::Array> V8Debugger::queryObjects(v8::Local<v8::Context> context, in queryObjects()
812 v8::Local<v8::Object> prototype) { in queryObjects()
813 v8::Isolate* isolate = context->GetIsolate(); in queryObjects()
814 v8::PersistentValueVector<v8::Object> v8Objects(isolate); in queryObjects()
816 v8::debug::QueryObjects(context, &predicate, &v8Objects); in queryObjects()
818 v8::MicrotasksScope microtasksScope(isolate, in queryObjects()
819 v8::MicrotasksScope::kDoNotRunMicrotasks); in queryObjects()
820 v8::Local<v8::Array> resultArray = v8::Array::New( in queryObjects()
830 v8::Local<v8::StackTrace> v8StackTrace) { in createStackTrace()
853 v8::debug::SetAsyncEventDelegate(m_isolate, in setAsyncCallStackDepth()
869 v8::HandleScope scope(m_isolate); in storeCurrentStackTrace()
907 v8::debug::SetBreakOnNextFunctionCall(m_isolate); in externalAsyncTaskStarted()
927 v8::debug::ClearBreakOnNextFunctionCall(m_isolate); in externalAsyncTaskFinished()
954 v8::HandleScope scope(m_isolate); in asyncTaskScheduledForStack()
1027 v8::debug::ClearStepping(m_isolate); in asyncTaskCandidateForStepping()
1038 v8::debug::SetBreakOnNextFunctionCall(m_isolate); in asyncTaskStartedForStepping()
1049 v8::debug::ClearBreakOnNextFunctionCall(m_isolate); in asyncTaskFinishedForStepping()
1084 v8::HandleScope handles(m_isolate); in captureStackTrace()
1127 v8::Local<v8::StackFrame> v8Frame) { in symbolize()
1131 frameId = v8::debug::GetStackFrameId(v8Frame); in symbolize()
1157 v8::debug::GetNextRandomInt64(m_isolate), in debuggerIdFor()
1158 v8::debug::GetNextRandomInt64(m_isolate)); in debuggerIdFor()