1*055d4590SKeyi Gui#!/bin/bash 2*055d4590SKeyi Gui# 3*055d4590SKeyi Gui# Copyright (C) 2015 The Android Open Source Project 4*055d4590SKeyi Gui# 5*055d4590SKeyi Gui# Licensed under the Apache License, Version 2.0 (the "License"); 6*055d4590SKeyi Gui# you may not use this file except in compliance with the License. 7*055d4590SKeyi Gui# You may obtain a copy of the License at 8*055d4590SKeyi Gui# 9*055d4590SKeyi Gui# http://www.apache.org/licenses/LICENSE-2.0 10*055d4590SKeyi Gui# 11*055d4590SKeyi Gui# Unless required by applicable law or agreed to in writing, software 12*055d4590SKeyi Gui# distributed under the License is distributed on an "AS IS" BASIS, 13*055d4590SKeyi Gui# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14*055d4590SKeyi Gui# See the License for the specific language governing permissions and 15*055d4590SKeyi Gui# limitations under the License. 16*055d4590SKeyi Gui 17*055d4590SKeyi Guiecho ' 18*055d4590SKeyi Gui.class multidimensional 19*055d4590SKeyi Gui.super java/lang/Object 20*055d4590SKeyi Gui' 21*055d4590SKeyi Gui 22*055d4590SKeyi Guifunction onetype() { 23*055d4590SKeyi Guilocal typename=$1 24*055d4590SKeyi Guilocal stacksize=$2 25*055d4590SKeyi Guilocal defaultvalue=$3 26*055d4590SKeyi Guilocal descriptor=$4 27*055d4590SKeyi Guilocal defaultload=$5 28*055d4590SKeyi Guilocal loadstoreprefix=$6 29*055d4590SKeyi Guilocal returnprefix=${7:-$loadstoreprefix} 30*055d4590SKeyi Guiecho " 31*055d4590SKeyi Gui; Output from some versions of javac on: 32*055d4590SKeyi Gui; public static $typename test_get${typename^}Array() { 33*055d4590SKeyi Gui; $typename[][] array = null; 34*055d4590SKeyi Gui; return array[1][1]; 35*055d4590SKeyi Gui; } 36*055d4590SKeyi Gui.method public static test_get${typename^}Array()$descriptor 37*055d4590SKeyi Gui .limit locals 1 38*055d4590SKeyi Gui .limit stack 2 39*055d4590SKeyi Gui 40*055d4590SKeyi Gui aconst_null 41*055d4590SKeyi Gui astore_0 42*055d4590SKeyi Gui aload_0 43*055d4590SKeyi Gui iconst_1 44*055d4590SKeyi Gui aaload 45*055d4590SKeyi Gui iconst_1 46*055d4590SKeyi Gui ${loadstoreprefix}aload 47*055d4590SKeyi Gui ${returnprefix}return 48*055d4590SKeyi Gui.end method 49*055d4590SKeyi Gui 50*055d4590SKeyi Gui; Output from some versions of javac on: 51*055d4590SKeyi Gui; public static void test_set${typename^}Array() { 52*055d4590SKeyi Gui; $typename[][] array = null; 53*055d4590SKeyi Gui; array[1][1] = $defaultvalue; 54*055d4590SKeyi Gui; } 55*055d4590SKeyi Gui.method public static test_set${typename^}Array()V 56*055d4590SKeyi Gui .limit locals 1 57*055d4590SKeyi Gui .limit stack $((stacksize+2)) 58*055d4590SKeyi Gui 59*055d4590SKeyi Gui aconst_null 60*055d4590SKeyi Gui astore_0 61*055d4590SKeyi Gui aload_0 62*055d4590SKeyi Gui iconst_1 63*055d4590SKeyi Gui aaload 64*055d4590SKeyi Gui iconst_1 65*055d4590SKeyi Gui $defaultload 66*055d4590SKeyi Gui ${loadstoreprefix}astore 67*055d4590SKeyi Gui return 68*055d4590SKeyi Gui.end method 69*055d4590SKeyi Gui" 70*055d4590SKeyi Gui} 71*055d4590SKeyi Gui 72*055d4590SKeyi Guionetype Object 1 null 'Ljava/lang/Object;' aconst_null a 73*055d4590SKeyi Guionetype boolean 1 false Z iconst_0 b i 74*055d4590SKeyi Guionetype byte 1 0 B iconst_0 b i 75*055d4590SKeyi Guionetype char 1 0 C iconst_0 c i 76*055d4590SKeyi Guionetype short 1 0 S iconst_0 s i 77*055d4590SKeyi Guionetype int 1 0 I iconst_0 i 78*055d4590SKeyi Guionetype long 2 0 J lconst_0 l 79*055d4590SKeyi Guionetype float 1 0 F fconst_0 f 80*055d4590SKeyi Guionetype double 2 0 D dconst_0 d 81