Lines Matching full:thread
23 JSTaggedValue JSIterator::IteratorCloseAndReturn(JSThread *thread, const JSHandle<JSTaggedValue> &i… in IteratorCloseAndReturn() argument
25 ASSERT(thread->HasPendingException()); in IteratorCloseAndReturn()
26 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in IteratorCloseAndReturn()
27 JSTaggedValue exception = thread->GetException(); in IteratorCloseAndReturn()
29 JSHandle<JSTaggedValue>(thread, exception))); in IteratorCloseAndReturn()
30 JSHandle<JSTaggedValue> result = JSIterator::IteratorClose(thread, iter, record); in IteratorCloseAndReturn()
31 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IteratorCloseAndReturn()
38 JSHandle<JSTaggedValue> JSIterator::GetIterator(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in GetIterator() argument
41 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, obj); in GetIterator()
43 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in GetIterator()
45 JSHandle<JSTaggedValue> func = JSObject::GetMethod(thread, obj, iteratorSymbol); in GetIterator()
46 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, obj); in GetIterator()
48 return GetIterator(thread, obj, func); in GetIterator()
51 JSHandle<JSTaggedValue> JSIterator::GetIterator(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in GetIterator() argument
55 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, obj); in GetIterator()
57 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in GetIterator()
58 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, method, obj, undefined, 0); in GetIterator()
60 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in GetIterator()
61 JSHandle<JSTaggedValue> iter(thread, ret); in GetIterator()
64 … THROW_TYPE_ERROR_AND_RETURN(thread, "JSIterator::GetIterator: iter is not object", undefined); in GetIterator()
69 JSHandle<JSTaggedValue> JSIterator::GetAsyncIterator(JSThread *thread, const JSHandle<JSTaggedValue… in GetAsyncIterator() argument
72 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in GetAsyncIterator()
73 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in GetAsyncIterator()
77 JSHandle<JSTaggedValue> method = JSObject::GetMethod(thread, obj, asynciteratorSymbol); in GetAsyncIterator()
78 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, obj); in GetAsyncIterator()
81 JSHandle<JSTaggedValue> func = JSObject::GetMethod(thread, obj, iteratorSymbol); in GetAsyncIterator()
82 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in GetAsyncIterator()
83 JSHandle<JSTaggedValue> syncIterator = GetIterator(thread, obj, func); in GetAsyncIterator()
84 JSHandle<JSTaggedValue> nextStr = thread->GlobalConstants()->GetHandledNextString(); in GetAsyncIterator()
85 …JSHandle<JSTaggedValue> nextMethod = JSTaggedValue::GetProperty(thread, syncIterator, nextStr).Get… in GetAsyncIterator()
86 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in GetAsyncIterator()
90 JSAsyncFromSyncIterator::CreateAsyncFromSyncIterator(thread, syncIteratorRecord); in GetAsyncIterator()
91 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in GetAsyncIterator()
96 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in GetAsyncIterator()
97 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, method, obj, undefined, 0); in GetAsyncIterator()
99 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in GetAsyncIterator()
100 JSHandle<JSTaggedValue> iterator(thread, ret); in GetAsyncIterator()
103 THROW_TYPE_ERROR_AND_RETURN(thread, "Is not object", undefined); in GetAsyncIterator()
110 JSHandle<JSTaggedValue> JSIterator::IteratorNext(JSThread *thread, const JSHandle<JSTaggedValue> &i… in IteratorNext() argument
112 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in IteratorNext()
116 JSHandle<JSTaggedValue> next(JSObject::GetMethod(thread, iter, key)); in IteratorNext()
117 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in IteratorNext()
119 … EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, next, iter, undefined, 0); in IteratorNext()
122 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, undefined); in IteratorNext()
125 THROW_TYPE_ERROR_AND_RETURN(thread, "Is not Object", undefined); in IteratorNext()
127 JSHandle<JSTaggedValue> result(thread, ret); in IteratorNext()
131 JSHandle<JSTaggedValue> JSIterator::IteratorNext(JSThread *thread, const JSHandle<JSTaggedValue> &i… in IteratorNext() argument
134 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in IteratorNext()
137 JSHandle<JSTaggedValue> next(JSObject::GetMethod(thread, iter, key)); in IteratorNext()
138 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in IteratorNext()
140 … EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, next, iter, undefined, 1); in IteratorNext()
141 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, undefined); in IteratorNext()
145 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, undefined); in IteratorNext()
148 THROW_TYPE_ERROR_AND_RETURN(thread, "Is not Object", undefined); in IteratorNext()
150 JSHandle<JSTaggedValue> result(thread, ret); in IteratorNext()
154 JSHandle<JSTaggedValue> JSIterator::IteratorNext(JSThread *thread, const JSHandle<AsyncIteratorReco… in IteratorNext() argument
157 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in IteratorNext()
159 JSHandle<JSTaggedValue> iterator(thread, iter->GetIterator()); in IteratorNext()
160 JSHandle<JSTaggedValue> next(thread, iter->GetNextMethod()); in IteratorNext()
162 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, next, iterator, undefined,… in IteratorNext()
163 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, undefined); in IteratorNext()
167 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, undefined); in IteratorNext()
170 THROW_TYPE_ERROR_AND_RETURN(thread, "Is not Object", undefined); in IteratorNext()
172 JSHandle<JSTaggedValue> result(thread, ret); in IteratorNext()
176 JSHandle<JSTaggedValue> JSIterator::IteratorNext(JSThread *thread, const JSHandle<AsyncIteratorReco… in IteratorNext() argument
178 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in IteratorNext()
180 JSHandle<JSTaggedValue> iterator(thread, iter->GetIterator()); in IteratorNext()
181 JSHandle<JSTaggedValue> next(thread, iter->GetNextMethod()); in IteratorNext()
183 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, next, iterator, undefined,… in IteratorNext()
186 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, undefined); in IteratorNext()
189 THROW_TYPE_ERROR_AND_RETURN(thread, "Is not Object", undefined); in IteratorNext()
191 JSHandle<JSTaggedValue> result(thread, ret); in IteratorNext()
195 bool JSIterator::IteratorComplete(JSThread *thread, const JSHandle<JSTaggedValue> &iterResult) in IteratorComplete() argument
199 JSHandle<JSTaggedValue> doneStr = thread->GlobalConstants()->GetHandledDoneString(); in IteratorComplete()
200 … JSHandle<JSTaggedValue> done = JSTaggedValue::GetProperty(thread, iterResult, doneStr).GetValue(); in IteratorComplete()
201 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in IteratorComplete()
205 JSHandle<JSTaggedValue> JSIterator::IteratorValue(JSThread *thread, const JSHandle<JSTaggedValue> &… in IteratorValue() argument
209 JSHandle<JSTaggedValue> valueStr = thread->GlobalConstants()->GetHandledValueString(); in IteratorValue()
210 …JSHandle<JSTaggedValue> value = JSTaggedValue::GetProperty(thread, iterResult, valueStr).GetValue(… in IteratorValue()
211 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in IteratorValue()
215 JSHandle<JSTaggedValue> JSIterator::IteratorStep(JSThread *thread, const JSHandle<JSTaggedValue> &i… in IteratorStep() argument
218 JSHandle<JSTaggedValue> result = IteratorNext(thread, iter); in IteratorStep()
220 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, result); in IteratorStep()
222 bool done = IteratorComplete(thread, result); in IteratorStep()
224 JSHandle<JSTaggedValue> doneHandle(thread, JSTaggedValue(done)); in IteratorStep()
225 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, doneHandle); in IteratorStep()
228 JSHandle<JSTaggedValue> falseHandle(thread, JSTaggedValue::False()); in IteratorStep()
234 JSHandle<JSTaggedValue> JSIterator::IteratorClose(JSThread *thread, const JSHandle<JSTaggedValue> &… in IteratorClose() argument
239 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in IteratorClose()
241 if (thread->HasPendingException()) { in IteratorClose()
242 exceptionOnThread = JSHandle<JSTaggedValue>(thread, thread->GetException()); in IteratorClose()
243 thread->ClearException(); in IteratorClose()
247 …JSTaggedValue func = ObjectFastOperator::FastGetPropertyByName(thread, iter.GetTaggedValue(), retu… in IteratorClose()
249 JSHandle<JSTaggedValue> returnFunc(thread, func); in IteratorClose()
250 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, returnFunc); in IteratorClose()
255 thread->SetException(exceptionOnThread.GetTaggedValue()); in IteratorClose()
261 THROW_TYPE_ERROR_AND_RETURN(thread, "return function is not Callable", returnFunc); in IteratorClose()
265 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, returnFunc, iter, undefine… in IteratorClose()
267 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in IteratorClose()
269 thread->SetException(exceptionOnThread.GetTaggedValue()); in IteratorClose()
271 JSHandle<JSTaggedValue> innerResult(thread, ret); in IteratorClose()
272 JSHandle<CompletionRecord> completionRecord(thread, globalConst->GetUndefined()); in IteratorClose()
279 thread->SetException(exceptionOnThread.GetTaggedValue()); in IteratorClose()
284 if (thread->HasPendingException()) { in IteratorClose()
289 THROW_TYPE_ERROR_AND_RETURN(thread, "Is not object", undefined); in IteratorClose()
292 thread->SetException(exceptionOnThread.GetTaggedValue()); in IteratorClose()
297 JSHandle<JSObject> JSIterator::CreateIterResultObject(JSThread *thread, const JSHandle<JSTaggedValu… in CreateIterResultObject() argument
299 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CreateIterResultObject()
300 auto globalConst = thread->GlobalConstants(); in CreateIterResultObject()
308 thread, value.GetTaggedValue()); in CreateIterResultObject()
310 thread, JSTaggedValue(done)); in CreateIterResultObject()