Lines Matching defs:isolate

13 #include "src/execution/isolate-inl.h"
14 #include "src/execution/isolate.h"
28 HandleScope scope(isolate);
29 THROW_NEW_ERROR_RETURN_FAILURE(isolate,
37 Object ThrowRedeclarationError(Isolate* isolate, Handle<String> name,
39 HandleScope scope(isolate);
42 isolate, NewSyntaxError(MessageTemplate::kVarRedeclaration, name));
45 isolate, NewTypeError(MessageTemplate::kVarRedeclaration, name));
50 Object DeclareGlobal(Isolate* isolate, Handle<JSGlobalObject> global,
55 global->native_context().script_context_table(), isolate);
62 return ThrowRedeclarationError(isolate, name,
74 LookupIterator it(isolate, global, name, global, lookup_config);
76 if (maybe.IsNothing()) return ReadOnlyRoots(isolate).exception();
83 if (is_var) return ReadOnlyRoots(isolate).undefined_value();
98 return ThrowRedeclarationError(isolate, name, redeclaration_type);
117 isolate, JSObject::DefineOwnPropertyIgnoreAttributes(&it, value, attr));
119 return ReadOnlyRoots(isolate).undefined_value();
125 HandleScope scope(isolate);
135 closure->feedback_vector().closure_feedback_cell_array(), isolate);
138 closure->closure_feedback_cell_array(), isolate);
141 Handle<Context> context(isolate->context(), isolate);
144 SourceTextModule::cast(context->extension()).regular_exports(), isolate);
147 FOR_WITH_HANDLE_SCOPE(isolate, int, i = 0, i, i < length, i++, {
153 value = ReadOnlyRoots(isolate).the_hole_value();
156 SharedFunctionInfo::cast(declarations->get(i)), isolate);
161 value = *Factory::JSFunctionBuilder(isolate, sfi, context)
169 return ReadOnlyRoots(isolate).undefined_value();
173 HandleScope scope(isolate);
179 Handle<JSGlobalObject> global(isolate->global_object());
180 Handle<Context> context(isolate->context(), isolate);
186 closure->feedback_vector().closure_feedback_cell_array(), isolate);
189 closure->closure_feedback_cell_array(), isolate);
194 FOR_WITH_HANDLE_SCOPE(isolate, int, i = 0, i, i < length, i++, {
195 Handle<Object> decl(declarations->get(i), isolate);
202 value = isolate->factory()->undefined_value();
205 name = handle(sfi->Name(), isolate);
209 value = Factory::JSFunctionBuilder(isolate, sfi, context)
224 Object result = DeclareGlobal(isolate, global, name, value, attr, is_var,
226 if (isolate->has_pending_exception()) return result;
229 return ReadOnlyRoots(isolate).undefined_value();
234 Object DeclareEvalHelper(Isolate* isolate, Handle<String> name,
240 Handle<Context> context(isolate->context().declaration_context(), isolate);
247 bool is_var = value->IsUndefined(isolate);
259 DCHECK(!isolate->has_pending_exception());
266 return DeclareGlobal(isolate, Handle<JSGlobalObject>::cast(holder), name,
271 isolate);
272 return DeclareGlobal(isolate, global, name, value, NONE, is_var,
277 JSGlobalObject::cast(context->global_object()), isolate);
278 return DeclareGlobal(isolate, global, name, value, NONE, is_var,
286 if (is_var) return ReadOnlyRoots(isolate).undefined_value();
291 return ReadOnlyRoots(isolate).undefined_value();
297 object = handle(context->extension_object(), isolate);
307 isolate->factory()->NewJSObject(isolate->context_extension_function());
312 isolate,
316 RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::SetOwnPropertyIgnoreAttributes(
319 return ReadOnlyRoots(isolate).undefined_value();
325 HandleScope scope(isolate);
329 return DeclareEvalHelper(isolate, name, value);
333 HandleScope scope(isolate);
336 return DeclareEvalHelper(isolate, name,
337 isolate->factory()->undefined_value());
344 std::unique_ptr<Handle<Object>[]> GetCallerArguments(Isolate* isolate,
347 JavaScriptFrameIterator it(isolate);
393 Handle<Object> val = Handle<Object>(frame->GetParameter(i), isolate);
401 Handle<JSObject> NewSloppyArguments(Isolate* isolate, Handle<JSFunction> callee,
406 isolate->factory()->NewArgumentsObject(callee, argument_count);
417 Handle<Context> context(isolate->context(), isolate);
418 Handle<FixedArray> arguments = isolate->factory()->NewFixedArray(
422 isolate->factory()->NewSloppyArgumentsElements(
425 result->set_map(isolate->native_context()->fast_aliased_arguments_map());
437 Handle<ScopeInfo> scope_info(callee->shared().scope_info(), isolate);
444 i, *isolate->factory()->the_hole_value());
460 Handle<FixedArray> elements = isolate->factory()->NewFixedArray(
494 HandleScope scope(isolate);
501 GetCallerArguments(isolate, &argument_count);
503 return *NewSloppyArguments(isolate, callee, argument_getter, argument_count);
507 HandleScope scope(isolate);
514 GetCallerArguments(isolate, &argument_count);
516 isolate->factory()->NewArgumentsObject(callee, argument_count);
519 isolate->factory()->NewFixedArray(argument_count);
532 HandleScope scope(isolate);
541 GetCallerArguments(isolate, &argument_count);
543 Handle<JSObject> result = isolate->factory()->NewJSArray(
558 HandleScope scope(isolate);
562 Handle<Context> context(isolate->context(), isolate);
563 return *Factory::JSFunctionBuilder{isolate, shared, context}
570 HandleScope scope(isolate);
574 Handle<Context> context(isolate->context(), isolate);
577 return *Factory::JSFunctionBuilder{isolate, shared, context}
584 HandleScope scope(isolate);
589 Handle<Context> outer(isolate->context(), isolate);
590 return *isolate->factory()->NewFunctionContext(outer, scope_info);
595 HandleScope scope(isolate);
599 Handle<Context> current(isolate->context(), isolate);
600 return *isolate->factory()->NewWithContext(current, scope_info,
606 HandleScope scope(isolate);
610 Handle<Context> current(isolate->context(), isolate);
611 return *isolate->factory()->NewCatchContext(current, scope_info,
617 HandleScope scope(isolate);
620 Handle<Context> current(isolate->context(), isolate);
621 return *isolate->factory()->NewBlockContext(current, scope_info);
626 HandleScope scope(isolate);
634 Handle<Context> context(isolate->context(), isolate);
641 if (isolate->has_pending_exception())
642 return ReadOnlyRoots(isolate).exception();
643 return ReadOnlyRoots(isolate).true_value();
649 return ReadOnlyRoots(isolate).false_value();
657 MAYBE_RETURN(result, ReadOnlyRoots(isolate).exception());
658 return isolate->heap()->ToBoolean(result.FromJust());
664 MaybeHandle<Object> LoadLookupSlot(Isolate* isolate, Handle<String> name,
671 Handle<Context> context(isolate->context(), isolate);
674 if (isolate->has_pending_exception()) return MaybeHandle<Object>();
677 Handle<Object> receiver = isolate->factory()->undefined_value();
680 isolate, Handle<SourceTextModule>::cast(holder), index);
686 Handle<Object> receiver = isolate->factory()->undefined_value();
687 Handle<Object> value = handle(Context::cast(*holder).get(index), isolate);
689 if (flag == kNeedsInitialization && value->IsTheHole(isolate)) {
690 THROW_NEW_ERROR(isolate,
694 DCHECK(!value->IsTheHole(isolate));
707 isolate, value, Object::GetProperty(isolate, holder, name), Object);
711 ? Handle<Object>::cast(isolate->factory()->undefined_value())
720 isolate, NewReferenceError(MessageTemplate::kNotDefined, name), Object);
724 if (receiver_return) *receiver_return = isolate->factory()->undefined_value();
725 return isolate->factory()->undefined_value();
732 HandleScope scope(isolate);
735 RETURN_RESULT_OR_FAILURE(isolate,
736 LoadLookupSlot(isolate, name, kThrowOnError));
741 HandleScope scope(isolate);
744 RETURN_RESULT_OR_FAILURE(isolate, LoadLookupSlot(isolate, name, kDontThrow));
749 HandleScope scope(isolate);
755 isolate, value, LoadLookupSlot(isolate, name, kThrowOnError, &receiver),
756 MakePair(ReadOnlyRoots(isolate).exception(), Object()));
764 Isolate* isolate, Handle<Context> context, Handle<String> name,
777 if (isolate->has_pending_exception()) return MaybeHandle<Object>();
784 isolate, NewTypeError(MessageTemplate::kConstAssign, name), Object);
791 Handle<Context>::cast(holder)->get(index).IsTheHole(isolate)) {
792 THROW_NEW_ERROR(isolate,
800 isolate, NewTypeError(MessageTemplate::kConstAssign, name), Object);
815 isolate, NewReferenceError(MessageTemplate::kNotDefined, name), Object);
818 object = handle(context->global_object(), isolate);
821 ASSIGN_RETURN_ON_EXCEPTION(isolate, value,
822 Object::SetProperty(isolate, object, name, value),
831 HandleScope scope(isolate);
835 Handle<Context> context(isolate->context(), isolate);
837 isolate,
838 StoreLookupSlot(isolate, context, name, value, LanguageMode::kSloppy));
842 HandleScope scope(isolate);
846 Handle<Context> context(isolate->context(), isolate);
848 isolate,
849 StoreLookupSlot(isolate, context, name, value, LanguageMode::kStrict));
855 HandleScope scope(isolate);
861 Handle<Context> declaration_context(isolate->context().declaration_context(),
862 isolate);
864 isolate, StoreLookupSlot(isolate, declaration_context, name, value,
869 HandleScope scope(isolate);
874 Handle<Context> native_context = isolate->native_context();
876 native_context->script_context_table(), isolate);
882 isolate, script_contexts, lookup_result.context_index);