Lines Matching refs:isolate

38   explicit FrameFinder(Isolate* isolate,
41 : frame_iterator_(isolate, isolate->thread_local_top()) {
61 Isolate* isolate,
64 return FrameFinder<WasmFrame>(isolate, skipped_frame_types)
69 Context GetNativeContextFromWasmInstanceOnStackTop(Isolate* isolate) {
70 return GetWasmInstanceOnStackTop(isolate).native_context();
75 explicit ClearThreadInWasmScope(Isolate* isolate) : isolate_(isolate) {
94 Object ThrowWasmError(Isolate* isolate, MessageTemplate message) {
95 Handle<JSObject> error_obj = isolate->factory()->NewWasmRuntimeError(message);
96 JSObject::AddProperty(isolate, error_obj,
97 isolate->factory()->wasm_uncatchable_symbol(),
98 isolate->factory()->true_value(), NONE);
99 return isolate->Throw(*error_obj);
107 HandleScope scope(isolate);
124 bool result = internal::wasm::TypecheckJSObject(isolate, module, value, type,
130 ClearThreadInWasmScope flag_scope(isolate);
131 HandleScope scope(isolate);
139 isolate, handle(instance->memory_object(), isolate), delta_pages);
142 DCHECK(!isolate->has_pending_exception());
147 ClearThreadInWasmScope flag_scope(isolate);
148 HandleScope scope(isolate);
151 return ThrowWasmError(isolate, MessageTemplateFromInt(message_id));
155 ClearThreadInWasmScope clear_wasm_flag(isolate);
156 SealHandleScope shs(isolate);
158 return isolate->StackOverflow();
167 HandleScope scope(isolate);
170 isolate, NewTypeError(MessageTemplate::kWasmTrapJSTypeError));
174 ClearThreadInWasmScope clear_wasm_flag(isolate);
175 HandleScope scope(isolate);
177 isolate->set_context(GetNativeContextFromWasmInstanceOnStackTop(isolate));
182 Handle<WasmExceptionTag> tag(tag_raw, isolate);
183 Handle<FixedArray> values(values_raw, isolate);
185 WasmExceptionPackage::New(isolate, tag, values);
186 wasm::GetWasmEngine()->SampleThrowEvent(isolate);
187 return isolate->Throw(*exception);
191 ClearThreadInWasmScope clear_wasm_flag(isolate);
192 HandleScope scope(isolate);
194 wasm::GetWasmEngine()->SampleRethrowEvent(isolate);
195 return isolate->ReThrow(args[0]);
199 ClearThreadInWasmScope wasm_flag(isolate);
200 SealHandleScope shs(isolate);
204 StackLimitCheck check(isolate);
205 if (check.JsHasOverflowed()) return isolate->StackOverflow();
207 return isolate->stack_guard()->HandleInterrupts();
211 ClearThreadInWasmScope wasm_flag(isolate);
212 HandleScope scope(isolate);
218 FrameFinder<WasmCompileLazyFrame> frame_finder(isolate);
222 DCHECK(isolate->context().is_null());
223 isolate->set_context(instance->native_context());
224 bool success = wasm::CompileLazy(isolate, instance, func_index);
226 DCHECK(isolate->has_pending_exception());
227 return ReadOnlyRoots{isolate}.exception();
235 void ReplaceWrapper(Isolate* isolate, Handle<WasmInstanceObject> instance,
238 WasmInstanceObject::GetWasmInternalFunction(isolate, instance,
242 handle(WasmExternalFunction::cast(internal->external()), isolate);
251 HandleScope scope(isolate);
256 DCHECK(isolate->context().is_null());
257 isolate->set_context(instance->native_context());
268 if (WasmInstanceObject::GetWasmInternalFunction(isolate, instance,
272 return ReadOnlyRoots(isolate).undefined_value();
277 isolate, sig, module),
278 isolate);
283 ReplaceWrapper(isolate, instance, function_index, wrapper_code);
294 ReplaceWrapper(isolate, instance, index, wrapper_code);
298 return ReadOnlyRoots(isolate).undefined_value();
302 ClearThreadInWasmScope clear_wasm_flag(isolate);
303 HandleScope scope(isolate);
308 StackLimitCheck check(isolate);
311 Object result = isolate->stack_guard()->HandleInterrupts();
315 FrameFinder<WasmFrame> frame_finder(isolate);
319 wasm::TriggerTierUp(isolate, native_module, func_index, instance);
321 return ReadOnlyRoots(isolate).undefined_value();
325 ClearThreadInWasmScope clear_wasm_flag(isolate);
326 HandleScope scope(isolate);
333 isolate};
341 ClearThreadInWasmScope clear_wasm_flag(isolate);
342 HandleScope scope(isolate);
351 isolate};
355 // Trap if memory is not shared, or wait is not allowed on the isolate
356 if (!array_buffer->is_shared() || !isolate->allow_atomics_wait()) {
357 return ThrowWasmError(isolate, MessageTemplate::kAtomicsWaitNotAllowed);
359 return FutexEmulation::WaitWasm32(isolate, array_buffer, offset,
364 ClearThreadInWasmScope clear_wasm_flag(isolate);
365 HandleScope scope(isolate);
374 isolate};
378 // Trap if memory is not shared, or if wait is not allowed on the isolate
379 if (!array_buffer->is_shared() || !isolate->allow_atomics_wait()) {
380 return ThrowWasmError(isolate, MessageTemplate::kAtomicsWaitNotAllowed);
382 return FutexEmulation::WaitWasm64(isolate, array_buffer, offset,
388 Object ThrowTableOutOfBounds(Isolate* isolate,
392 if (isolate->context().is_null()) {
393 isolate->set_context(instance->native_context());
395 return ThrowWasmError(isolate, MessageTemplate::kWasmTrapTableOutOfBounds);
400 ClearThreadInWasmScope flag_scope(isolate);
401 HandleScope scope(isolate);
406 return *WasmInstanceObject::GetOrCreateWasmInternalFunction(isolate, instance,
411 ClearThreadInWasmScope flag_scope(isolate);
412 HandleScope scope(isolate);
419 WasmTableObject::cast(instance->tables().get(table_index)), isolate);
427 if (!WasmTableObject::IsInBounds(isolate, table, entry_index)) {
428 return ThrowWasmError(isolate, MessageTemplate::kWasmTrapTableOutOfBounds);
431 return *WasmTableObject::Get(isolate, table, entry_index);
435 ClearThreadInWasmScope flag_scope(isolate);
436 HandleScope scope(isolate);
443 Handle<Object> element(element_raw, isolate);
446 WasmTableObject::cast(instance->tables().get(table_index)), isolate);
454 if (!WasmTableObject::IsInBounds(isolate, table, entry_index)) {
455 return ThrowWasmError(isolate, MessageTemplate::kWasmTrapTableOutOfBounds);
457 WasmTableObject::Set(isolate, table, entry_index, element);
458 return ReadOnlyRoots(isolate).undefined_value();
462 ClearThreadInWasmScope flag_scope(isolate);
463 HandleScope scope(isolate);
475 DCHECK(!isolate->context().is_null());
478 isolate, instance, table_index, elem_segment_index, dst, src, count);
479 if (oob) return ThrowTableOutOfBounds(isolate, instance);
480 return ReadOnlyRoots(isolate).undefined_value();
484 ClearThreadInWasmScope flag_scope(isolate);
485 HandleScope scope(isolate);
497 DCHECK(!isolate->context().is_null());
500 isolate, instance, table_dst_index, table_src_index, dst, src, count);
501 if (oob) return ThrowTableOutOfBounds(isolate, instance);
502 return ReadOnlyRoots(isolate).undefined_value();
506 ClearThreadInWasmScope flag_scope(isolate);
507 HandleScope scope(isolate);
513 Handle<Object> value(value_raw, isolate);
517 WasmTableObject::cast(instance->tables().get(table_index)), isolate);
518 int result = WasmTableObject::Grow(isolate, table, delta, value);
524 ClearThreadInWasmScope flag_scope(isolate);
525 HandleScope scope(isolate);
532 Handle<Object> value(value_raw, isolate);
536 WasmTableObject::cast(instance->tables().get(table_index)), isolate);
541 return ThrowTableOutOfBounds(isolate, instance);
548 return ThrowTableOutOfBounds(isolate, instance);
550 WasmTableObject::Fill(isolate, table, start, value, fill_count);
552 return ReadOnlyRoots(isolate).undefined_value();
556 ClearThreadInWasmScope flag_scope(isolate);
557 HandleScope scope(isolate);
560 isolate, {StackFrame::EXIT, StackFrame::WASM_DEBUG_BREAK});
562 auto instance = handle(frame->wasm_instance(), isolate);
563 auto script = handle(instance->module_object().script(), isolate);
565 isolate->set_context(instance->native_context());
569 StackLimitCheck check(isolate);
571 Object interrupt_object = isolate->stack_guard()->HandleInterrupts();
574 if (interrupt_object.IsException(isolate)) return interrupt_object;
575 DCHECK(interrupt_object.IsUndefined(isolate));
579 DebugScope debug_scope(isolate->debug());
585 WasmScript::CheckBreakPoints(isolate, script,
598 isolate->debug()->OnInstrumentationBreak();
604 debug_info->ClearStepping(isolate);
605 StepAction step_action = isolate->debug()->last_step_action();
606 isolate->debug()->ClearStepping();
607 isolate->debug()->OnDebugBreak(isolate->factory()->empty_fixed_array(),
609 return ReadOnlyRoots(isolate).undefined_value();
614 if (WasmScript::CheckBreakPoints(isolate, script, frame->position(),
617 debug_info->ClearStepping(isolate);
618 StepAction step_action = isolate->debug()->last_step_action();
619 isolate->debug()->ClearStepping();
620 if (isolate->debug()->break_points_active()) {
622 isolate->debug()->OnDebugBreak(breakpoints, step_action);
624 return ReadOnlyRoots(isolate).undefined_value();
630 return ReadOnlyRoots(isolate).undefined_value();
638 return ReadOnlyRoots(isolate).undefined_value();
651 ClearThreadInWasmScope flag_scope(isolate);
652 HandleScope scope(isolate);
669 isolate->heap()->MoveRange(*dst_array, dst_slot, src_slot, length,
672 isolate->heap()->CopyRange(*dst_array, dst_slot, src_slot, length,
686 return ReadOnlyRoots(isolate).undefined_value();
694 ClearThreadInWasmScope flag_scope(isolate);
695 HandleScope scope(isolate);
717 return *isolate->factory()->NewWasmArrayFromMemory(length, rtt, source);
728 void SyncStackLimit(Isolate* isolate) {
731 *isolate->roots_table().slot(RootIndex::kActiveContinuation));
737 isolate->stack_guard()->SetStackLimit(limit);
745 HandleScope scope(isolate);
751 *isolate->roots_table().slot(RootIndex::kActiveContinuation)),
752 isolate);
754 WasmContinuationObject::New(isolate, parent);
757 isolate->wasm_stacks()->Add(target_stack);
758 isolate->roots_table().slot(RootIndex::kActiveContinuation).store(*target);
762 isolate->roots_table().slot(RootIndex::kActiveSuspender);
772 SyncStackLimit(isolate);
779 SyncStackLimit(isolate);
780 return ReadOnlyRoots(isolate).undefined_value();
787 HandleScope scope(isolate);
791 i::Handle<i::Object> argv[] = {handle(suspender->resume(), isolate)};
794 !i::Execution::CallBuiltin(isolate, isolate->promise_then(), promise,