1 /* Copyright (C) 2008 The Android Open Source Project 2 * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /* 17 * File: OP_CONST_STRING_JUMBO.S 18 * 19 * Code: Move a string reference to a register. Uses no substitutions. 20 * 21 * For: const/string-jumbo 22 * 23 * Description: Move a reference to the string specified by the given 24 * index into the specified register. vAA <- pResString[BBBB] 25 * 26 * Format: AA|op BBBBlo BBBBhi (31c) 27 * 28 * Syntax: op vAA, string@BBBBBBBB 29 */ 30 31 movl rGLUE, %edx # get MterpGlue pointer 32 movl offGlue_methodClassDex(%edx), %eax # %eax<- glue->methodClassDex 33 movl offDvmDex_pResStrings(%eax), %eax # %eax<- glue->methodClassDex->pResStrings 34 FETCH 1, %ecx # %ecx<- BBBBlo 35 FETCH 2, %edx # %edx<- BBBBhi 36 shl $$16, %edx # %edx<- prepare to create &BBBBBBBB 37 or %edx, %ecx # %ecx<- &BBBBBBBB 38 movl (%eax, %ecx, 4), %eax # %eax<- pResStrings[BBBB] 39 cmp $$0, %eax # check if string is resolved 40 je .L${opcode}_resolve # resolve string reference 41 SET_VREG %eax, rINST # vAA<- %eax; pResString[BBBB] 42 FINISH 3 # jump to next instruction 43%break 44 45 46 /* 47 * Continuation if the Class has not yet been resolved. 48 * %ecx: BBBB (Class ref) 49 * need: target register 50 */ 51.L${opcode}_resolve: 52 EXPORT_PC 53 movl rGLUE, %edx # get MterpGlue pointer 54 movl offGlue_method(%edx), %edx # %edx<- glue->method 55 movl offMethod_clazz(%edx), %edx # %edx <- glue->method->clazz 56 movl %ecx, -4(%esp) # push parameter class ref 57 movl %edx, -8(%esp) # push parameter glue->method->clazz 58 lea -8(%esp), %esp 59 call dvmResolveString # resolve string reference 60 # call: (const ClassObject* referrer, u4 stringIdx) 61 # return: StringObject* 62 lea 8(%esp), %esp 63 cmp $$0, %eax # check if resolved string failed 64 je common_exceptionThrown # resolve failed; exception thrown 65 SET_VREG %eax, rINST # vAA<- %eax; pResString[BBBB] 66 FINISH 3 # jump to next instruction 67