diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/compiler_llvm/art_module.ll | 24 | ||||
| -rw-r--r-- | src/compiler_llvm/generated/art_module.cc | 121 | ||||
| -rw-r--r-- | src/compiler_llvm/method_compiler.cc | 17 | ||||
| -rw-r--r-- | src/compiler_llvm/runtime_support_llvm.cc | 72 |
4 files changed, 134 insertions, 100 deletions
diff --git a/src/compiler_llvm/art_module.ll b/src/compiler_llvm/art_module.ll index 6f7fdfb5a1..35f99f797e 100644 --- a/src/compiler_llvm/art_module.ll +++ b/src/compiler_llvm/art_module.ll @@ -70,33 +70,33 @@ declare i32 @art_find_catch_block_from_code(%JavaObject*, i32) ; Object Space ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -declare %JavaObject* @art_alloc_object_from_code(i32, %JavaObject*) +declare %JavaObject* @art_alloc_object_from_code(i32, %JavaObject*, %JavaObject*) declare %JavaObject* @art_alloc_object_from_code_with_access_check( - i32, %JavaObject*) + i32, %JavaObject*, %JavaObject*) -declare %JavaObject* @art_alloc_array_from_code(i32, %JavaObject*, i32) +declare %JavaObject* @art_alloc_array_from_code(i32, %JavaObject*, i32, %JavaObject*) declare %JavaObject* @art_alloc_array_from_code_with_access_check( - i32, %JavaObject*, i32) + i32, %JavaObject*, i32, %JavaObject*) declare %JavaObject* @art_check_and_alloc_array_from_code( - i32, %JavaObject*, i32) + i32, %JavaObject*, i32, %JavaObject*) declare %JavaObject* @art_check_and_alloc_array_from_code_with_access_check( - i32, %JavaObject*, i32) + i32, %JavaObject*, i32, %JavaObject*) declare void @art_find_instance_field_from_code(i32, %JavaObject*) declare void @art_find_static_field_from_code(i32, %JavaObject*) declare %JavaObject* @art_find_static_method_from_code_with_access_check( - i32, %JavaObject*, %JavaObject*) + i32, %JavaObject*, %JavaObject*, %JavaObject*) declare %JavaObject* @art_find_direct_method_from_code_with_access_check( - i32, %JavaObject*, %JavaObject*) + i32, %JavaObject*, %JavaObject*, %JavaObject*) declare %JavaObject* @art_find_virtual_method_from_code_with_access_check( - i32, %JavaObject*, %JavaObject*) + i32, %JavaObject*, %JavaObject*, %JavaObject*) declare %JavaObject* @art_find_super_method_from_code_with_access_check( - i32, %JavaObject*, %JavaObject*) + i32, %JavaObject*, %JavaObject*, %JavaObject*) declare %JavaObject* @art_find_interface_method_from_code_with_access_check( - i32, %JavaObject*, %JavaObject*) + i32, %JavaObject*, %JavaObject*, %JavaObject*) declare %JavaObject* @art_find_interface_method_from_code( - i32, %JavaObject*, %JavaObject*) + i32, %JavaObject*, %JavaObject*, %JavaObject*) declare %JavaObject* @art_initialize_static_storage_from_code(i32, %JavaObject*) declare %JavaObject* @art_initialize_type_from_code(i32, %JavaObject*) diff --git a/src/compiler_llvm/generated/art_module.cc b/src/compiler_llvm/generated/art_module.cc index 1b9bcf5195..510383af33 100644 --- a/src/compiler_llvm/generated/art_module.cc +++ b/src/compiler_llvm/generated/art_module.cc @@ -128,6 +128,7 @@ FunctionType* FuncTy_11 = FunctionType::get( std::vector<Type*>FuncTy_12_args; FuncTy_12_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_12_args.push_back(PointerTy_1); +FuncTy_12_args.push_back(PointerTy_1); FunctionType* FuncTy_12 = FunctionType::get( /*Result=*/PointerTy_1, /*Params=*/FuncTy_12_args, @@ -137,6 +138,7 @@ std::vector<Type*>FuncTy_13_args; FuncTy_13_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_13_args.push_back(PointerTy_1); FuncTy_13_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_13_args.push_back(PointerTy_1); FunctionType* FuncTy_13 = FunctionType::get( /*Result=*/PointerTy_1, /*Params=*/FuncTy_13_args, @@ -154,32 +156,32 @@ std::vector<Type*>FuncTy_15_args; FuncTy_15_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_15_args.push_back(PointerTy_1); FuncTy_15_args.push_back(PointerTy_1); +FuncTy_15_args.push_back(PointerTy_1); FunctionType* FuncTy_15 = FunctionType::get( /*Result=*/PointerTy_1, /*Params=*/FuncTy_15_args, /*isVarArg=*/false); std::vector<Type*>FuncTy_16_args; -FuncTy_16_args.push_back(PointerTy_1); FuncTy_16_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_16_args.push_back(PointerTy_1); FunctionType* FuncTy_16 = FunctionType::get( /*Result=*/PointerTy_1, /*Params=*/FuncTy_16_args, /*isVarArg=*/false); std::vector<Type*>FuncTy_17_args; -FuncTy_17_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_17_args.push_back(PointerTy_1); FuncTy_17_args.push_back(IntegerType::get(mod->getContext(), 32)); FunctionType* FuncTy_17 = FunctionType::get( - /*Result=*/IntegerType::get(mod->getContext(), 32), + /*Result=*/PointerTy_1, /*Params=*/FuncTy_17_args, /*isVarArg=*/false); std::vector<Type*>FuncTy_18_args; FuncTy_18_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_18_args.push_back(PointerTy_1); -FuncTy_18_args.push_back(IntegerType::get(mod->getContext(), 64)); +FuncTy_18_args.push_back(IntegerType::get(mod->getContext(), 32)); FunctionType* FuncTy_18 = FunctionType::get( /*Result=*/IntegerType::get(mod->getContext(), 32), /*Params=*/FuncTy_18_args, @@ -188,7 +190,7 @@ FunctionType* FuncTy_18 = FunctionType::get( std::vector<Type*>FuncTy_19_args; FuncTy_19_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_19_args.push_back(PointerTy_1); -FuncTy_19_args.push_back(PointerTy_1); +FuncTy_19_args.push_back(IntegerType::get(mod->getContext(), 64)); FunctionType* FuncTy_19 = FunctionType::get( /*Result=*/IntegerType::get(mod->getContext(), 32), /*Params=*/FuncTy_19_args, @@ -197,6 +199,7 @@ FunctionType* FuncTy_19 = FunctionType::get( std::vector<Type*>FuncTy_20_args; FuncTy_20_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_20_args.push_back(PointerTy_1); +FuncTy_20_args.push_back(PointerTy_1); FunctionType* FuncTy_20 = FunctionType::get( /*Result=*/IntegerType::get(mod->getContext(), 32), /*Params=*/FuncTy_20_args, @@ -206,17 +209,15 @@ std::vector<Type*>FuncTy_21_args; FuncTy_21_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_21_args.push_back(PointerTy_1); FunctionType* FuncTy_21 = FunctionType::get( - /*Result=*/IntegerType::get(mod->getContext(), 64), + /*Result=*/IntegerType::get(mod->getContext(), 32), /*Params=*/FuncTy_21_args, /*isVarArg=*/false); std::vector<Type*>FuncTy_22_args; FuncTy_22_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_22_args.push_back(PointerTy_1); -FuncTy_22_args.push_back(PointerTy_1); -FuncTy_22_args.push_back(IntegerType::get(mod->getContext(), 32)); FunctionType* FuncTy_22 = FunctionType::get( - /*Result=*/IntegerType::get(mod->getContext(), 32), + /*Result=*/IntegerType::get(mod->getContext(), 64), /*Params=*/FuncTy_22_args, /*isVarArg=*/false); @@ -224,7 +225,7 @@ std::vector<Type*>FuncTy_23_args; FuncTy_23_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_23_args.push_back(PointerTy_1); FuncTy_23_args.push_back(PointerTy_1); -FuncTy_23_args.push_back(IntegerType::get(mod->getContext(), 64)); +FuncTy_23_args.push_back(IntegerType::get(mod->getContext(), 32)); FunctionType* FuncTy_23 = FunctionType::get( /*Result=*/IntegerType::get(mod->getContext(), 32), /*Params=*/FuncTy_23_args, @@ -234,7 +235,7 @@ std::vector<Type*>FuncTy_24_args; FuncTy_24_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_24_args.push_back(PointerTy_1); FuncTy_24_args.push_back(PointerTy_1); -FuncTy_24_args.push_back(PointerTy_1); +FuncTy_24_args.push_back(IntegerType::get(mod->getContext(), 64)); FunctionType* FuncTy_24 = FunctionType::get( /*Result=*/IntegerType::get(mod->getContext(), 32), /*Params=*/FuncTy_24_args, @@ -244,16 +245,18 @@ std::vector<Type*>FuncTy_25_args; FuncTy_25_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_25_args.push_back(PointerTy_1); FuncTy_25_args.push_back(PointerTy_1); +FuncTy_25_args.push_back(PointerTy_1); FunctionType* FuncTy_25 = FunctionType::get( - /*Result=*/IntegerType::get(mod->getContext(), 64), + /*Result=*/IntegerType::get(mod->getContext(), 32), /*Params=*/FuncTy_25_args, /*isVarArg=*/false); std::vector<Type*>FuncTy_26_args; +FuncTy_26_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_26_args.push_back(PointerTy_1); FuncTy_26_args.push_back(PointerTy_1); FunctionType* FuncTy_26 = FunctionType::get( - /*Result=*/PointerTy_1, + /*Result=*/IntegerType::get(mod->getContext(), 64), /*Params=*/FuncTy_26_args, /*isVarArg=*/false); @@ -261,7 +264,7 @@ std::vector<Type*>FuncTy_27_args; FuncTy_27_args.push_back(PointerTy_1); FuncTy_27_args.push_back(PointerTy_1); FunctionType* FuncTy_27 = FunctionType::get( - /*Result=*/IntegerType::get(mod->getContext(), 32), + /*Result=*/PointerTy_1, /*Params=*/FuncTy_27_args, /*isVarArg=*/false); @@ -269,50 +272,51 @@ std::vector<Type*>FuncTy_28_args; FuncTy_28_args.push_back(PointerTy_1); FuncTy_28_args.push_back(PointerTy_1); FunctionType* FuncTy_28 = FunctionType::get( - /*Result=*/Type::getVoidTy(mod->getContext()), + /*Result=*/IntegerType::get(mod->getContext(), 32), /*Params=*/FuncTy_28_args, /*isVarArg=*/false); std::vector<Type*>FuncTy_29_args; -FuncTy_29_args.push_back(Type::getDoubleTy(mod->getContext())); +FuncTy_29_args.push_back(PointerTy_1); +FuncTy_29_args.push_back(PointerTy_1); FunctionType* FuncTy_29 = FunctionType::get( - /*Result=*/IntegerType::get(mod->getContext(), 64), + /*Result=*/Type::getVoidTy(mod->getContext()), /*Params=*/FuncTy_29_args, /*isVarArg=*/false); std::vector<Type*>FuncTy_30_args; FuncTy_30_args.push_back(Type::getDoubleTy(mod->getContext())); FunctionType* FuncTy_30 = FunctionType::get( - /*Result=*/IntegerType::get(mod->getContext(), 32), + /*Result=*/IntegerType::get(mod->getContext(), 64), /*Params=*/FuncTy_30_args, /*isVarArg=*/false); std::vector<Type*>FuncTy_31_args; -FuncTy_31_args.push_back(Type::getFloatTy(mod->getContext())); +FuncTy_31_args.push_back(Type::getDoubleTy(mod->getContext())); FunctionType* FuncTy_31 = FunctionType::get( - /*Result=*/IntegerType::get(mod->getContext(), 64), + /*Result=*/IntegerType::get(mod->getContext(), 32), /*Params=*/FuncTy_31_args, /*isVarArg=*/false); std::vector<Type*>FuncTy_32_args; FuncTy_32_args.push_back(Type::getFloatTy(mod->getContext())); FunctionType* FuncTy_32 = FunctionType::get( - /*Result=*/IntegerType::get(mod->getContext(), 32), + /*Result=*/IntegerType::get(mod->getContext(), 64), /*Params=*/FuncTy_32_args, /*isVarArg=*/false); std::vector<Type*>FuncTy_33_args; -FuncTy_33_args.push_back(PointerTy_1); -FuncTy_33_args.push_back(PointerTy_1); -FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_33_args.push_back(Type::getFloatTy(mod->getContext())); FunctionType* FuncTy_33 = FunctionType::get( - /*Result=*/PointerTy_1, + /*Result=*/IntegerType::get(mod->getContext(), 32), /*Params=*/FuncTy_33_args, /*isVarArg=*/false); std::vector<Type*>FuncTy_34_args; FuncTy_34_args.push_back(PointerTy_1); +FuncTy_34_args.push_back(PointerTy_1); +FuncTy_34_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_34_args.push_back(IntegerType::get(mod->getContext(), 1)); FunctionType* FuncTy_34 = FunctionType::get( /*Result=*/PointerTy_1, /*Params=*/FuncTy_34_args, @@ -321,8 +325,15 @@ FunctionType* FuncTy_34 = FunctionType::get( std::vector<Type*>FuncTy_35_args; FuncTy_35_args.push_back(PointerTy_1); FunctionType* FuncTy_35 = FunctionType::get( - /*Result=*/Type::getVoidTy(mod->getContext()), + /*Result=*/PointerTy_1, /*Params=*/FuncTy_35_args, + /*isVarArg=*/false); + +std::vector<Type*>FuncTy_36_args; +FuncTy_36_args.push_back(PointerTy_1); +FunctionType* FuncTy_36 = FunctionType::get( + /*Result=*/Type::getVoidTy(mod->getContext()), + /*Params=*/FuncTy_36_args, /*isVarArg=*/true); @@ -672,7 +683,7 @@ func_art_find_interface_method_from_code->setAttributes(func_art_find_interface_ Function* func_art_initialize_static_storage_from_code = mod->getFunction("art_initialize_static_storage_from_code"); if (!func_art_initialize_static_storage_from_code) { func_art_initialize_static_storage_from_code = Function::Create( - /*Type=*/FuncTy_12, + /*Type=*/FuncTy_16, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_initialize_static_storage_from_code", mod); // (external, no body) func_art_initialize_static_storage_from_code->setCallingConv(CallingConv::C); @@ -683,7 +694,7 @@ func_art_initialize_static_storage_from_code->setAttributes(func_art_initialize_ Function* func_art_initialize_type_from_code = mod->getFunction("art_initialize_type_from_code"); if (!func_art_initialize_type_from_code) { func_art_initialize_type_from_code = Function::Create( - /*Type=*/FuncTy_12, + /*Type=*/FuncTy_16, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_initialize_type_from_code", mod); // (external, no body) func_art_initialize_type_from_code->setCallingConv(CallingConv::C); @@ -694,7 +705,7 @@ func_art_initialize_type_from_code->setAttributes(func_art_initialize_type_from_ Function* func_art_initialize_type_and_verify_access_from_code = mod->getFunction("art_initialize_type_and_verify_access_from_code"); if (!func_art_initialize_type_and_verify_access_from_code) { func_art_initialize_type_and_verify_access_from_code = Function::Create( - /*Type=*/FuncTy_12, + /*Type=*/FuncTy_16, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_initialize_type_and_verify_access_from_code", mod); // (external, no body) func_art_initialize_type_and_verify_access_from_code->setCallingConv(CallingConv::C); @@ -705,7 +716,7 @@ func_art_initialize_type_and_verify_access_from_code->setAttributes(func_art_ini Function* func_art_resolve_string_from_code = mod->getFunction("art_resolve_string_from_code"); if (!func_art_resolve_string_from_code) { func_art_resolve_string_from_code = Function::Create( - /*Type=*/FuncTy_16, + /*Type=*/FuncTy_17, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_resolve_string_from_code", mod); // (external, no body) func_art_resolve_string_from_code->setCallingConv(CallingConv::C); @@ -716,7 +727,7 @@ func_art_resolve_string_from_code->setAttributes(func_art_resolve_string_from_co Function* func_art_set32_static_from_code = mod->getFunction("art_set32_static_from_code"); if (!func_art_set32_static_from_code) { func_art_set32_static_from_code = Function::Create( - /*Type=*/FuncTy_17, + /*Type=*/FuncTy_18, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_set32_static_from_code", mod); // (external, no body) func_art_set32_static_from_code->setCallingConv(CallingConv::C); @@ -727,7 +738,7 @@ func_art_set32_static_from_code->setAttributes(func_art_set32_static_from_code_P Function* func_art_set64_static_from_code = mod->getFunction("art_set64_static_from_code"); if (!func_art_set64_static_from_code) { func_art_set64_static_from_code = Function::Create( - /*Type=*/FuncTy_18, + /*Type=*/FuncTy_19, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_set64_static_from_code", mod); // (external, no body) func_art_set64_static_from_code->setCallingConv(CallingConv::C); @@ -738,7 +749,7 @@ func_art_set64_static_from_code->setAttributes(func_art_set64_static_from_code_P Function* func_art_set_obj_static_from_code = mod->getFunction("art_set_obj_static_from_code"); if (!func_art_set_obj_static_from_code) { func_art_set_obj_static_from_code = Function::Create( - /*Type=*/FuncTy_19, + /*Type=*/FuncTy_20, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_set_obj_static_from_code", mod); // (external, no body) func_art_set_obj_static_from_code->setCallingConv(CallingConv::C); @@ -749,7 +760,7 @@ func_art_set_obj_static_from_code->setAttributes(func_art_set_obj_static_from_co Function* func_art_get32_static_from_code = mod->getFunction("art_get32_static_from_code"); if (!func_art_get32_static_from_code) { func_art_get32_static_from_code = Function::Create( - /*Type=*/FuncTy_20, + /*Type=*/FuncTy_21, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_get32_static_from_code", mod); // (external, no body) func_art_get32_static_from_code->setCallingConv(CallingConv::C); @@ -760,7 +771,7 @@ func_art_get32_static_from_code->setAttributes(func_art_get32_static_from_code_P Function* func_art_get64_static_from_code = mod->getFunction("art_get64_static_from_code"); if (!func_art_get64_static_from_code) { func_art_get64_static_from_code = Function::Create( - /*Type=*/FuncTy_21, + /*Type=*/FuncTy_22, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_get64_static_from_code", mod); // (external, no body) func_art_get64_static_from_code->setCallingConv(CallingConv::C); @@ -771,7 +782,7 @@ func_art_get64_static_from_code->setAttributes(func_art_get64_static_from_code_P Function* func_art_get_obj_static_from_code = mod->getFunction("art_get_obj_static_from_code"); if (!func_art_get_obj_static_from_code) { func_art_get_obj_static_from_code = Function::Create( - /*Type=*/FuncTy_12, + /*Type=*/FuncTy_16, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_get_obj_static_from_code", mod); // (external, no body) func_art_get_obj_static_from_code->setCallingConv(CallingConv::C); @@ -782,7 +793,7 @@ func_art_get_obj_static_from_code->setAttributes(func_art_get_obj_static_from_co Function* func_art_set32_instance_from_code = mod->getFunction("art_set32_instance_from_code"); if (!func_art_set32_instance_from_code) { func_art_set32_instance_from_code = Function::Create( - /*Type=*/FuncTy_22, + /*Type=*/FuncTy_23, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_set32_instance_from_code", mod); // (external, no body) func_art_set32_instance_from_code->setCallingConv(CallingConv::C); @@ -793,7 +804,7 @@ func_art_set32_instance_from_code->setAttributes(func_art_set32_instance_from_co Function* func_art_set64_instance_from_code = mod->getFunction("art_set64_instance_from_code"); if (!func_art_set64_instance_from_code) { func_art_set64_instance_from_code = Function::Create( - /*Type=*/FuncTy_23, + /*Type=*/FuncTy_24, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_set64_instance_from_code", mod); // (external, no body) func_art_set64_instance_from_code->setCallingConv(CallingConv::C); @@ -804,7 +815,7 @@ func_art_set64_instance_from_code->setAttributes(func_art_set64_instance_from_co Function* func_art_set_obj_instance_from_code = mod->getFunction("art_set_obj_instance_from_code"); if (!func_art_set_obj_instance_from_code) { func_art_set_obj_instance_from_code = Function::Create( - /*Type=*/FuncTy_24, + /*Type=*/FuncTy_25, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_set_obj_instance_from_code", mod); // (external, no body) func_art_set_obj_instance_from_code->setCallingConv(CallingConv::C); @@ -815,7 +826,7 @@ func_art_set_obj_instance_from_code->setAttributes(func_art_set_obj_instance_fro Function* func_art_get32_instance_from_code = mod->getFunction("art_get32_instance_from_code"); if (!func_art_get32_instance_from_code) { func_art_get32_instance_from_code = Function::Create( - /*Type=*/FuncTy_19, + /*Type=*/FuncTy_20, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_get32_instance_from_code", mod); // (external, no body) func_art_get32_instance_from_code->setCallingConv(CallingConv::C); @@ -826,7 +837,7 @@ func_art_get32_instance_from_code->setAttributes(func_art_get32_instance_from_co Function* func_art_get64_instance_from_code = mod->getFunction("art_get64_instance_from_code"); if (!func_art_get64_instance_from_code) { func_art_get64_instance_from_code = Function::Create( - /*Type=*/FuncTy_25, + /*Type=*/FuncTy_26, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_get64_instance_from_code", mod); // (external, no body) func_art_get64_instance_from_code->setCallingConv(CallingConv::C); @@ -837,7 +848,7 @@ func_art_get64_instance_from_code->setAttributes(func_art_get64_instance_from_co Function* func_art_get_obj_instance_from_code = mod->getFunction("art_get_obj_instance_from_code"); if (!func_art_get_obj_instance_from_code) { func_art_get_obj_instance_from_code = Function::Create( - /*Type=*/FuncTy_15, + /*Type=*/FuncTy_12, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_get_obj_instance_from_code", mod); // (external, no body) func_art_get_obj_instance_from_code->setCallingConv(CallingConv::C); @@ -848,7 +859,7 @@ func_art_get_obj_instance_from_code->setAttributes(func_art_get_obj_instance_fro Function* func_art_decode_jobject_in_thread = mod->getFunction("art_decode_jobject_in_thread"); if (!func_art_decode_jobject_in_thread) { func_art_decode_jobject_in_thread = Function::Create( - /*Type=*/FuncTy_26, + /*Type=*/FuncTy_27, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_decode_jobject_in_thread", mod); // (external, no body) func_art_decode_jobject_in_thread->setCallingConv(CallingConv::C); @@ -859,7 +870,7 @@ func_art_decode_jobject_in_thread->setAttributes(func_art_decode_jobject_in_thre Function* func_art_is_assignable_from_code = mod->getFunction("art_is_assignable_from_code"); if (!func_art_is_assignable_from_code) { func_art_is_assignable_from_code = Function::Create( - /*Type=*/FuncTy_27, + /*Type=*/FuncTy_28, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_is_assignable_from_code", mod); // (external, no body) func_art_is_assignable_from_code->setCallingConv(CallingConv::C); @@ -870,7 +881,7 @@ func_art_is_assignable_from_code->setAttributes(func_art_is_assignable_from_code Function* func_art_check_cast_from_code = mod->getFunction("art_check_cast_from_code"); if (!func_art_check_cast_from_code) { func_art_check_cast_from_code = Function::Create( - /*Type=*/FuncTy_28, + /*Type=*/FuncTy_29, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_check_cast_from_code", mod); // (external, no body) func_art_check_cast_from_code->setCallingConv(CallingConv::C); @@ -881,7 +892,7 @@ func_art_check_cast_from_code->setAttributes(func_art_check_cast_from_code_PAL); Function* func_art_check_put_array_element_from_code = mod->getFunction("art_check_put_array_element_from_code"); if (!func_art_check_put_array_element_from_code) { func_art_check_put_array_element_from_code = Function::Create( - /*Type=*/FuncTy_28, + /*Type=*/FuncTy_29, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_check_put_array_element_from_code", mod); // (external, no body) func_art_check_put_array_element_from_code->setCallingConv(CallingConv::C); @@ -892,7 +903,7 @@ func_art_check_put_array_element_from_code->setAttributes(func_art_check_put_arr Function* func_D2L = mod->getFunction("D2L"); if (!func_D2L) { func_D2L = Function::Create( - /*Type=*/FuncTy_29, + /*Type=*/FuncTy_30, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"D2L", mod); // (external, no body) func_D2L->setCallingConv(CallingConv::C); @@ -903,7 +914,7 @@ func_D2L->setAttributes(func_D2L_PAL); Function* func_D2I = mod->getFunction("D2I"); if (!func_D2I) { func_D2I = Function::Create( - /*Type=*/FuncTy_30, + /*Type=*/FuncTy_31, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"D2I", mod); // (external, no body) func_D2I->setCallingConv(CallingConv::C); @@ -914,7 +925,7 @@ func_D2I->setAttributes(func_D2I_PAL); Function* func_F2L = mod->getFunction("F2L"); if (!func_F2L) { func_F2L = Function::Create( - /*Type=*/FuncTy_31, + /*Type=*/FuncTy_32, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"F2L", mod); // (external, no body) func_F2L->setCallingConv(CallingConv::C); @@ -925,7 +936,7 @@ func_F2L->setAttributes(func_F2L_PAL); Function* func_F2I = mod->getFunction("F2I"); if (!func_F2I) { func_F2I = Function::Create( - /*Type=*/FuncTy_32, + /*Type=*/FuncTy_33, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"F2I", mod); // (external, no body) func_F2I->setCallingConv(CallingConv::C); @@ -936,7 +947,7 @@ func_F2I->setAttributes(func_F2I_PAL); Function* func_art_mark_gc_card_from_code = mod->getFunction("art_mark_gc_card_from_code"); if (!func_art_mark_gc_card_from_code) { func_art_mark_gc_card_from_code = Function::Create( - /*Type=*/FuncTy_28, + /*Type=*/FuncTy_29, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_mark_gc_card_from_code", mod); // (external, no body) func_art_mark_gc_card_from_code->setCallingConv(CallingConv::C); @@ -947,7 +958,7 @@ func_art_mark_gc_card_from_code->setAttributes(func_art_mark_gc_card_from_code_P Function* func_art_ensure_resolved_from_code = mod->getFunction("art_ensure_resolved_from_code"); if (!func_art_ensure_resolved_from_code) { func_art_ensure_resolved_from_code = Function::Create( - /*Type=*/FuncTy_33, + /*Type=*/FuncTy_34, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_ensure_resolved_from_code", mod); // (external, no body) func_art_ensure_resolved_from_code->setCallingConv(CallingConv::C); @@ -958,7 +969,7 @@ func_art_ensure_resolved_from_code->setAttributes(func_art_ensure_resolved_from_ Function* func_art_fix_stub_from_code = mod->getFunction("art_fix_stub_from_code"); if (!func_art_fix_stub_from_code) { func_art_fix_stub_from_code = Function::Create( - /*Type=*/FuncTy_34, + /*Type=*/FuncTy_35, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_fix_stub_from_code", mod); // (external, no body) func_art_fix_stub_from_code->setCallingConv(CallingConv::C); @@ -969,7 +980,7 @@ func_art_fix_stub_from_code->setAttributes(func_art_fix_stub_from_code_PAL); Function* func_art_proxy_invoke_handler_from_code = mod->getFunction("art_proxy_invoke_handler_from_code"); if (!func_art_proxy_invoke_handler_from_code) { func_art_proxy_invoke_handler_from_code = Function::Create( - /*Type=*/FuncTy_35, + /*Type=*/FuncTy_36, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"art_proxy_invoke_handler_from_code", mod); // (external, no body) func_art_proxy_invoke_handler_from_code->setCallingConv(CallingConv::C); diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc index fa8a827100..556dd510a7 100644 --- a/src/compiler_llvm/method_compiler.cc +++ b/src/compiler_llvm/method_compiler.cc @@ -1736,10 +1736,12 @@ void MethodCompiler::EmitInsn_NewInstance(uint32_t dex_pc, llvm::Value* method_object_addr = EmitLoadMethodObjectAddr(); + llvm::Value* thread_object_addr = irb_.CreateCall(irb_.GetRuntime(GetCurrentThread)); + EmitUpdateLineNumFromDexPC(dex_pc); llvm::Value* object_addr = - irb_.CreateCall2(runtime_func, type_index_value, method_object_addr); + irb_.CreateCall3(runtime_func, type_index_value, method_object_addr, thread_object_addr); EmitGuard_ExceptionLandingPad(dex_pc); @@ -1777,11 +1779,13 @@ llvm::Value* MethodCompiler::EmitAllocNewArray(uint32_t dex_pc, llvm::Value* method_object_addr = EmitLoadMethodObjectAddr(); + llvm::Value* thread_object_addr = irb_.CreateCall(irb_.GetRuntime(GetCurrentThread)); + EmitUpdateLineNumFromDexPC(dex_pc); llvm::Value* object_addr = - irb_.CreateCall3(runtime_func, type_index_value, method_object_addr, - array_length_value); + irb_.CreateCall4(runtime_func, type_index_value, method_object_addr, + array_length_value, thread_object_addr); EmitGuard_ExceptionLandingPad(dex_pc); @@ -3074,13 +3078,16 @@ EmitCallRuntimeForCalleeMethodObjectAddr(uint32_t callee_method_idx, llvm::Value* caller_method_object_addr = EmitLoadMethodObjectAddr(); + llvm::Value* thread_object_addr = irb_.CreateCall(irb_.GetRuntime(GetCurrentThread)); + EmitUpdateLineNumFromDexPC(dex_pc); llvm::Value* callee_method_object_addr = - irb_.CreateCall3(runtime_func, + irb_.CreateCall4(runtime_func, callee_method_idx_value, this_addr, - caller_method_object_addr); + caller_method_object_addr, + thread_object_addr); EmitGuard_ExceptionLandingPad(dex_pc); diff --git a/src/compiler_llvm/runtime_support_llvm.cc b/src/compiler_llvm/runtime_support_llvm.cc index 0fd3611184..69ef05d843 100644 --- a/src/compiler_llvm/runtime_support_llvm.cc +++ b/src/compiler_llvm/runtime_support_llvm.cc @@ -195,86 +195,102 @@ int32_t art_find_catch_block_from_code(Method* current_method, int32_t dex_pc) { // Object Space //---------------------------------------------------------------------------- -Object* art_alloc_object_from_code(uint32_t type_idx, Method* referrer) { - return AllocObjectFromCode(type_idx, referrer, art_get_current_thread_from_code(), false); +Object* art_alloc_object_from_code(uint32_t type_idx, + Method* referrer, + Thread* thread) { + return AllocObjectFromCode(type_idx, referrer, thread, false); } -Object* art_alloc_object_from_code_with_access_check(uint32_t type_idx, Method* referrer) { - return AllocObjectFromCode(type_idx, referrer, art_get_current_thread_from_code(), true); +Object* art_alloc_object_from_code_with_access_check(uint32_t type_idx, + Method* referrer, + Thread* thread) { + return AllocObjectFromCode(type_idx, referrer, thread, true); } -Object* art_alloc_array_from_code(uint32_t type_idx, Method* referrer, uint32_t length) { - return AllocArrayFromCode(type_idx, referrer, length, art_get_current_thread_from_code(), false); +Object* art_alloc_array_from_code(uint32_t type_idx, + Method* referrer, + uint32_t length, + Thread* thread) { + return AllocArrayFromCode(type_idx, referrer, length, thread, false); } Object* art_alloc_array_from_code_with_access_check(uint32_t type_idx, Method* referrer, - uint32_t length) { - return AllocArrayFromCode(type_idx, referrer, length, art_get_current_thread_from_code(), true); + uint32_t length, + Thread* thread) { + return AllocArrayFromCode(type_idx, referrer, length, thread, true); } Object* art_check_and_alloc_array_from_code(uint32_t type_idx, Method* referrer, - uint32_t length) { - return CheckAndAllocArrayFromCode(type_idx, referrer, length, art_get_current_thread_from_code(), false); + uint32_t length, + Thread* thread) { + return CheckAndAllocArrayFromCode(type_idx, referrer, length, thread, false); } Object* art_check_and_alloc_array_from_code_with_access_check(uint32_t type_idx, Method* referrer, - uint32_t length) { - return CheckAndAllocArrayFromCode(type_idx, referrer, length, art_get_current_thread_from_code(), true); + uint32_t length, + Thread* thread) { + return CheckAndAllocArrayFromCode(type_idx, referrer, length, thread, true); } static Method* FindMethodHelper(uint32_t method_idx, Object* this_object, Method* caller_method, - bool access_check, InvokeType type) { + bool access_check, InvokeType type, Thread* thread) { Method* method = FindMethodFast(method_idx, this_object, caller_method, access_check, type); if (UNLIKELY(method == NULL)) { method = FindMethodFromCode(method_idx, this_object, caller_method, - art_get_current_thread_from_code(), access_check, type); + thread, access_check, type); if (UNLIKELY(method == NULL)) { - CHECK(art_get_current_thread_from_code()->IsExceptionPending()); + CHECK(thread->IsExceptionPending()); return 0; // failure } } - DCHECK(!art_get_current_thread_from_code()->IsExceptionPending()); + DCHECK(!thread->IsExceptionPending()); return method; } Object* art_find_static_method_from_code_with_access_check(uint32_t method_idx, Object* this_object, - Method* referrer) { - return FindMethodHelper(method_idx, this_object, referrer, true, kStatic); + Method* referrer, + Thread* thread) { + return FindMethodHelper(method_idx, this_object, referrer, true, kStatic, thread); } Object* art_find_direct_method_from_code_with_access_check(uint32_t method_idx, Object* this_object, - Method* referrer) { - return FindMethodHelper(method_idx, this_object, referrer, true, kDirect); + Method* referrer, + Thread* thread) { + return FindMethodHelper(method_idx, this_object, referrer, true, kDirect, thread); } Object* art_find_virtual_method_from_code_with_access_check(uint32_t method_idx, Object* this_object, - Method* referrer) { - return FindMethodHelper(method_idx, this_object, referrer, true, kVirtual); + Method* referrer, + Thread* thread) { + return FindMethodHelper(method_idx, this_object, referrer, true, kVirtual, thread); } Object* art_find_super_method_from_code_with_access_check(uint32_t method_idx, Object* this_object, - Method* referrer) { - return FindMethodHelper(method_idx, this_object, referrer, true, kSuper); + Method* referrer, + Thread* thread) { + return FindMethodHelper(method_idx, this_object, referrer, true, kSuper, thread); } Object* art_find_interface_method_from_code_with_access_check(uint32_t method_idx, Object* this_object, - Method* referrer) { - return FindMethodHelper(method_idx, this_object, referrer, true, kInterface); + Method* referrer, + Thread* thread) { + return FindMethodHelper(method_idx, this_object, referrer, true, kInterface, thread); } Object* art_find_interface_method_from_code(uint32_t method_idx, Object* this_object, - Method* referrer) { - return FindMethodHelper(method_idx, this_object, referrer, false, kInterface); + Method* referrer, + Thread* thread) { + return FindMethodHelper(method_idx, this_object, referrer, false, kInterface, thread); } Object* art_initialize_static_storage_from_code(uint32_t type_idx, Method* referrer) { |