Lines Matching full:thread
27 JSTaggedValue JSIterator::IteratorCloseAndReturn(JSThread *thread, const JSHandle<JSTaggedValue> &i… in IteratorCloseAndReturn() argument
30 ASSERT(thread->HasPendingException()); in IteratorCloseAndReturn()
31 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in IteratorCloseAndReturn()
32 JSTaggedValue exception = thread->GetException(); in IteratorCloseAndReturn()
34 JSHandle<JSTaggedValue>(thread, exception))); in IteratorCloseAndReturn()
35 JSHandle<JSTaggedValue> result = JSIterator::IteratorClose(thread, iter, record); in IteratorCloseAndReturn()
42 JSHandle<JSTaggedValue> JSIterator::GetIterator(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in GetIterator() argument
45 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, obj); in GetIterator()
47 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in GetIterator()
49 JSHandle<JSTaggedValue> func = JSObject::GetMethod(thread, obj, iteratorSymbol); in GetIterator()
50 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, obj); in GetIterator()
52 return GetIterator(thread, obj, func); in GetIterator()
55 JSHandle<JSTaggedValue> JSIterator::GetIterator(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in GetIterator() argument
59 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, obj); in GetIterator()
61 JSTaggedValue ret = JSFunction::Call(thread, method, obj, 0, nullptr); in GetIterator()
62 JSHandle<JSTaggedValue> iter(thread, ret); in GetIterator()
64 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, iter); in GetIterator()
67 JSHandle<JSTaggedValue> undefinedHandle(thread, JSTaggedValue::Undefined()); in GetIterator()
68 THROW_TYPE_ERROR_AND_RETURN(thread, "", undefinedHandle); in GetIterator()
73 JSHandle<JSObject> JSIterator::IteratorNext(JSThread *thread, const JSHandle<JSTaggedValue> &iter) in IteratorNext() argument
76 JSHandle<JSTaggedValue> key(thread->GlobalConstants()->GetHandledNextString()); in IteratorNext()
77 JSHandle<JSTaggedValue> next(JSObject::GetMethod(thread, iter, key)); in IteratorNext()
79 JSTaggedValue ret = JSFunction::Call(thread, next, iter, 0, nullptr); in IteratorNext()
80 JSHandle<JSObject> result(thread, ret); in IteratorNext()
82 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, result); in IteratorNext()
85 THROW_TYPE_ERROR_AND_RETURN(thread, "", result); in IteratorNext()
90 JSHandle<JSObject> JSIterator::IteratorNext(JSThread *thread, const JSHandle<JSTaggedValue> &iter, in IteratorNext() argument
94 JSHandle<JSTaggedValue> key(thread->GlobalConstants()->GetHandledNextString()); in IteratorNext()
95 JSHandle<JSTaggedValue> next(JSObject::GetMethod(thread, iter, key)); in IteratorNext()
97 InternalCallParams *arguments = thread->GetInternalCallParams(); in IteratorNext()
99 JSTaggedValue ret = JSFunction::Call(thread, next, iter, 1, arguments->GetArgv()); in IteratorNext()
101 JSHandle<JSObject> result(thread, ret); in IteratorNext()
103 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, result); in IteratorNext()
106 THROW_TYPE_ERROR_AND_RETURN(thread, "", result); in IteratorNext()
111 bool JSIterator::IteratorComplete(JSThread *thread, const JSHandle<JSTaggedValue> &iterResult) in IteratorComplete() argument
115 JSHandle<JSTaggedValue> doneStr = thread->GlobalConstants()->GetHandledDoneString(); in IteratorComplete()
116 … JSHandle<JSTaggedValue> done = JSTaggedValue::GetProperty(thread, iterResult, doneStr).GetValue(); in IteratorComplete()
120 JSHandle<JSTaggedValue> JSIterator::IteratorValue(JSThread *thread, const JSHandle<JSTaggedValue> &… in IteratorValue() argument
124 JSHandle<JSTaggedValue> valueStr = thread->GlobalConstants()->GetHandledValueString(); in IteratorValue()
125 …JSHandle<JSTaggedValue> value = JSTaggedValue::GetProperty(thread, iterResult, valueStr).GetValue(… in IteratorValue()
129 JSHandle<JSTaggedValue> JSIterator::IteratorStep(JSThread *thread, const JSHandle<JSTaggedValue> &i… in IteratorStep() argument
132 JSHandle<JSTaggedValue> result(IteratorNext(thread, iter)); in IteratorStep()
134 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, result); in IteratorStep()
136 bool done = IteratorComplete(thread, result); in IteratorStep()
138 JSHandle<JSTaggedValue> doneHandle(thread, JSTaggedValue(done)); in IteratorStep()
139 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, doneHandle); in IteratorStep()
142 JSHandle<JSTaggedValue> falseHandle(thread, JSTaggedValue::False()); in IteratorStep()
148 JSHandle<JSTaggedValue> JSIterator::IteratorClose(JSThread *thread, const JSHandle<JSTaggedValue> &… in IteratorClose() argument
153 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in IteratorClose()
155 if (thread->HasPendingException()) { in IteratorClose()
156 exceptionOnThread = JSHandle<JSTaggedValue>(thread, thread->GetException()); in IteratorClose()
157 thread->ClearException(); in IteratorClose()
161 JSHandle<JSTaggedValue> returnFunc(JSObject::GetMethod(thread, iter, returnStr)); in IteratorClose()
163 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, returnFunc); in IteratorClose()
167 thread->SetException(exceptionOnThread.GetTaggedValue()); in IteratorClose()
172 JSTaggedValue ret = JSFunction::Call(thread, returnFunc, iter, 0, nullptr); in IteratorClose()
174 thread->SetException(exceptionOnThread.GetTaggedValue()); in IteratorClose()
176 JSHandle<JSTaggedValue> innerResult(thread, ret); in IteratorClose()
177 JSHandle<CompletionRecord> completionRecord(thread, globalConst->GetUndefined()); in IteratorClose()
184 thread->SetException(exceptionOnThread.GetTaggedValue()); in IteratorClose()
189 if (thread->HasPendingException()) { in IteratorClose()
194 JSHandle<JSTaggedValue> undefinedHandle(thread, JSTaggedValue::Undefined()); in IteratorClose()
195 THROW_TYPE_ERROR_AND_RETURN(thread, "", undefinedHandle); in IteratorClose()
198 thread->SetException(exceptionOnThread.GetTaggedValue()); in IteratorClose()
203 JSHandle<JSObject> JSIterator::CreateIterResultObject(JSThread *thread, const JSHandle<JSTaggedValu… in CreateIterResultObject() argument
205 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CreateIterResultObject()
206 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in CreateIterResultObject()
207 auto globalConst = thread->GlobalConstants(); in CreateIterResultObject()
211 JSHandle<JSTaggedValue> doneValue(thread, JSTaggedValue(done)); in CreateIterResultObject()
216 JSObject::CreateDataPropertyOrThrow(thread, obj, valueStr, value); in CreateIterResultObject()
217 JSObject::CreateDataPropertyOrThrow(thread, obj, doneStr, doneValue); in CreateIterResultObject()
218 ASSERT_NO_ABRUPT_COMPLETION(thread); in CreateIterResultObject()