/arkcompiler/ets_frontend/es2panda/test/compiler/js/language/arguments-object/ |
D | test-key-named-called-func-bound-value.js | 16 var obj = { variable 99 print(obj[2e3]); // call key 2e3 100 print(obj[2000]); // call key 2e3 101 print(obj[1000]); 103 print(obj[NaN]); 104 print(obj[0]); // 0.0 == 0 105 print(obj[Infinity]); 107 print(obj[1e-6]); 108 print(obj[0.000001]); 109 print(obj[0.000002]); [all …]
|
/arkcompiler/ets_frontend/ets2panda/test/runtime/ets/ |
D | getter_setter.ets | 38 let obj: A = new A(); 40 let h = obj.field; 42 let z = obj.field + obj.field; 44 let u = obj.field + 10; 46 let i = 10 + obj.field; 49 obj.field = 10; 50 let k = obj.field; 53 obj.field = obj.field; 54 k = obj.field; 57 obj.field = obj.field + obj.field; [all …]
|
D | MutatorAccessor.ets | 41 let obj: A = new A(); 43 let get_field = obj.field; 46 get_field = obj.field + obj.field; 49 get_field = obj.field + 10; 52 get_field = 10 + obj.field; 55 obj.field = 10; 56 get_field = obj.field; 59 obj.field = obj.field; 60 get_field = obj.field; 63 obj.field = obj.field + obj.field; [all …]
|
/arkcompiler/runtime_core/static_core/plugins/ets/runtime/intrinsics/ |
D | std_core_Value.cpp | 37 EtsVoid *ValueAPISetFieldObject(EtsObject *obj, EtsLong i, EtsObject *val) in ValueAPISetFieldObject() argument 41 VMHandle<EtsObject> objHandle(coroutine, obj->GetCoreType()); in ValueAPISetFieldObject() 51 void SetFieldValue(EtsObject *obj, EtsLong i, T val) in SetFieldValue() argument 55 VMHandle<EtsObject> objHandle(coroutine, obj->GetCoreType()); in SetFieldValue() 66 EtsVoid *ValueAPISetFieldBoolean(EtsObject *obj, EtsLong i, EtsBoolean val) in ValueAPISetFieldBoolean() argument 68 SetFieldValue(obj, i, val); in ValueAPISetFieldBoolean() 72 EtsVoid *ValueAPISetFieldByte(EtsObject *obj, EtsLong i, EtsByte val) in ValueAPISetFieldByte() argument 74 SetFieldValue(obj, i, val); in ValueAPISetFieldByte() 78 EtsVoid *ValueAPISetFieldShort(EtsObject *obj, EtsLong i, EtsShort val) in ValueAPISetFieldShort() argument 80 SetFieldValue(obj, i, val); in ValueAPISetFieldShort() [all …]
|
/arkcompiler/ets_runtime/test/moduletest/typedarrayat/ |
D | typedarrayat.js | 53 let obj = new ctor(5); 54 obj[0] = 10; 55 obj[1] = 11; 56 obj[2] = 12; 57 obj[3] = 13; 58 obj[4] = 14; 59 result.push(obj.at(-1) == 14); 60 result.push(obj.at(1.5) == 11); 61 result.push(obj.at(-3) == 12); 62 result.push(obj.at("3") == 13) [all …]
|
/arkcompiler/runtime_core/static_core/libpandabase/tests/ |
D | json_parser_test.cpp | 56 JsonObject obj(str); in TEST() local 57 ASSERT_TRUE(obj.IsValid()); in TEST() 59 ASSERT_NE(obj.GetValue<JsonObject::ArrayT>("key_0"), nullptr); in TEST() 60 auto &mainArray = *obj.GetValue<JsonObject::ArrayT>("key_0"); in TEST() 80 ASSERT_NE(obj.GetValue<JsonObject::ArrayT>("key_1"), nullptr); in TEST() 81 auto &emptyArray = *obj.GetValue<JsonObject::ArrayT>("key_1"); in TEST() 105 JsonObject obj(str); in TEST() local 106 ASSERT_TRUE(obj.IsValid()); in TEST() 109 ASSERT_NE(obj.GetValue<JsonObject::StringT>("key_0"), nullptr); in TEST() 110 ASSERT_EQ(*obj.GetValue<JsonObject::StringT>("key_0"), "key_0.value"); in TEST() [all …]
|
/arkcompiler/runtime_core/static_core/plugins/ets/tests/mock/ |
D | calling_methods_test_6.cpp | 40 ets_object obj = env_->AllocObject(dCls); in TEST_F() local 41 ASSERT_NE(obj, nullptr); in TEST_F() 48 …env_->CallNonvirtualVoidMethod(obj, cCls, voidId, static_cast<ets_int>(1), static_cast<ets_int>(12… in TEST_F() 51 EXPECT_EQ(env_->GetIntField(obj, dMemberId), static_cast<ets_int>(0)); in TEST_F() 55 ets_object aObj = env_->CallNonvirtualObjectMethod(obj, cCls, objectId); in TEST_F() 58 EXPECT_EQ(env_->GetIntField(obj, dMemberId), static_cast<ets_int>(0)); in TEST_F() 65 env_->CallNonvirtualVoidMethodArray(obj, cCls, voidId, voidArgs.data()); in TEST_F() 66 EXPECT_EQ(env_->GetIntField(obj, dMemberId), static_cast<ets_int>(0)); in TEST_F() 68 …ets_object aObjFromArrayFunc = env_->CallNonvirtualObjectMethodArray(obj, cCls, objectId, nullptr); in TEST_F() 71 EXPECT_EQ(env_->GetIntField(obj, dMemberId), static_cast<ets_int>(0)); in TEST_F() [all …]
|
D | calling_methods_test_1.cpp | 81 ets_object obj = env_->AllocObject(cls); in TEST_F() local 82 ASSERT_NE(obj, nullptr); in TEST_F() 85 EXPECT_DEATH(env_->CallVoidMethod(obj, nullptr), ""); in TEST_F() 86 EXPECT_DEATH(env_->CallObjectMethod(obj, nullptr), ""); in TEST_F() 87 EXPECT_DEATH(env_->CallBooleanMethod(obj, nullptr), ""); in TEST_F() 88 EXPECT_DEATH(env_->CallByteMethod(obj, nullptr), ""); in TEST_F() 89 EXPECT_DEATH(env_->CallCharMethod(obj, nullptr), ""); in TEST_F() 90 EXPECT_DEATH(env_->CallShortMethod(obj, nullptr), ""); in TEST_F() 91 EXPECT_DEATH(env_->CallIntMethod(obj, nullptr), ""); in TEST_F() 92 EXPECT_DEATH(env_->CallLongMethod(obj, nullptr), ""); in TEST_F() [all …]
|
D | calling_methods_test_helper.h | 33 [[maybe_unused]] static void CallVoidMethodListHelper(EtsEnv *env, ets_object obj, ets_method metho… in CallVoidMethodListHelper() argument 37 env->CallVoidMethodList(obj, methodId, args); in CallVoidMethodListHelper() 40 [[maybe_unused]] static ets_object CallObjectMethodListHelper(EtsEnv *env, ets_object obj, ets_meth… in CallObjectMethodListHelper() argument 44 return env->CallObjectMethodList(obj, methodId, args); in CallObjectMethodListHelper() 47 [[maybe_unused]] static ets_boolean CallBooleanMethodListHelper(EtsEnv *env, ets_object obj, ets_me… in CallBooleanMethodListHelper() argument 51 return env->CallBooleanMethodList(obj, methodId, args); in CallBooleanMethodListHelper() 54 [[maybe_unused]] static ets_byte CallByteMethodListHelper(EtsEnv *env, ets_object obj, ets_method m… in CallByteMethodListHelper() argument 58 return env->CallByteMethodList(obj, methodId, args); in CallByteMethodListHelper() 61 [[maybe_unused]] static ets_char CallCharMethodListHelper(EtsEnv *env, ets_object obj, ets_method m… in CallCharMethodListHelper() argument 65 return env->CallCharMethodList(obj, methodId, args); in CallCharMethodListHelper() [all …]
|
D | calling_methods_test_2.cpp | 39 ets_object obj = env_->AllocObject(cls); in TEST_F() local 40 ASSERT_NE(obj, nullptr); in TEST_F() 89 ets_object obj = env_->AllocObject(cls); in TEST_F() local 90 ASSERT_NE(obj, nullptr); in TEST_F() 114 env_->CallVoidMethod(obj, voidId, static_cast<ets_int>(42_I), static_cast<ets_int>(121_I)); in TEST_F() 118 ets_object aObj = env_->CallObjectMethod(obj, objectId); in TEST_F() 122 …EXPECT_EQ(env_->CallBooleanMethod(obj, booleanId, static_cast<ets_boolean>(1), static_cast<ets_int… in TEST_F() 124 …EXPECT_EQ(env_->CallByteMethod(obj, byteId, static_cast<ets_byte>(1), static_cast<ets_int>(121_I)), in TEST_F() 126 …EXPECT_EQ(env_->CallCharMethod(obj, charId, static_cast<ets_char>(1), static_cast<ets_int>(121_I)), in TEST_F() 128 …EXPECT_EQ(env_->CallShortMethod(obj, shortId, static_cast<ets_short>(1), static_cast<ets_int>(121_… in TEST_F() [all …]
|
/arkcompiler/ets_runtime/ecmascript/ |
D | js_tagged_value.cpp | 628 OperationResult JSTaggedValue::GetProperty(JSThread *thread, const JSHandle<JSTaggedValue> &obj, in GetProperty() argument 631 if (obj->IsUndefined() || obj->IsNull() || obj->IsHole()) { in GetProperty() 633 std::string objStr = EcmaStringAccessor(ToString(thread, obj)).ToStdString(); in GetProperty() 641 if (obj->IsJSProxy()) { in GetProperty() 642 return JSProxy::GetProperty(thread, JSHandle<JSProxy>(obj), key); in GetProperty() 644 if (obj->IsTypedArray()) { in GetProperty() 645 return JSTypedArray::GetProperty(thread, obj, key); in GetProperty() 647 if (obj->IsModuleNamespace()) { in GetProperty() 648 return ModuleNamespace::GetProperty(thread, obj, key); in GetProperty() 651 if (obj->IsSpecialContainer()) { in GetProperty() [all …]
|
D | subtyping_operator-inl.h | 23 int SubtypingOperator::GetElementByKey(const JSThread *thread, T *obj, JSTaggedValue key) in GetElementByKey() argument 26 return obj->GetElementIndexByKey(key); in GetElementByKey() 28 return obj->GetTupleIndexByName(key); in GetElementByKey() 30 LayoutInfo *objLayout = LayoutInfo::Cast(obj->GetLayout().GetTaggedObject()); in GetElementByKey() 31 return objLayout->FindElementWithCache(thread, obj, key, obj->NumberOfProps()); in GetElementByKey() 37 bool SubtypingOperator::IsLegalElement(const JSThread *thread, T *obj, JSTaggedValue key, JSTaggedV… in IsLegalElement() argument 42 int index = obj->GetElementIndexByKey(key); in IsLegalElement() 43 if (index != -1 && obj->GetTypeId(index) != expectedType) { in IsLegalElement() 47 int index = obj->GetTupleIndexByName(key); in IsLegalElement() 52 if (obj->IsAccessor(index) != isAccessor) { in IsLegalElement() [all …]
|
/arkcompiler/runtime_core/static_core/pandastdlib/ |
D | pandastdlib.pa | 155 lda.obj a1 156 stobj.obj a0, panda.StackOverflowException.message 157 lda.obj a2 158 stobj.obj a0, panda.StackOverflowException.cause 163 ldobj.obj a0, panda.StackOverflowException.message 164 return.obj 168 ldobj.obj a0, panda.StackOverflowException.cause 169 return.obj 173 lda.obj a1 174 stobj.obj a0, panda.NullPointerException.message [all …]
|
/arkcompiler/ets_runtime/ecmascript/compiler/builtins/ |
D | containers_stub_builder.h | 79 GateRef IsContainer(GateRef obj, ContainersType type) in IsContainer() argument 84 return IsJSAPIVector(obj); in IsContainer() 86 return IsJSAPIStack(obj); in IsContainer() 88 return IsJSAPIPlainArray(obj); in IsContainer() 90 return IsJSAPIQueue(obj); in IsContainer() 92 return IsJSAPIDeque(obj); in IsContainer() 94 return IsJSAPILightWeightMap(obj); in IsContainer() 96 return IsJSAPILightWeightSet(obj); in IsContainer() 98 return IsJSAPIHashMap(obj); in IsContainer() 100 return IsJSAPIHashSet(obj); in IsContainer() [all …]
|
/arkcompiler/runtime_core/static_core/runtime/include/ |
D | object_accessor-inl.h | 30 inline ObjectHeader *ObjectAccessor::GetObject(const void *obj, size_t offset) in GetObject() argument 34 return reinterpret_cast<ObjectHeader *>(Get<ObjectPointerType, IS_VOLATILE>(obj, offset)); in GetObject() 36 return Get<ObjectHeader *, IS_VOLATILE>(obj, offset); in GetObject() 41 inline void ObjectAccessor::SetObject(void *obj, size_t offset, ObjectHeader *value) in SetObject() argument 47 ObjectHeader *preVal = GetObject<IS_VOLATILE, false, IS_DYN>(obj, offset); in SetObject() 52 Set<ObjectPointerType, IS_VOLATILE>(obj, offset, ToObjPtrType(value)); in SetObject() 54 Set<ObjectHeader *, IS_VOLATILE>(obj, offset, value); in SetObject() 58 barrierSet->PostBarrier(ToVoidPtr(ToUintPtr(obj)), offset, value); in SetObject() 62 Set<ObjectPointerType, IS_VOLATILE>(obj, offset, ToObjPtrType(value)); in SetObject() 64 Set<ObjectHeader *, IS_VOLATILE>(obj, offset, value); in SetObject() [all …]
|
D | object_accessor.h | 31 static T GetPrimitive(const void *obj, size_t offset) in GetPrimitive() argument 33 return Get<T, IS_VOLATILE>(obj, offset); in GetPrimitive() 37 static void SetPrimitive(void *obj, size_t offset, T value) in SetPrimitive() argument 39 Set<T, IS_VOLATILE>(obj, offset, value); in SetPrimitive() 43 static ObjectHeader *GetObject(const void *obj, size_t offset); 46 static void SetObject(void *obj, size_t offset, ObjectHeader *value); 49 static T GetFieldPrimitive(const void *obj, const Field &field); 52 static void SetFieldPrimitive(void *obj, const Field &field, T value); 55 static ObjectHeader *GetFieldObject(const void *obj, const Field &field); 58 static void SetFieldObject(void *obj, const Field &field, ObjectHeader *value); [all …]
|
/arkcompiler/runtime_core/pandastdlib/ |
D | pandastdlib.pa | 149 lda.obj a1 150 stobj.obj a0, panda.StackOverflowException.message 151 lda.obj a2 152 stobj.obj a0, panda.StackOverflowException.cause 157 lda.obj a1 158 stobj.obj a0, panda.NullPointerException.message 159 lda.obj a2 160 stobj.obj a0, panda.NullPointerException.cause 165 ldobj.obj a0, panda.NullPointerException.message 166 return.obj [all …]
|
/arkcompiler/runtime_core/libpandabase/tests/ |
D | json_parser_test.cpp | 40 ASSERT_EQ(obj.GetValue<JsonObject::StringT>("key_2"), nullptr); 57 JsonObject obj(str); 58 ASSERT_TRUE(obj.IsValid()); 60 ASSERT_NE(obj.GetValue<JsonObject::ArrayT>("key_0"), nullptr); 61 auto &main_array = *obj.GetValue<JsonObject::ArrayT>("key_0"); 81 ASSERT_NE(obj.GetValue<JsonObject::ArrayT>("key_1"), nullptr); 82 auto &empty_array = *obj.GetValue<JsonObject::ArrayT>("key_1"); 105 JsonObject obj(str); 106 ASSERT_TRUE(obj.IsValid()); 109 ASSERT_NE(obj.GetValue<JsonObject::StringT>("key_0"), nullptr); [all …]
|
/arkcompiler/ets_runtime/ecmascript/builtins/ |
D | builtins_lazy_callback.h | 53 static JSTaggedValue Date(JSThread *thread, const JSHandle<JSObject> &obj); 54 static JSTaggedValue Set(JSThread *thread, const JSHandle<JSObject> &obj); 55 static JSTaggedValue Map(JSThread *thread, const JSHandle<JSObject> &obj); 56 static JSTaggedValue WeakMap(JSThread *thread, const JSHandle<JSObject> &obj); 57 static JSTaggedValue WeakSet(JSThread *thread, const JSHandle<JSObject> &obj); 58 static JSTaggedValue WeakRef(JSThread *thread, const JSHandle<JSObject> &obj); 59 static JSTaggedValue FinalizationRegistry(JSThread *thread, const JSHandle<JSObject> &obj); 60 static JSTaggedValue TypedArray(JSThread *thread, const JSHandle<JSObject> &obj); 61 static JSTaggedValue Int8Array(JSThread *thread, const JSHandle<JSObject> &obj); 62 static JSTaggedValue Uint8Array(JSThread *thread, const JSHandle<JSObject> &obj); [all …]
|
/arkcompiler/runtime_core/static_core/verification/util/ |
D | synchronized.h | 35 obj = other.obj; in ConstProxy() 36 other.obj = nullptr; in ConstProxy() 38 const Synchronized *obj; // NOLINT(misc-non-private-member-variables-in-classes) member 39 … explicit ConstProxy(const Synchronized *paramObj) ACQUIRE_SHARED(obj->rwLock_) : obj {paramObj} in ConstProxy() 41 obj->rwLock_.ReadLock(); 45 ASSERT(obj != nullptr); 46 return &obj->c_; 48 ~ConstProxy() RELEASE_SHARED(obj->rwLock_) 50 if (obj != nullptr) { 51 obj->rwLock_.Unlock(); [all …]
|
/arkcompiler/runtime_core/static_core/compiler/optimizer/optimizations/ |
D | vn.cpp | 37 static bool AddClassInst(Inst *inst, VnObject *obj) in AddClassInst() argument 44 obj->Add(static_cast<VnObject::ObjType>(Opcode::InitClass)); in AddClassInst() 48 obj->Add(classInst->GetTypeId()); in AddClassInst() 50 obj->Add(reinterpret_cast<VnObject::DoubleObjType>(klass)); in AddClassInst() 52 inst->SetVnObject(obj); in AddClassInst() 56 static bool AddGlobalVarInst(Inst *inst, VnObject *obj) in AddGlobalVarInst() argument 62 obj->Add(static_cast<VnObject::ObjType>(Opcode::GetGlobalVarAddress)); in AddGlobalVarInst() 63 obj->Add(inst->CastToGetGlobalVarAddress()->GetTypeId()); in AddGlobalVarInst() 64 inst->SetVnObject(obj); in AddGlobalVarInst() 68 static bool AddSelectImmInst(Inst *inst, VnObject *obj) in AddSelectImmInst() argument [all …]
|
/arkcompiler/ets_runtime/test/moduletest/builtins/ |
D | builtinsir.js | 61 var obj = { variable 66 print(obj.number(1)); 67 print(obj.number(1, 2)); 68 print(obj.number(1, 2, 3)); 69 print(obj.number(1, 2, 3, 4)); 70 print(obj.number([1])); 71 print(obj.number([1, 2])); 72 obj.date(0); 73 obj.date(0, 1); 74 obj.date(0, 1, 2); [all …]
|
/arkcompiler/ets_runtime/test/moduletest/stringfromcharcode/ |
D | stringfromcharcode.js | 30 var obj = {}; variable 31 obj[str1] = 'jjj1'; 32 obj[str2] = 'jjj2'; 33 obj[str3] = 'jjj3'; 34 print(obj[8]); 35 print(obj.Z); 36 print(obj.q); 42 obj[str5.charAt(4)] = 'jjj4'; 43 print(obj.k);
|
/arkcompiler/runtime_core/static_core/plugins/ets/tests/lookup_by_name/ |
D | correct_case_ref_2.pa | 37 stobj.obj v0, escompat.NoSuchFieldError.message 38 lda.obj v0 39 return.obj 43 ldobj.v.obj v0, a0, C.foo 44 ldobj.obj a1, escompat.Error.message 45 stobj.obj v0, escompat.NoSuchFieldError.message 53 ets.ldobj.name.obj a0, baz 54 sta.obj v0 55 ldobj.v.obj v1, v0, escompat.NoSuchFieldError.message 57 sta.obj v2 [all …]
|
/arkcompiler/runtime_core/static_core/plugins/ets/runtime/napi/ |
D | ets_scoped_objects_fix.h | 63 EtsObject *ToInternalType(ets_object obj) in ToInternalType() argument 65 RETURN_NULL_IF_NULL(obj); in ToInternalType() 66 return GetInternalType(env_, obj); in ToInternalType() 94 T *Convert(ets_object obj) in Convert() argument 96 return Convert<T>(env_, obj); in Convert() 100 static T *Convert(PandaEtsNapiEnv *env, ets_object obj) in Convert() argument 102 return reinterpret_cast<T *>(GetInternalType(env, obj)); in Convert() 115 ets_object AddGlobalRef(EtsObject *obj) in AddGlobalRef() argument 117 … EtsReference *ref = GetEtsReferenceStorage()->NewEtsRef(obj, EtsReference::EtsObjectType::GLOBAL); in AddGlobalRef() 121 ets_object AddLocalRef(EtsObject *obj) in AddLocalRef() argument [all …]
|