Lines Matching refs:isolate
18 #include "src/execution/isolate-inl.h"
48 SealHandleScope shs(isolate);
51 HandleScope scope(isolate);
55 ReturnValueScope result_scope(isolate->debug());
56 isolate->debug()->set_return_value(*value);
59 JavaScriptFrameIterator it(isolate);
60 if (isolate->debug_execution_mode() == DebugInfo::kBreakpoints) {
61 isolate->debug()->Break(it.frame(),
62 handle(it.frame()->function(), isolate));
71 if (isolate->debug_execution_mode() == DebugInfo::kSideEffects) {
73 !isolate->debug()->PerformSideEffectCheckAtBytecode(interpreted_frame);
79 BytecodeArray bytecode_array = shared.GetBytecodeArray(isolate);
97 isolate->interpreter()->GetBytecodeHandler(bytecode, operand_scale);
100 return MakePair(ReadOnlyRoots(isolate).exception(),
103 Object interrupt_object = isolate->stack_guard()->HandleInterrupts();
104 if (interrupt_object.IsException(isolate)) {
108 return MakePair(isolate->debug()->return_value(),
113 HandleScope scope(isolate);
122 JavaScriptFrameIterator it(isolate);
129 it.frame()->fp() < isolate->thread_local_top()->last_api_entry_) {
130 isolate->debug()->Break(it.frame(), function);
133 return ReadOnlyRoots(isolate).undefined_value();
137 SealHandleScope shs(isolate);
139 if (isolate->debug()->break_points_active()) {
140 isolate->debug()->HandleDebugBreak(
144 return isolate->stack_guard()->HandleInterrupts();
148 SealHandleScope shs(isolate);
150 isolate->RequestInterrupt(
151 [](v8::Isolate* isolate, void*) {
153 isolate,
157 return ReadOnlyRoots(isolate).undefined_value();
164 Isolate* isolate, Handle<ArrayList> result, Handle<IteratorType> iterator) {
183 isolate, result,
184 isolate->factory()->NewStringFromAsciiChecked("[[IteratorHasMore]]"),
185 isolate->factory()->ToBoolean(iterator->HasMore()));
187 isolate, result,
188 isolate->factory()->NewStringFromAsciiChecked("[[IteratorIndex]]"),
189 handle(iterator->index(), isolate));
191 isolate, result,
192 isolate->factory()->NewStringFromAsciiChecked("[[IteratorKind]]"),
193 isolate->factory()->NewStringFromAsciiChecked(kind));
199 MaybeHandle<JSArray> Runtime::GetInternalProperties(Isolate* isolate,
201 auto result = ArrayList::New(isolate, 8 * 2);
203 PrototypeIterator iter(isolate, Handle<JSObject>::cast(object),
208 if (!prototype->IsNull(isolate)) {
210 isolate, result,
211 isolate->factory()->NewStringFromStaticChars("[[Prototype]]"),
220 isolate, result,
221 isolate->factory()->NewStringFromAsciiChecked("[[TargetFunction]]"),
222 handle(function->bound_target_function(), isolate));
224 isolate, result,
225 isolate->factory()->NewStringFromAsciiChecked("[[BoundThis]]"),
226 handle(function->bound_this(), isolate));
228 isolate, result,
229 isolate->factory()->NewStringFromAsciiChecked("[[BoundArgs]]"),
230 isolate->factory()->NewJSArrayWithElements(
231 isolate->factory()->CopyFixedArray(
232 handle(function->bound_arguments(), isolate))));
235 result = AddIteratorInternalProperties(isolate, result, iterator);
238 result = AddIteratorInternalProperties(isolate, result, iterator);
253 isolate, result,
254 isolate->factory()->NewStringFromAsciiChecked("[[GeneratorState]]"),
255 isolate->factory()->NewStringFromAsciiChecked(status));
257 isolate, result,
258 isolate->factory()->NewStringFromAsciiChecked("[[GeneratorFunction]]"),
259 handle(generator->function(), isolate));
261 isolate, result,
262 isolate->factory()->NewStringFromAsciiChecked("[[GeneratorReceiver]]"),
263 handle(generator->receiver(), isolate));
268 isolate, result,
269 isolate->factory()->NewStringFromAsciiChecked("[[PromiseState]]"),
270 isolate->factory()->NewStringFromAsciiChecked(
273 isolate, result,
274 isolate->factory()->NewStringFromAsciiChecked("[[PromiseResult]]"),
276 ? isolate->factory()->undefined_value()
277 : handle(promise->result(), isolate));
282 isolate, result,
283 isolate->factory()->NewStringFromAsciiChecked("[[Handler]]"),
284 handle(js_proxy->handler(), isolate));
286 isolate, result,
287 isolate->factory()->NewStringFromAsciiChecked("[[Target]]"),
288 handle(js_proxy->target(), isolate));
290 isolate, result,
291 isolate->factory()->NewStringFromAsciiChecked("[[IsRevoked]]"),
292 isolate->factory()->ToBoolean(js_proxy->IsRevoked()));
298 isolate, result,
299 isolate->factory()->NewStringFromAsciiChecked("[[PrimitiveValue]]"),
300 handle(js_value->value(), isolate));
308 isolate, result,
309 isolate->factory()->NewStringFromAsciiChecked("[[IsDetached]]"),
310 isolate->factory()->true_value());
325 isolate, result, \
326 isolate->factory()->NewStringFromStaticChars("[[" #Type "Array]]"), \
327 isolate->factory()->NewJSTypedArray(kExternal##Type##Array, \
339 ArrayList::Add(isolate, result,
340 isolate->factory()->NewStringFromAsciiChecked(
342 isolate->factory()->NewNumberFromSize(byte_length));
347 ? isolate->factory()->NewNumberFromUint(backing_store->id())
348 : isolate->factory()->null_value();
350 isolate, result,
351 isolate->factory()->NewStringFromAsciiChecked("[[ArrayBufferData]]"),
355 isolate->factory()->array_buffer_wasm_memory_symbol();
357 JSObject::GetDataProperty(isolate, js_array_buffer, memory_symbol);
358 if (!memory_object->IsUndefined(isolate)) {
359 result = ArrayList::Add(isolate, result,
360 isolate->factory()->NewStringFromAsciiChecked(
368 isolate, result, Handle<WasmInstanceObject>::cast(object));
371 isolate, result, Handle<WasmModuleObject>::cast(object));
374 isolate, result, Handle<WasmTableObject>::cast(object));
377 return isolate->factory()->NewJSArrayWithElements(
378 ArrayList::Elements(isolate, result), PACKED_ELEMENTS);
382 HandleScope scope(isolate);
397 for (ScopeIterator it(isolate, gen); !it.Done(); it.Next()) {
405 HandleScope scope(isolate);
409 return ReadOnlyRoots(isolate).undefined_value();
418 return ReadOnlyRoots(isolate).undefined_value();
423 ScopeIterator it(isolate, gen);
428 return ReadOnlyRoots(isolate).undefined_value();
454 HandleScope scope(isolate);
460 ScopeIterator it(isolate, gen);
462 return isolate->heap()->ToBoolean(res);
467 HandleScope scope(isolate);
469 CHECK(isolate->debug()->is_active());
472 Handle<SharedFunctionInfo> shared(fun->shared(), isolate);
475 Debug::GetSourceBreakLocations(isolate, shared);
476 if (break_locations->IsUndefined(isolate)) {
477 return ReadOnlyRoots(isolate).undefined_value();
480 return *isolate->factory()->NewJSArrayWithElements(
488 HandleScope scope(isolate);
493 bool result = isolate->debug()->IsBreakOnException(type);
499 HandleScope scope(isolate);
501 CHECK(isolate->debug()->is_active());
502 isolate->debug()->ClearStepping();
503 return ReadOnlyRoots(isolate).undefined_value();
507 HandleScope scope(isolate);
512 DebugScope debug_scope(isolate->debug());
514 instances = isolate->debug()->GetLoadedScripts();
519 Handle<Script> script(Script::cast(instances->get(i)), isolate);
524 return *isolate->factory()->NewJSArrayWithElements(instances);
529 SealHandleScope shs(isolate);
536 return ReadOnlyRoots(isolate).empty_string();
543 SealHandleScope shs(isolate);
545 isolate->heap()->PreciseCollectAllGarbage(Heap::kNoGCFlags,
547 return ReadOnlyRoots(isolate).undefined_value();
591 Isolate* isolate) {
594 return isolate->factory()->null_value();
603 is_wasm_script ? isolate->factory()->empty_string()
604 : isolate->factory()->NewSubString(
605 handle(String::cast(script->source()), isolate),
609 isolate->factory()->NewJSObject(isolate->object_function());
611 JSObject::AddProperty(isolate, jsinfo, isolate->factory()->script_string(),
613 JSObject::AddProperty(isolate, jsinfo, isolate->factory()->position_string(),
614 handle(Smi::FromInt(position), isolate), NONE);
615 JSObject::AddProperty(isolate, jsinfo, isolate->factory()->line_string(),
616 handle(Smi::FromInt(info.line), isolate), NONE);
617 JSObject::AddProperty(isolate, jsinfo, isolate->factory()->column_string(),
618 handle(Smi::FromInt(info.column), isolate), NONE);
619 JSObject::AddProperty(isolate, jsinfo,
620 isolate->factory()->sourceText_string(), sourceText,
626 Handle<Object> ScriptLocationFromLine(Isolate* isolate, Handle<Script> script,
634 if (!opt_line->IsNullOrUndefined(isolate)) {
640 if (!opt_column->IsNullOrUndefined(isolate)) {
647 if (line_position < 0 || column < 0) return isolate->factory()->null_value();
650 isolate);
654 bool GetScriptById(Isolate* isolate, int needle, Handle<Script>* result) {
655 Script::Iterator iterator(isolate);
659 *result = handle(script, isolate);
671 HandleScope scope(isolate);
679 CHECK(GetScriptById(isolate, scriptid, &script));
681 return *ScriptLocationFromLine(isolate, script, opt_line, opt_column, offset);
687 HandleScope scope(isolate);
691 if (isolate->debug()->needs_check_on_function_call()) {
693 Handle<SharedFunctionInfo> shared(fun->shared(), isolate);
694 isolate->debug()->DeoptimizeFunction(shared);
695 if (isolate->debug()->last_step_action() >= StepInto ||
696 isolate->debug()->break_on_next_function_call()) {
697 DCHECK_EQ(isolate->debug_execution_mode(), DebugInfo::kBreakpoints);
698 isolate->debug()->PrepareStepIn(fun);
700 if (isolate->debug_execution_mode() == DebugInfo::kSideEffects &&
701 !isolate->debug()->PerformSideEffectCheck(fun, receiver)) {
702 return ReadOnlyRoots(isolate).exception();
705 return ReadOnlyRoots(isolate).undefined_value();
710 HandleScope scope(isolate);
712 isolate->debug()->PrepareStepInSuspendedGenerator();
713 return ReadOnlyRoots(isolate).undefined_value();
718 HandleScope scope(isolate);
720 isolate->PushPromise(promise);
721 return ReadOnlyRoots(isolate).undefined_value();
727 SealHandleScope shs(isolate);
728 isolate->PopPromise();
729 return ReadOnlyRoots(isolate).undefined_value();
733 Handle<JSObject> MakeRangeObject(Isolate* isolate, const CoverageBlock& range) {
734 Factory* factory = isolate->factory();
741 JSObject::AddProperty(isolate, range_obj, start_string,
743 JSObject::AddProperty(isolate, range_obj, end_string,
745 JSObject::AddProperty(isolate, range_obj, count_string,
753 HandleScope scope(isolate);
757 if (isolate->is_best_effort_code_coverage()) {
758 coverage = Coverage::CollectBestEffort(isolate);
760 coverage = Coverage::CollectPrecise(isolate);
762 Factory* factory = isolate->factory();
771 HandleScope inner_scope(isolate);
788 Handle<JSObject> range_object = MakeRangeObject(isolate, ranges[j]);
794 JSObject::AddProperty(isolate, script_obj, script_string,
795 handle(script_data.script->source(), isolate), NONE);
802 SealHandleScope shs(isolate);
803 bool enable = Oddball::cast(args[0]).ToBool(isolate);
804 Coverage::SelectMode(isolate, enable ? debug::CoverageMode::kPreciseCount
806 return ReadOnlyRoots(isolate).undefined_value();
810 SealHandleScope shs(isolate);
811 bool enable = Oddball::cast(args[0]).ToBool(isolate);
812 Coverage::SelectMode(isolate, enable ? debug::CoverageMode::kBlockCount
814 return ReadOnlyRoots(isolate).undefined_value();
823 HandleScope scope(isolate);
828 bool is_predicted_as_caught = Oddball::cast(args[4]).ToBool(isolate);
833 Handle<JSPromise> throwaway = isolate->factory()->NewJSPromiseWithoutHook();
834 isolate->OnAsyncFunctionSuspended(throwaway, promise);
841 if (isolate->debug()->is_active()) {
842 Object::SetProperty(isolate, reject_handler,
843 isolate->factory()->promise_forwarding_handler_symbol(),
844 isolate->factory()->true_value(),
852 Object::SetProperty(isolate, throwaway,
853 isolate->factory()->promise_handled_by_symbol(),
859 isolate, promise, isolate->factory()->promise_awaited_by_symbol(),
869 HandleScope scope(isolate);
872 isolate->OnPromiseThen(Handle<JSPromise>::cast(promise));
878 HandleScope scope(isolate);
884 isolate);
886 LiveEdit::PatchScript(isolate, script, new_source, false, &result);
889 return isolate->Throw(*isolate->factory()->NewStringFromAsciiChecked(
892 return isolate->Throw(*isolate->factory()->NewStringFromAsciiChecked(
895 return isolate->Throw(*isolate->factory()->NewStringFromAsciiChecked(
898 return ReadOnlyRoots(isolate).undefined_value();
900 return ReadOnlyRoots(isolate).undefined_value();
904 HandleScope scope(isolate);
920 i::EmbeddedData d = i::EmbeddedData::FromBlob(isolate);
927 return ReadOnlyRoots(isolate).undefined_value();