Lines Matching defs:array
34 VReg array = pg->AllocReg();
45 // create an empty array first
47 pg->StoreAccumulator(restElement, array);
56 pg->StoreObjByValue(restElement, array, index);
66 pg->LoadAccumulator(restElement, array);
71 static void GenElement(const ir::ArrayExpression *array, DestructuringIterator &iterator, PandaGen *pg)
73 for (const auto *element : array->Elements()) {
77 GenRestElement(pg, element->AsRestElement(), iterator, array->IsDeclaration());
95 auto lref = JSLReference::Create(pg, target, array->IsDeclaration());
114 static void GenArray(PandaGen *pg, const ir::ArrayExpression *array)
116 DestructuringIterator iterator(pg, array);
118 if (array->Elements().empty()) {
125 pg->SetLabel(array, labelSet.TryBegin());
127 GenElement(array, iterator, pg);
129 pg->SetLabel(array, labelSet.TryEnd());
132 pg->LoadAccumulator(array, iterator.Done());
133 pg->BranchIfTrue(array, labelSet.CatchEnd());
136 pg->Branch(array, labelSet.CatchEnd());
139 pg->SetLabel(array, labelSet.CatchBegin());
140 pg->StoreAccumulator(array, iterator.Result());
141 pg->LoadAccumulator(array, iterator.Done());
143 pg->BranchIfTrue(array, end);
144 pg->LoadAccumulator(array, iterator.Result());
146 pg->SetLabel(array, end);
147 pg->LoadAccumulator(array, iterator.Result());
148 pg->EmitThrow(array);
149 pg->SetLabel(array, labelSet.CatchEnd());