Home
last modified time | relevance | path

Searched refs:arr (Results 1 – 25 of 32) sorted by relevance

12

/ark/js_runtime/test/moduletest/container/
Dcontainer_arraylist.js19 let arr = new fastarray(); variable
20 arr.add(1);
21 arr.add(2);
22 print(arr[0]);
25 arr["aa"] = 3;
/ark/js_runtime/ecmascript/ic/
Dprofile_type_info.cpp57 JSHandle<TaggedArray> arr(thread_, profileData); in AddHandlerWithoutKey() local
59 uint32_t newLen = arr->GetLength() + step; in AddHandlerWithoutKey()
68 for (; i < arr->GetLength(); i += step) { in AddHandlerWithoutKey()
69 newArr->Set(thread_, i, arr->Get(i)); in AddHandlerWithoutKey()
70 newArr->Set(thread_, i + 1, arr->Get(i + 1)); in AddHandlerWithoutKey()
119 JSHandle<TaggedArray> arr(thread_, patchValue); in AddHandlerWithKey() local
121 if (arr->GetLength() > step) { // POLY in AddHandlerWithKey()
122 uint32_t newLen = arr->GetLength() + step; in AddHandlerWithKey()
132 for (uint32_t i = 0; i < arr->GetLength(); i += step) { in AddHandlerWithKey()
133 newArr->Set(thread_, i + step, arr->Get(i)); in AddHandlerWithKey()
[all …]
Dic_runtime_stub-inl.h389 JSArray *arr = JSArray::Cast(receiver); in StoreElement() local
390 uint32_t oldLength = arr->GetArrayLength(); in StoreElement()
392 arr->SetArrayLength(thread, elementIndex + 1); in StoreElement()
/ark/runtime_core/tests/cts-assembly/
Darrays-06.pa40 # int *arr = new int[n];
42 # arr[i] = 4;
43 # sum += arr[i];
50 # int *arr = new int[n];
52 # arr[i] = 3;
53 # sum += arr[i];
62 # int *arr = new int[n];
64 # arr[i] = 2;
65 # sum += arr[i];
74 # int *arr = new int[n];
[all …]
/ark/ts2abc/ts2panda/src/
DcompilerUtils.ts55 function compileArrayDestructuring(arr: ts.ArrayBindingOrAssignmentPattern, pandaGen: PandaGen, com…
63 let isDeclaration = ts.isArrayBindingPattern(arr) ? true : false;
66 …rator = new Iterator({iterator: iter, nextMethod: nextMethod}, iterDone, iterValue, pandaGen, arr);
83 pandaGen.label(arr, tryBeginLabel);
85 for (let i = 0; i < arr.elements.length; i++) {
86 let element = arr.elements[i];
163 pandaGen.label(arr, tryEndLabel);
165 pandaGen.loadAccumulator(arr, iterator.getCurrrentDone());
167 arr,
174 pandaGen.branch(arr, endLabel);
[all …]
/ark/runtime_core/runtime/tests/
Dtlab_test.cpp91 std::array<int *, ARRAY_SIZE> arr; in TEST_F() local
98 arr[i] = static_cast<int *>(tlab->Alloc(sizeof(int))); in TEST_F()
99 *arr[i] = rand() % std::numeric_limits<int>::max(); in TEST_F()
105 ASSERT_NE(arr[i], nullptr) << "value of i: " << i << ", align: " << align; in TEST_F()
106 ASSERT_EQ(reinterpret_cast<size_t>(arr[i]) & mask, static_cast<size_t>(0)) in TEST_F()
108 …ASSERT_EQ(*arr[i], rand() % std::numeric_limits<int>::max()) << "value of i: " << i << ", align: "… in TEST_F()
Dinternal_allocator_test.cpp98 auto arr = allocator_->New<A[]>(COUNT); in TEST_F() local
99 ASSERT_NE(arr, nullptr); in TEST_F()
100 ASSERT_EQ(ToUintPtr(arr) % DEFAULT_ALIGNMENT_IN_BYTES, 0); in TEST_F()
103 ASSERT_EQ(arr[i - 1].value, i); in TEST_F()
105 allocator_->DeleteArray(arr); in TEST_F()
Dbump_allocator_test.cpp82 std::array<int *, ARRAY_SIZE> arr; in TEST_F() local
89 arr[i] = static_cast<int *>(bp_allocator.Alloc(sizeof(int), align)); in TEST_F()
90 *arr[i] = rand() % std::numeric_limits<int>::max(); in TEST_F()
96 … ASSERT_NE(arr[i], nullptr) << "value of i: " << i << ", align: " << align << ", seed:" << seed_; in TEST_F()
97 ASSERT_EQ(reinterpret_cast<size_t>(arr[i]) & mask, static_cast<size_t>(0)) in TEST_F()
99 ASSERT_EQ(*arr[i], rand() % std::numeric_limits<int>::max()) in TEST_F()
Dmalloc-proxy-allocator-test.cpp69 …std::array<int, 20> arr {{12, 14, 3, 5, 43, 12, 22, 42, 89, 10, 89, 32, 43, 12, 43, 12, 54, 89, 27… in TEST_F() local
72 for (auto i : arr) { in TEST_F()
/ark/runtime_core/libpandabase/tests/
Darena_allocator_test.cpp80 std::array<T *, ARRAY_SIZE> arr; in AllocateWithAlignment() local
87 arr[i] = static_cast<T *>(aa.Alloc(sizeof(T), align)); in AllocateWithAlignment()
88 *arr[i] = rand() % MAX_VALUE<T>(); in AllocateWithAlignment()
94 ASSERT_NE(arr[i], nullptr) << "value of i: " << i << ", align: " << align; in AllocateWithAlignment()
95 …ASSERT_EQ(reinterpret_cast<size_t>(arr[i]) & mask, 0U) << "value of i: " << i << ", align: " << al… in AllocateWithAlignment()
96 … ASSERT_EQ(*arr[i], rand() % MAX_VALUE<T>()) << "value of i: " << i << ", align: " << align; in AllocateWithAlignment()
106 std::array<T *, ARRAY_SIZE> arr; in AllocateWithDiffAlignment() local
113 arr[i] = static_cast<T *>(aa.Alloc(sizeof(T), static_cast<Alignment>(rand_align))); in AllocateWithDiffAlignment()
114 *arr[i] = random_value % MAX_VALUE<T>(); in AllocateWithDiffAlignment()
124 ASSERT_NE(arr[i], nullptr); in AllocateWithDiffAlignment()
[all …]
/ark/js_runtime/ecmascript/builtins/tests/
Dbuiltins_array_test.cpp202 … JSArray *arr = JSArray::Cast(JSArray::ArrayCreate(thread, JSTaggedNumber(0))->GetTaggedObject()); in HWTEST_F_L0() local
203 EXPECT_TRUE(arr != nullptr); in HWTEST_F_L0()
204 JSHandle<JSObject> obj(thread, arr); in HWTEST_F_L0()
251 …JSArray *arr = JSArray::Cast(JSArray::ArrayCreate(thread, JSTaggedNumber(0)).GetTaggedValue().GetT… in HWTEST_F_L0() local
252 EXPECT_TRUE(arr != nullptr); in HWTEST_F_L0()
253 JSHandle<JSObject> obj(thread, arr); in HWTEST_F_L0()
330 …JSArray *arr = JSArray::Cast(JSArray::ArrayCreate(thread, JSTaggedNumber(0)).GetTaggedValue().GetT… in HWTEST_F_L0() local
331 EXPECT_TRUE(arr != nullptr); in HWTEST_F_L0()
332 JSHandle<JSObject> obj(thread, arr); in HWTEST_F_L0()
380 …JSArray *arr = JSArray::Cast(JSArray::ArrayCreate(thread, JSTaggedNumber(0)).GetTaggedValue().GetT… in HWTEST_F_L0() local
[all …]
Dbuiltins_intl_test.cpp91 JSArray *arr = JSArray::ArrayCreate(thread, JSTaggedNumber(0)).GetObject<JSArray>(); in HWTEST_F_L0() local
92 JSHandle<JSTaggedValue> obj(thread, arr); in HWTEST_F_L0()
Dbuiltins_json_test.cpp339 …JSArray *arr = JSArray::Cast(JSArray::ArrayCreate(thread, JSTaggedNumber(0)).GetTaggedValue().GetT… in HWTEST_F_L0() local
341 JSHandle<JSObject> obj1(thread, arr); in HWTEST_F_L0()
383 …JSArray *arr = JSArray::Cast(JSArray::ArrayCreate(thread, JSTaggedNumber(0)).GetTaggedValue().GetT… in HWTEST_F_L0() local
385 EXPECT_TRUE(arr != nullptr); in HWTEST_F_L0()
386 JSHandle<JSObject> obj(thread, arr); in HWTEST_F_L0()
422 …JSArray *arr = JSArray::Cast(JSArray::ArrayCreate(thread, JSTaggedNumber(0)).GetTaggedValue().GetT… in HWTEST_F_L0() local
423 EXPECT_TRUE(arr != nullptr); in HWTEST_F_L0()
424 JSHandle<JSObject> obj(thread, arr); in HWTEST_F_L0()
Dbuiltins_map_test.cpp121 auto arr = JSArray::CreateArrayFromList(thread, internal_array); in HWTEST_F_L0() local
122 array->Set(thread, i, arr); in HWTEST_F_L0()
/ark/js_runtime/ecmascript/tests/
Djs_array_test.cpp61 JSArray *arr = JSArray::ArrayCreate(thread, JSTaggedNumber(0)).GetObject<JSArray>(); in HWTEST_F_L0() local
62 EXPECT_TRUE(arr != nullptr); in HWTEST_F_L0()
63 JSHandle<JSTaggedValue> obj(thread, arr); in HWTEST_F_L0()
75 JSArray *arr = JSArray::ArrayCreate(thread, JSTaggedNumber(0)).GetObject<JSArray>(); in HWTEST_F_L0() local
76 EXPECT_TRUE(arr != nullptr); in HWTEST_F_L0()
77 JSHandle<JSObject> obj(thread, arr); in HWTEST_F_L0()
91 JSArray *arr = JSArray::ArrayCreate(thread, JSTaggedNumber(0)).GetObject<JSArray>(); in HWTEST_F_L0() local
92 EXPECT_TRUE(arr != nullptr); in HWTEST_F_L0()
93 JSHandle<JSTaggedValue> obj(thread, arr); in HWTEST_F_L0()
Dtagged_tree_test.cpp571 JSHandle<TaggedArray> arr = TaggedTreeMap::GetArrayFromMap(thread, tmap); in HWTEST_F_L0() local
572 EXPECT_EQ(arr->GetLength(), NODE_NUMBERS * 2); in HWTEST_F_L0()
575 EXPECT_EQ(tmap->GetKey(arr->Get(i).GetInt()), JSTaggedValue(i)); in HWTEST_F_L0()
580 EXPECT_EQ(tmap->GetKey(arr->Get(NODE_NUMBERS + i).GetInt()), key.GetTaggedValue()); in HWTEST_F_L0()
733 JSHandle<TaggedArray> arr = TaggedTreeSet::GetArrayFromSet(thread, tset); in HWTEST_F_L0() local
734 EXPECT_EQ(arr->GetLength(), NODE_NUMBERS * 2); in HWTEST_F_L0()
737 EXPECT_EQ(tset->GetKey(arr->Get(i).GetInt()), JSTaggedValue(i)); in HWTEST_F_L0()
742 EXPECT_EQ(tset->GetKey(arr->Get(NODE_NUMBERS + i).GetInt()), key.GetTaggedValue()); in HWTEST_F_L0()
986 JSHandle<TaggedArray> arr = TaggedTreeMap::GetArrayFromMap(thread, tmap); in HWTEST_F_L0() local
987 EXPECT_EQ(arr->GetLength(), NODE_NUMBERS * 2); in HWTEST_F_L0()
[all …]
/ark/js_runtime/ecmascript/tooling/test/
Dpt_json_test.cpp141 auto arr = PtJson::CreateArray(); in HWTEST_F_L0() local
142 arr->Push(100); in HWTEST_F_L0()
143 EXPECT_EQ(arr->GetSize(), 1); in HWTEST_F_L0()
152 root->Add("g", arr); in HWTEST_F_L0()
/ark/js_runtime/ecmascript/
Djs_for_in_iterator.cpp195 JSHandle<TaggedArray> arr = JSTaggedValue::GetOwnPropertyKeys(thread, object); in SlowGetAllEnumKeys() local
196 uint32_t len = arr->GetLength(); in SlowGetAllEnumKeys()
198 value.Update(arr->Get(i)); in SlowGetAllEnumKeys()
Druntime_trampolines.cpp205 static JSHandle<TaggedArray> arr = factory->NewTaggedArray(2); in DEF_RUNTIME_TRAMPOLINES() local
207 arr->Set(thread, 0, JSTaggedValue(3.5)); // 3.5: first element in DEF_RUNTIME_TRAMPOLINES()
208 arr->Set(thread, 1, JSTaggedValue(4.5)); // 4.5: second element in DEF_RUNTIME_TRAMPOLINES()
216 LOG_ECMA(INFO) << " arr->GetData() " << std::hex << " " << arr->GetData(); in DEF_RUNTIME_TRAMPOLINES()
218 return arr.GetTaggedValue().GetRawData(); in DEF_RUNTIME_TRAMPOLINES()
Djs_object.cpp190 JSArray *arr = JSArray::Cast(*receiver); in AddElementInternal() local
191 uint32_t oldLength = arr->GetArrayLength(); in AddElementInternal()
196 arr->SetArrayLength(thread, index + 1); in AddElementInternal()
397 JSHandle<TaggedArray> arr(thread, obj->GetElements()); in GetEnumElementKeys() local
398 if (!arr->IsDictionaryMode()) { in GetEnumElementKeys()
399 uint32_t elementsLen = arr->GetLength(); in GetEnumElementKeys()
402 if (!arr->Get(i).IsHole()) { in GetEnumElementKeys()
410 …NumberDictionary::GetAllEnumKeys(thread, JSHandle<NumberDictionary>(arr), elementIndex, elementArr… in GetEnumElementKeys()
/ark/js_runtime/ecmascript/base/
Djson_parser.h314 JSHandle<JSArray> arr = factory_->NewJSArray(); in ParseArray() local
316 return arr.GetTaggedValue(); in ParseArray()
324 … FastRuntimeStub::SetPropertyByIndex<true>(thread_, arr.GetTaggedValue(), index++, value); in ParseArray()
330 return arr.GetTaggedValue(); in ParseArray()
Djson_stringifier.cpp158 JSHandle<JSArray> arr(replacer); in Stringify() local
159 len = arr->GetArrayLength(); in Stringify()
/ark/runtime_core/runtime/mem/
Dobject_helpers.cpp377 auto arr = static_cast<coretypes::Array *>(object); in UpdateDynArray() local
380 … << " from " << std::hex << arr->Get<ObjectHeader *>(index) << " to " << addr; in UpdateDynArray()
386 …ObjectAccessor::SetDynObject<true>(vm->GetAssociatedThread(), arr->GetData(), offset, field_object… in UpdateDynArray()
/ark/runtime_core/isa/
Disapi.rb489 private_class_method def convert_to_hash(arr) argument
490 hash = arr.map { |i| [i.tag, i.description] }.to_h
/ark/js_runtime/ecmascript/class_linker/
Dpanda_file_translator.cpp241 JSHandle<JSArray> arr(JSArray::ArrayCreate(thread_, JSTaggedNumber(length))); in GenerateProgram() local
242 arr->SetElements(thread_, literal); in GenerateProgram()
243 constpool->Set(thread_, value.GetConstpoolIndex(), arr.GetTaggedValue()); in GenerateProgram()

12