Lines Matching full:thread
29 JSTaggedValue JSIterator::IteratorCloseAndReturn(JSThread *thread, const JSHandle<JSTaggedValue> &i… in IteratorCloseAndReturn() argument
31 ASSERT(thread->HasPendingException()); in IteratorCloseAndReturn()
32 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in IteratorCloseAndReturn()
33 JSTaggedValue exception = thread->GetException(); in IteratorCloseAndReturn()
35 JSHandle<JSTaggedValue>(thread, exception))); in IteratorCloseAndReturn()
36 JSHandle<JSTaggedValue> result = JSIterator::IteratorClose(thread, iter, record); in IteratorCloseAndReturn()
43 JSHandle<JSTaggedValue> JSIterator::GetIterator(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in GetIterator() argument
46 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, obj); in GetIterator()
48 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in GetIterator()
50 JSHandle<JSTaggedValue> func = JSObject::GetMethod(thread, obj, iteratorSymbol); in GetIterator()
51 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, obj); in GetIterator()
53 return GetIterator(thread, obj, func); in GetIterator()
56 JSHandle<JSTaggedValue> JSIterator::GetIterator(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in GetIterator() argument
60 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, obj); in GetIterator()
62 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in GetIterator()
63 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, method, obj, undefined, 0); in GetIterator()
65 JSHandle<JSTaggedValue> iter(thread, ret); in GetIterator()
67 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, iter); in GetIterator()
70 THROW_TYPE_ERROR_AND_RETURN(thread, "", undefined); in GetIterator()
75 JSHandle<JSTaggedValue> JSIterator::GetAsyncIterator(JSThread *thread, const JSHandle<JSTaggedValue… in GetAsyncIterator() argument
78 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in GetAsyncIterator()
79 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in GetAsyncIterator()
83 JSHandle<JSTaggedValue> method = JSObject::GetMethod(thread, obj, asynciteratorSymbol); in GetAsyncIterator()
84 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, obj); in GetAsyncIterator()
87 JSHandle<JSTaggedValue> func = JSObject::GetMethod(thread, obj, iteratorSymbol); in GetAsyncIterator()
88 JSHandle<JSTaggedValue> syncIterator = GetIterator(thread, obj, func); in GetAsyncIterator()
89 JSHandle<JSTaggedValue> nextStr = thread->GlobalConstants()->GetHandledNextString(); in GetAsyncIterator()
90 …JSHandle<JSTaggedValue> nextMethod = JSTaggedValue::GetProperty(thread, syncIterator, nextStr).Get… in GetAsyncIterator()
94 JSAsyncFromSyncIterator::CreateAsyncFromSyncIterator(thread, syncIteratorRecord); in GetAsyncIterator()
99 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in GetAsyncIterator()
100 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, method, obj, undefined, 0); in GetAsyncIterator()
102 JSHandle<JSTaggedValue> iterator(thread, ret); in GetAsyncIterator()
105 THROW_TYPE_ERROR_AND_RETURN(thread, "", undefined); in GetAsyncIterator()
112 JSHandle<JSTaggedValue> JSIterator::IteratorNext(JSThread *thread, const JSHandle<JSTaggedValue> &i… in IteratorNext() argument
114 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in IteratorNext()
118 JSHandle<JSTaggedValue> next(JSObject::GetMethod(thread, iter, key)); in IteratorNext()
120 … EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, next, iter, undefined, 0); in IteratorNext()
123 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, undefined); in IteratorNext()
126 THROW_TYPE_ERROR_AND_RETURN(thread, "Is not Object", undefined); in IteratorNext()
128 JSHandle<JSTaggedValue> result(thread, ret); in IteratorNext()
132 JSHandle<JSTaggedValue> JSIterator::IteratorNext(JSThread *thread, const JSHandle<JSTaggedValue> &i… in IteratorNext() argument
135 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in IteratorNext()
138 JSHandle<JSTaggedValue> next(JSObject::GetMethod(thread, iter, key)); in IteratorNext()
140 … EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, next, iter, undefined, 1); in IteratorNext()
144 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, undefined); in IteratorNext()
147 THROW_TYPE_ERROR_AND_RETURN(thread, "Is not Object", undefined); in IteratorNext()
149 JSHandle<JSTaggedValue> result(thread, ret); in IteratorNext()
153 JSHandle<JSTaggedValue> JSIterator::IteratorNext(JSThread *thread, const JSHandle<AsyncIteratorReco… in IteratorNext() argument
156 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in IteratorNext()
158 JSHandle<JSTaggedValue> iterator(thread, iter->GetIterator()); in IteratorNext()
159 JSHandle<JSTaggedValue> next(thread, iter->GetNextMethod()); in IteratorNext()
161 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, next, iterator, undefined,… in IteratorNext()
165 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, undefined); in IteratorNext()
168 THROW_TYPE_ERROR_AND_RETURN(thread, "Is not Object", undefined); in IteratorNext()
170 JSHandle<JSTaggedValue> result(thread, ret); in IteratorNext()
174 JSHandle<JSTaggedValue> JSIterator::IteratorNext(JSThread *thread, const JSHandle<AsyncIteratorReco… in IteratorNext() argument
176 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in IteratorNext()
178 JSHandle<JSTaggedValue> iterator(thread, iter->GetIterator()); in IteratorNext()
179 JSHandle<JSTaggedValue> next(thread, iter->GetNextMethod()); in IteratorNext()
181 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, next, iterator, undefined,… in IteratorNext()
184 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, undefined); in IteratorNext()
187 THROW_TYPE_ERROR_AND_RETURN(thread, "Is not Object", undefined); in IteratorNext()
189 JSHandle<JSTaggedValue> result(thread, ret); in IteratorNext()
193 bool JSIterator::IteratorComplete(JSThread *thread, const JSHandle<JSTaggedValue> &iterResult) in IteratorComplete() argument
197 JSHandle<JSTaggedValue> doneStr = thread->GlobalConstants()->GetHandledDoneString(); in IteratorComplete()
198 … JSHandle<JSTaggedValue> done = JSTaggedValue::GetProperty(thread, iterResult, doneStr).GetValue(); in IteratorComplete()
199 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in IteratorComplete()
203 JSHandle<JSTaggedValue> JSIterator::IteratorValue(JSThread *thread, const JSHandle<JSTaggedValue> &… in IteratorValue() argument
207 JSHandle<JSTaggedValue> valueStr = thread->GlobalConstants()->GetHandledValueString(); in IteratorValue()
208 …JSHandle<JSTaggedValue> value = JSTaggedValue::GetProperty(thread, iterResult, valueStr).GetValue(… in IteratorValue()
212 JSHandle<JSTaggedValue> JSIterator::IteratorStep(JSThread *thread, const JSHandle<JSTaggedValue> &i… in IteratorStep() argument
215 JSHandle<JSTaggedValue> result = IteratorNext(thread, iter); in IteratorStep()
217 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, result); in IteratorStep()
219 bool done = IteratorComplete(thread, result); in IteratorStep()
221 JSHandle<JSTaggedValue> doneHandle(thread, JSTaggedValue(done)); in IteratorStep()
222 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, doneHandle); in IteratorStep()
225 JSHandle<JSTaggedValue> falseHandle(thread, JSTaggedValue::False()); in IteratorStep()
231 JSHandle<JSTaggedValue> JSIterator::IteratorClose(JSThread *thread, const JSHandle<JSTaggedValue> &… in IteratorClose() argument
236 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in IteratorClose()
238 if (thread->HasPendingException()) { in IteratorClose()
239 exceptionOnThread = JSHandle<JSTaggedValue>(thread, thread->GetException()); in IteratorClose()
240 thread->ClearException(); in IteratorClose()
244 …JSTaggedValue func = ObjectFastOperator::FastGetPropertyByName(thread, iter.GetTaggedValue(), retu… in IteratorClose()
246 JSHandle<JSTaggedValue> returnFunc(thread, func); in IteratorClose()
247 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, returnFunc); in IteratorClose()
252 thread->SetException(exceptionOnThread.GetTaggedValue()); in IteratorClose()
258 THROW_TYPE_ERROR_AND_RETURN(thread, "return function is not Callable", returnFunc); in IteratorClose()
262 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, returnFunc, iter, undefine… in IteratorClose()
265 thread->SetException(exceptionOnThread.GetTaggedValue()); in IteratorClose()
267 JSHandle<JSTaggedValue> innerResult(thread, ret); in IteratorClose()
268 JSHandle<CompletionRecord> completionRecord(thread, globalConst->GetUndefined()); in IteratorClose()
275 thread->SetException(exceptionOnThread.GetTaggedValue()); in IteratorClose()
280 if (thread->HasPendingException()) { in IteratorClose()
285 THROW_TYPE_ERROR_AND_RETURN(thread, "", undefined); in IteratorClose()
288 thread->SetException(exceptionOnThread.GetTaggedValue()); in IteratorClose()
293 JSHandle<JSObject> JSIterator::CreateIterResultObject(JSThread *thread, const JSHandle<JSTaggedValu… in CreateIterResultObject() argument
295 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CreateIterResultObject()
296 auto globalConst = thread->GlobalConstants(); in CreateIterResultObject()
303 obj->SetPropertyInlinedProps(thread, VALUE_INLINE_PROPERTY_INDEX, value.GetTaggedValue()); in CreateIterResultObject()
304 obj->SetPropertyInlinedProps(thread, DONE_INLINE_PROPERTY_INDEX, JSTaggedValue(done)); in CreateIterResultObject()