From 310cca09a8e49803229ecbce596453192fdbc88b Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 30 May 2018 17:07:40 -0700 Subject: [PATCH 001/126] ART: Move mterp pointers to object Let the artMterpXYZ labels have type object, and be hidden, to help the unwinder get the right name. Test: mmma art Test: m test-art-host Change-Id: I81c264c9a1bae1cc1a6da399882f63dab269b716 --- runtime/interpreter/mterp/arm/instruction_end.S | 2 ++ .../interpreter/mterp/arm/instruction_end_alt.S | 2 ++ .../interpreter/mterp/arm/instruction_end_sister.S | 2 ++ runtime/interpreter/mterp/arm/instruction_start.S | 2 ++ .../interpreter/mterp/arm/instruction_start_alt.S | 2 ++ .../mterp/arm/instruction_start_sister.S | 2 ++ runtime/interpreter/mterp/arm64/instruction_end.S | 2 ++ .../interpreter/mterp/arm64/instruction_end_alt.S | 2 ++ .../mterp/arm64/instruction_end_sister.S | 2 ++ .../interpreter/mterp/arm64/instruction_start.S | 2 ++ .../mterp/arm64/instruction_start_alt.S | 2 ++ .../mterp/arm64/instruction_start_sister.S | 2 ++ runtime/interpreter/mterp/out/mterp_arm.S | 12 ++++++++++++ runtime/interpreter/mterp/out/mterp_arm64.S | 12 ++++++++++++ runtime/interpreter/mterp/out/mterp_x86.S | 14 ++++++++++++++ runtime/interpreter/mterp/out/mterp_x86_64.S | 14 ++++++++++++++ runtime/interpreter/mterp/x86/header.S | 2 ++ runtime/interpreter/mterp/x86/instruction_end.S | 2 ++ .../interpreter/mterp/x86/instruction_end_alt.S | 2 ++ .../interpreter/mterp/x86/instruction_end_sister.S | 2 ++ runtime/interpreter/mterp/x86/instruction_start.S | 2 ++ .../interpreter/mterp/x86/instruction_start_alt.S | 2 ++ .../mterp/x86/instruction_start_sister.S | 2 ++ runtime/interpreter/mterp/x86_64/header.S | 2 ++ runtime/interpreter/mterp/x86_64/instruction_end.S | 2 ++ .../interpreter/mterp/x86_64/instruction_end_alt.S | 2 ++ .../mterp/x86_64/instruction_end_sister.S | 2 ++ .../interpreter/mterp/x86_64/instruction_start.S | 2 ++ .../mterp/x86_64/instruction_start_alt.S | 2 ++ .../mterp/x86_64/instruction_start_sister.S | 2 ++ 30 files changed, 104 insertions(+) diff --git a/runtime/interpreter/mterp/arm/instruction_end.S b/runtime/interpreter/mterp/arm/instruction_end.S index 32c725c7d9..f90ebd0221 100644 --- a/runtime/interpreter/mterp/arm/instruction_end.S +++ b/runtime/interpreter/mterp/arm/instruction_end.S @@ -1,3 +1,5 @@ + .type artMterpAsmInstructionEnd, #object + .hidden artMterpAsmInstructionEnd .global artMterpAsmInstructionEnd artMterpAsmInstructionEnd: diff --git a/runtime/interpreter/mterp/arm/instruction_end_alt.S b/runtime/interpreter/mterp/arm/instruction_end_alt.S index f90916fc02..0b66dbb947 100644 --- a/runtime/interpreter/mterp/arm/instruction_end_alt.S +++ b/runtime/interpreter/mterp/arm/instruction_end_alt.S @@ -1,3 +1,5 @@ + .type artMterpAsmAltInstructionEnd, #object + .hidden artMterpAsmAltInstructionEnd .global artMterpAsmAltInstructionEnd artMterpAsmAltInstructionEnd: diff --git a/runtime/interpreter/mterp/arm/instruction_end_sister.S b/runtime/interpreter/mterp/arm/instruction_end_sister.S index c5f4886697..71c0300f6d 100644 --- a/runtime/interpreter/mterp/arm/instruction_end_sister.S +++ b/runtime/interpreter/mterp/arm/instruction_end_sister.S @@ -1,3 +1,5 @@ + .type artMterpAsmSisterEnd, #object + .hidden artMterpAsmSisterEnd .global artMterpAsmSisterEnd artMterpAsmSisterEnd: diff --git a/runtime/interpreter/mterp/arm/instruction_start.S b/runtime/interpreter/mterp/arm/instruction_start.S index 8874c20540..b7e9cf51e4 100644 --- a/runtime/interpreter/mterp/arm/instruction_start.S +++ b/runtime/interpreter/mterp/arm/instruction_start.S @@ -1,4 +1,6 @@ + .type artMterpAsmInstructionStart, #object + .hidden artMterpAsmInstructionStart .global artMterpAsmInstructionStart artMterpAsmInstructionStart = .L_op_nop .text diff --git a/runtime/interpreter/mterp/arm/instruction_start_alt.S b/runtime/interpreter/mterp/arm/instruction_start_alt.S index 0c9ffdb7d6..7a67ba064c 100644 --- a/runtime/interpreter/mterp/arm/instruction_start_alt.S +++ b/runtime/interpreter/mterp/arm/instruction_start_alt.S @@ -1,4 +1,6 @@ + .type artMterpAsmAltInstructionStart, #object + .hidden artMterpAsmAltInstructionStart .global artMterpAsmAltInstructionStart artMterpAsmAltInstructionStart = .L_ALT_op_nop .text diff --git a/runtime/interpreter/mterp/arm/instruction_start_sister.S b/runtime/interpreter/mterp/arm/instruction_start_sister.S index 2ec51f7261..0036061605 100644 --- a/runtime/interpreter/mterp/arm/instruction_start_sister.S +++ b/runtime/interpreter/mterp/arm/instruction_start_sister.S @@ -1,4 +1,6 @@ + .type artMterpAsmSisterStart, #object + .hidden artMterpAsmSisterStart .global artMterpAsmSisterStart .text .balign 4 diff --git a/runtime/interpreter/mterp/arm64/instruction_end.S b/runtime/interpreter/mterp/arm64/instruction_end.S index 32c725c7d9..f90ebd0221 100644 --- a/runtime/interpreter/mterp/arm64/instruction_end.S +++ b/runtime/interpreter/mterp/arm64/instruction_end.S @@ -1,3 +1,5 @@ + .type artMterpAsmInstructionEnd, #object + .hidden artMterpAsmInstructionEnd .global artMterpAsmInstructionEnd artMterpAsmInstructionEnd: diff --git a/runtime/interpreter/mterp/arm64/instruction_end_alt.S b/runtime/interpreter/mterp/arm64/instruction_end_alt.S index f90916fc02..0b66dbb947 100644 --- a/runtime/interpreter/mterp/arm64/instruction_end_alt.S +++ b/runtime/interpreter/mterp/arm64/instruction_end_alt.S @@ -1,3 +1,5 @@ + .type artMterpAsmAltInstructionEnd, #object + .hidden artMterpAsmAltInstructionEnd .global artMterpAsmAltInstructionEnd artMterpAsmAltInstructionEnd: diff --git a/runtime/interpreter/mterp/arm64/instruction_end_sister.S b/runtime/interpreter/mterp/arm64/instruction_end_sister.S index c5f4886697..71c0300f6d 100644 --- a/runtime/interpreter/mterp/arm64/instruction_end_sister.S +++ b/runtime/interpreter/mterp/arm64/instruction_end_sister.S @@ -1,3 +1,5 @@ + .type artMterpAsmSisterEnd, #object + .hidden artMterpAsmSisterEnd .global artMterpAsmSisterEnd artMterpAsmSisterEnd: diff --git a/runtime/interpreter/mterp/arm64/instruction_start.S b/runtime/interpreter/mterp/arm64/instruction_start.S index 8874c20540..b7e9cf51e4 100644 --- a/runtime/interpreter/mterp/arm64/instruction_start.S +++ b/runtime/interpreter/mterp/arm64/instruction_start.S @@ -1,4 +1,6 @@ + .type artMterpAsmInstructionStart, #object + .hidden artMterpAsmInstructionStart .global artMterpAsmInstructionStart artMterpAsmInstructionStart = .L_op_nop .text diff --git a/runtime/interpreter/mterp/arm64/instruction_start_alt.S b/runtime/interpreter/mterp/arm64/instruction_start_alt.S index 0c9ffdb7d6..7a67ba064c 100644 --- a/runtime/interpreter/mterp/arm64/instruction_start_alt.S +++ b/runtime/interpreter/mterp/arm64/instruction_start_alt.S @@ -1,4 +1,6 @@ + .type artMterpAsmAltInstructionStart, #object + .hidden artMterpAsmAltInstructionStart .global artMterpAsmAltInstructionStart artMterpAsmAltInstructionStart = .L_ALT_op_nop .text diff --git a/runtime/interpreter/mterp/arm64/instruction_start_sister.S b/runtime/interpreter/mterp/arm64/instruction_start_sister.S index 2ec51f7261..0036061605 100644 --- a/runtime/interpreter/mterp/arm64/instruction_start_sister.S +++ b/runtime/interpreter/mterp/arm64/instruction_start_sister.S @@ -1,4 +1,6 @@ + .type artMterpAsmSisterStart, #object + .hidden artMterpAsmSisterStart .global artMterpAsmSisterStart .text .balign 4 diff --git a/runtime/interpreter/mterp/out/mterp_arm.S b/runtime/interpreter/mterp/out/mterp_arm.S index b2702a9ffc..d4ce4d43a8 100644 --- a/runtime/interpreter/mterp/out/mterp_arm.S +++ b/runtime/interpreter/mterp/out/mterp_arm.S @@ -398,6 +398,8 @@ ENTRY ExecuteMterpImpl /* File: arm/instruction_start.S */ + .type artMterpAsmInstructionStart, #object + .hidden artMterpAsmInstructionStart .global artMterpAsmInstructionStart artMterpAsmInstructionStart = .L_op_nop .text @@ -7512,6 +7514,8 @@ constvalop_long_to_double: .balign 128 /* File: arm/instruction_end.S */ + .type artMterpAsmInstructionEnd, #object + .hidden artMterpAsmInstructionEnd .global artMterpAsmInstructionEnd artMterpAsmInstructionEnd: @@ -7523,6 +7527,8 @@ artMterpAsmInstructionEnd: */ /* File: arm/instruction_start_sister.S */ + .type artMterpAsmSisterStart, #object + .hidden artMterpAsmSisterStart .global artMterpAsmSisterStart .text .balign 4 @@ -7592,11 +7598,15 @@ d2l_maybeNaN: bx lr @ return 0 for NaN /* File: arm/instruction_end_sister.S */ + .type artMterpAsmSisterEnd, #object + .hidden artMterpAsmSisterEnd .global artMterpAsmSisterEnd artMterpAsmSisterEnd: /* File: arm/instruction_start_alt.S */ + .type artMterpAsmAltInstructionStart, #object + .hidden artMterpAsmAltInstructionStart .global artMterpAsmAltInstructionStart artMterpAsmAltInstructionStart = .L_ALT_op_nop .text @@ -11956,6 +11966,8 @@ artMterpAsmAltInstructionStart = .L_ALT_op_nop .balign 128 /* File: arm/instruction_end_alt.S */ + .type artMterpAsmAltInstructionEnd, #object + .hidden artMterpAsmAltInstructionEnd .global artMterpAsmAltInstructionEnd artMterpAsmAltInstructionEnd: diff --git a/runtime/interpreter/mterp/out/mterp_arm64.S b/runtime/interpreter/mterp/out/mterp_arm64.S index 2a0c4df3e2..64a0c03395 100644 --- a/runtime/interpreter/mterp/out/mterp_arm64.S +++ b/runtime/interpreter/mterp/out/mterp_arm64.S @@ -429,6 +429,8 @@ ENTRY ExecuteMterpImpl /* File: arm64/instruction_start.S */ + .type artMterpAsmInstructionStart, #object + .hidden artMterpAsmInstructionStart .global artMterpAsmInstructionStart artMterpAsmInstructionStart = .L_op_nop .text @@ -7078,6 +7080,8 @@ artMterpAsmInstructionStart = .L_op_nop .balign 128 /* File: arm64/instruction_end.S */ + .type artMterpAsmInstructionEnd, #object + .hidden artMterpAsmInstructionEnd .global artMterpAsmInstructionEnd artMterpAsmInstructionEnd: @@ -7089,6 +7093,8 @@ artMterpAsmInstructionEnd: */ /* File: arm64/instruction_start_sister.S */ + .type artMterpAsmSisterStart, #object + .hidden artMterpAsmSisterStart .global artMterpAsmSisterStart .text .balign 4 @@ -7096,6 +7102,8 @@ artMterpAsmSisterStart: /* File: arm64/instruction_end_sister.S */ + .type artMterpAsmSisterEnd, #object + .hidden artMterpAsmSisterEnd .global artMterpAsmSisterEnd artMterpAsmSisterEnd: @@ -7409,6 +7417,8 @@ MterpProfileActive: /* File: arm64/instruction_start_alt.S */ + .type artMterpAsmAltInstructionStart, #object + .hidden artMterpAsmAltInstructionStart .global artMterpAsmAltInstructionStart artMterpAsmAltInstructionStart = .L_ALT_op_nop .text @@ -11768,6 +11778,8 @@ artMterpAsmAltInstructionStart = .L_ALT_op_nop .balign 128 /* File: arm64/instruction_end_alt.S */ + .type artMterpAsmAltInstructionEnd, #object + .hidden artMterpAsmAltInstructionEnd .global artMterpAsmAltInstructionEnd artMterpAsmAltInstructionEnd: diff --git a/runtime/interpreter/mterp/out/mterp_x86.S b/runtime/interpreter/mterp/out/mterp_x86.S index 6be70cce4c..0ac23a7485 100644 --- a/runtime/interpreter/mterp/out/mterp_x86.S +++ b/runtime/interpreter/mterp/out/mterp_x86.S @@ -103,6 +103,7 @@ unspecified registers or condition codes. #if defined(__APPLE__) #define MACRO_LITERAL(value) $(value) #define FUNCTION_TYPE(name) + #define OBJECT_TYPE(name) #define SIZE(start,end) // Mac OS' symbols have an _ prefix. #define SYMBOL(name) _ ## name @@ -110,6 +111,7 @@ unspecified registers or condition codes. #else #define MACRO_LITERAL(value) $value #define FUNCTION_TYPE(name) .type name, @function + #define OBJECT_TYPE(name) .type name, @object #define SIZE(start,end) .size start, .-end #define SYMBOL(name) name #define ASM_HIDDEN .hidden @@ -407,6 +409,8 @@ SYMBOL(ExecuteMterpImpl): /* File: x86/instruction_start.S */ + OBJECT_TYPE(artMterpAsmInstructionStart) + ASM_HIDDEN SYMBOL(artMterpAsmInstructionStart) .global SYMBOL(artMterpAsmInstructionStart) SYMBOL(artMterpAsmInstructionStart) = .L_op_nop .text @@ -6473,6 +6477,8 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop .balign 128 /* File: x86/instruction_end.S */ + OBJECT_TYPE(artMterpAsmInstructionEnd) + ASM_HIDDEN SYMBOL(artMterpAsmInstructionEnd) .global SYMBOL(artMterpAsmInstructionEnd) SYMBOL(artMterpAsmInstructionEnd): @@ -6484,6 +6490,8 @@ SYMBOL(artMterpAsmInstructionEnd): */ /* File: x86/instruction_start_sister.S */ + OBJECT_TYPE(artMterpAsmSisterStart) + ASM_HIDDEN SYMBOL(artMterpAsmSisterStart) .global SYMBOL(artMterpAsmSisterStart) .text .balign 4 @@ -6491,11 +6499,15 @@ SYMBOL(artMterpAsmSisterStart): /* File: x86/instruction_end_sister.S */ + OBJECT_TYPE(artMterpAsmSisterEnd) + ASM_HIDDEN SYMBOL(artMterpAsmSisterEnd) .global SYMBOL(artMterpAsmSisterEnd) SYMBOL(artMterpAsmSisterEnd): /* File: x86/instruction_start_alt.S */ + OBJECT_TYPE(artMterpAsmAltInstructionStart) + ASM_HIDDEN SYMBOL(artMterpAsmAltInstructionStart) .global SYMBOL(artMterpAsmAltInstructionStart) .text SYMBOL(artMterpAsmAltInstructionStart) = .L_ALT_op_nop @@ -12647,6 +12659,8 @@ SYMBOL(artMterpAsmAltInstructionStart) = .L_ALT_op_nop .balign 128 /* File: x86/instruction_end_alt.S */ + OBJECT_TYPE(artMterpAsmAltInstructionEnd) + ASM_HIDDEN SYMBOL(artMterpAsmAltInstructionEnd) .global SYMBOL(artMterpAsmAltInstructionEnd) SYMBOL(artMterpAsmAltInstructionEnd): diff --git a/runtime/interpreter/mterp/out/mterp_x86_64.S b/runtime/interpreter/mterp/out/mterp_x86_64.S index 562cf7ceb6..58f75f8494 100644 --- a/runtime/interpreter/mterp/out/mterp_x86_64.S +++ b/runtime/interpreter/mterp/out/mterp_x86_64.S @@ -99,6 +99,7 @@ unspecified registers or condition codes. #if defined(__APPLE__) #define MACRO_LITERAL(value) $(value) #define FUNCTION_TYPE(name) + #define OBJECT_TYPE(name) #define SIZE(start,end) // Mac OS' symbols have an _ prefix. #define SYMBOL(name) _ ## name @@ -106,6 +107,7 @@ unspecified registers or condition codes. #else #define MACRO_LITERAL(value) $value #define FUNCTION_TYPE(name) .type name, @function + #define OBJECT_TYPE(name) .type name, @object #define SIZE(start,end) .size start, .-end #define SYMBOL(name) name #define ASM_HIDDEN .hidden @@ -389,6 +391,8 @@ SYMBOL(ExecuteMterpImpl): /* File: x86_64/instruction_start.S */ + OBJECT_TYPE(artMterpAsmInstructionStart) + ASM_HIDDEN SYMBOL(artMterpAsmInstructionStart) .global SYMBOL(artMterpAsmInstructionStart) SYMBOL(artMterpAsmInstructionStart) = .L_op_nop .text @@ -6220,6 +6224,8 @@ movswl %ax, %eax .balign 128 /* File: x86_64/instruction_end.S */ + OBJECT_TYPE(artMterpAsmInstructionEnd) + ASM_HIDDEN SYMBOL(artMterpAsmInstructionEnd) .global SYMBOL(artMterpAsmInstructionEnd) SYMBOL(artMterpAsmInstructionEnd): @@ -6231,6 +6237,8 @@ SYMBOL(artMterpAsmInstructionEnd): */ /* File: x86_64/instruction_start_sister.S */ + OBJECT_TYPE(artMterpAsmSisterStart) + ASM_HIDDEN SYMBOL(artMterpAsmSisterStart) .global SYMBOL(artMterpAsmSisterStart) .text .balign 4 @@ -6238,11 +6246,15 @@ SYMBOL(artMterpAsmSisterStart): /* File: x86_64/instruction_end_sister.S */ + OBJECT_TYPE(artMterpAsmSisterEnd) + ASM_HIDDEN SYMBOL(artMterpAsmSisterEnd) .global SYMBOL(artMterpAsmSisterEnd) SYMBOL(artMterpAsmSisterEnd): /* File: x86_64/instruction_start_alt.S */ + OBJECT_TYPE(artMterpAsmAltInstructionStart) + ASM_HIDDEN SYMBOL(artMterpAsmAltInstructionStart) .global SYMBOL(artMterpAsmAltInstructionStart) .text SYMBOL(artMterpAsmAltInstructionStart) = .L_ALT_op_nop @@ -11882,6 +11894,8 @@ SYMBOL(artMterpAsmAltInstructionStart) = .L_ALT_op_nop .balign 128 /* File: x86_64/instruction_end_alt.S */ + OBJECT_TYPE(artMterpAsmAltInstructionEnd) + ASM_HIDDEN SYMBOL(artMterpAsmAltInstructionEnd) .global SYMBOL(artMterpAsmAltInstructionEnd) SYMBOL(artMterpAsmAltInstructionEnd): diff --git a/runtime/interpreter/mterp/x86/header.S b/runtime/interpreter/mterp/x86/header.S index 6f31228005..a79db27abf 100644 --- a/runtime/interpreter/mterp/x86/header.S +++ b/runtime/interpreter/mterp/x86/header.S @@ -96,6 +96,7 @@ unspecified registers or condition codes. #if defined(__APPLE__) #define MACRO_LITERAL(value) $$(value) #define FUNCTION_TYPE(name) + #define OBJECT_TYPE(name) #define SIZE(start,end) // Mac OS' symbols have an _ prefix. #define SYMBOL(name) _ ## name @@ -103,6 +104,7 @@ unspecified registers or condition codes. #else #define MACRO_LITERAL(value) $$value #define FUNCTION_TYPE(name) .type name, @function + #define OBJECT_TYPE(name) .type name, @object #define SIZE(start,end) .size start, .-end #define SYMBOL(name) name #define ASM_HIDDEN .hidden diff --git a/runtime/interpreter/mterp/x86/instruction_end.S b/runtime/interpreter/mterp/x86/instruction_end.S index 3a02a212e6..94587f83b7 100644 --- a/runtime/interpreter/mterp/x86/instruction_end.S +++ b/runtime/interpreter/mterp/x86/instruction_end.S @@ -1,3 +1,5 @@ + OBJECT_TYPE(artMterpAsmInstructionEnd) + ASM_HIDDEN SYMBOL(artMterpAsmInstructionEnd) .global SYMBOL(artMterpAsmInstructionEnd) SYMBOL(artMterpAsmInstructionEnd): diff --git a/runtime/interpreter/mterp/x86/instruction_end_alt.S b/runtime/interpreter/mterp/x86/instruction_end_alt.S index 33c2b8e2a0..7757bce9a7 100644 --- a/runtime/interpreter/mterp/x86/instruction_end_alt.S +++ b/runtime/interpreter/mterp/x86/instruction_end_alt.S @@ -1,3 +1,5 @@ + OBJECT_TYPE(artMterpAsmAltInstructionEnd) + ASM_HIDDEN SYMBOL(artMterpAsmAltInstructionEnd) .global SYMBOL(artMterpAsmAltInstructionEnd) SYMBOL(artMterpAsmAltInstructionEnd): diff --git a/runtime/interpreter/mterp/x86/instruction_end_sister.S b/runtime/interpreter/mterp/x86/instruction_end_sister.S index ea14b11ede..8eb79accdf 100644 --- a/runtime/interpreter/mterp/x86/instruction_end_sister.S +++ b/runtime/interpreter/mterp/x86/instruction_end_sister.S @@ -1,3 +1,5 @@ + OBJECT_TYPE(artMterpAsmSisterEnd) + ASM_HIDDEN SYMBOL(artMterpAsmSisterEnd) .global SYMBOL(artMterpAsmSisterEnd) SYMBOL(artMterpAsmSisterEnd): diff --git a/runtime/interpreter/mterp/x86/instruction_start.S b/runtime/interpreter/mterp/x86/instruction_start.S index ca711de00c..5d29a81993 100644 --- a/runtime/interpreter/mterp/x86/instruction_start.S +++ b/runtime/interpreter/mterp/x86/instruction_start.S @@ -1,4 +1,6 @@ + OBJECT_TYPE(artMterpAsmInstructionStart) + ASM_HIDDEN SYMBOL(artMterpAsmInstructionStart) .global SYMBOL(artMterpAsmInstructionStart) SYMBOL(artMterpAsmInstructionStart) = .L_op_nop .text diff --git a/runtime/interpreter/mterp/x86/instruction_start_alt.S b/runtime/interpreter/mterp/x86/instruction_start_alt.S index 9272a6a7b0..8dcf5bfaf9 100644 --- a/runtime/interpreter/mterp/x86/instruction_start_alt.S +++ b/runtime/interpreter/mterp/x86/instruction_start_alt.S @@ -1,4 +1,6 @@ + OBJECT_TYPE(artMterpAsmAltInstructionStart) + ASM_HIDDEN SYMBOL(artMterpAsmAltInstructionStart) .global SYMBOL(artMterpAsmAltInstructionStart) .text SYMBOL(artMterpAsmAltInstructionStart) = .L_ALT_op_nop diff --git a/runtime/interpreter/mterp/x86/instruction_start_sister.S b/runtime/interpreter/mterp/x86/instruction_start_sister.S index b9ac994d32..796e98b09a 100644 --- a/runtime/interpreter/mterp/x86/instruction_start_sister.S +++ b/runtime/interpreter/mterp/x86/instruction_start_sister.S @@ -1,4 +1,6 @@ + OBJECT_TYPE(artMterpAsmSisterStart) + ASM_HIDDEN SYMBOL(artMterpAsmSisterStart) .global SYMBOL(artMterpAsmSisterStart) .text .balign 4 diff --git a/runtime/interpreter/mterp/x86_64/header.S b/runtime/interpreter/mterp/x86_64/header.S index 4ebe95e987..0332ce272c 100644 --- a/runtime/interpreter/mterp/x86_64/header.S +++ b/runtime/interpreter/mterp/x86_64/header.S @@ -92,6 +92,7 @@ unspecified registers or condition codes. #if defined(__APPLE__) #define MACRO_LITERAL(value) $$(value) #define FUNCTION_TYPE(name) + #define OBJECT_TYPE(name) #define SIZE(start,end) // Mac OS' symbols have an _ prefix. #define SYMBOL(name) _ ## name @@ -99,6 +100,7 @@ unspecified registers or condition codes. #else #define MACRO_LITERAL(value) $$value #define FUNCTION_TYPE(name) .type name, @function + #define OBJECT_TYPE(name) .type name, @object #define SIZE(start,end) .size start, .-end #define SYMBOL(name) name #define ASM_HIDDEN .hidden diff --git a/runtime/interpreter/mterp/x86_64/instruction_end.S b/runtime/interpreter/mterp/x86_64/instruction_end.S index 3a02a212e6..94587f83b7 100644 --- a/runtime/interpreter/mterp/x86_64/instruction_end.S +++ b/runtime/interpreter/mterp/x86_64/instruction_end.S @@ -1,3 +1,5 @@ + OBJECT_TYPE(artMterpAsmInstructionEnd) + ASM_HIDDEN SYMBOL(artMterpAsmInstructionEnd) .global SYMBOL(artMterpAsmInstructionEnd) SYMBOL(artMterpAsmInstructionEnd): diff --git a/runtime/interpreter/mterp/x86_64/instruction_end_alt.S b/runtime/interpreter/mterp/x86_64/instruction_end_alt.S index 33c2b8e2a0..7757bce9a7 100644 --- a/runtime/interpreter/mterp/x86_64/instruction_end_alt.S +++ b/runtime/interpreter/mterp/x86_64/instruction_end_alt.S @@ -1,3 +1,5 @@ + OBJECT_TYPE(artMterpAsmAltInstructionEnd) + ASM_HIDDEN SYMBOL(artMterpAsmAltInstructionEnd) .global SYMBOL(artMterpAsmAltInstructionEnd) SYMBOL(artMterpAsmAltInstructionEnd): diff --git a/runtime/interpreter/mterp/x86_64/instruction_end_sister.S b/runtime/interpreter/mterp/x86_64/instruction_end_sister.S index ea14b11ede..8eb79accdf 100644 --- a/runtime/interpreter/mterp/x86_64/instruction_end_sister.S +++ b/runtime/interpreter/mterp/x86_64/instruction_end_sister.S @@ -1,3 +1,5 @@ + OBJECT_TYPE(artMterpAsmSisterEnd) + ASM_HIDDEN SYMBOL(artMterpAsmSisterEnd) .global SYMBOL(artMterpAsmSisterEnd) SYMBOL(artMterpAsmSisterEnd): diff --git a/runtime/interpreter/mterp/x86_64/instruction_start.S b/runtime/interpreter/mterp/x86_64/instruction_start.S index ca711de00c..5d29a81993 100644 --- a/runtime/interpreter/mterp/x86_64/instruction_start.S +++ b/runtime/interpreter/mterp/x86_64/instruction_start.S @@ -1,4 +1,6 @@ + OBJECT_TYPE(artMterpAsmInstructionStart) + ASM_HIDDEN SYMBOL(artMterpAsmInstructionStart) .global SYMBOL(artMterpAsmInstructionStart) SYMBOL(artMterpAsmInstructionStart) = .L_op_nop .text diff --git a/runtime/interpreter/mterp/x86_64/instruction_start_alt.S b/runtime/interpreter/mterp/x86_64/instruction_start_alt.S index 9272a6a7b0..8dcf5bfaf9 100644 --- a/runtime/interpreter/mterp/x86_64/instruction_start_alt.S +++ b/runtime/interpreter/mterp/x86_64/instruction_start_alt.S @@ -1,4 +1,6 @@ + OBJECT_TYPE(artMterpAsmAltInstructionStart) + ASM_HIDDEN SYMBOL(artMterpAsmAltInstructionStart) .global SYMBOL(artMterpAsmAltInstructionStart) .text SYMBOL(artMterpAsmAltInstructionStart) = .L_ALT_op_nop diff --git a/runtime/interpreter/mterp/x86_64/instruction_start_sister.S b/runtime/interpreter/mterp/x86_64/instruction_start_sister.S index b9ac994d32..796e98b09a 100644 --- a/runtime/interpreter/mterp/x86_64/instruction_start_sister.S +++ b/runtime/interpreter/mterp/x86_64/instruction_start_sister.S @@ -1,4 +1,6 @@ + OBJECT_TYPE(artMterpAsmSisterStart) + ASM_HIDDEN SYMBOL(artMterpAsmSisterStart) .global SYMBOL(artMterpAsmSisterStart) .text .balign 4 -- GitLab From 61ba8d2421a98e9b16510be4f9af7ca7bc4c9055 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Tue, 7 Aug 2018 09:55:57 +0100 Subject: [PATCH 002/126] Fix longstanding bug around implicit NPEs and GC, version 2. The TODO has been there since M (so forever :)): https://android-review.googlesource.com/c/platform/art/+/122794/13//COMMIT_MSG#13 We hardly see the issue in our tests as we need to have: 1) A GC happening while creating the NPE object. 2) ParallelMoves between the NullCheck and implicit null check operation that moves references. The CL piggy backs on the "IsEmittedAtUseSite" flag, to set implicit null checks with it. The liveness analysis then special cases implicit null checks to record environment uses at the location of the actual instruction that will do the implicit null check. Test: test.py --gcstress Test: run-libcore-tests --gcstress bug: 111545159 Change-Id: I3ecea4fe0d7e483e93db83281ca10db47da228c5 --- compiler/optimizing/code_generator.cc | 31 +------- compiler/optimizing/code_generator_arm64.cc | 2 +- compiler/optimizing/codegen_test.cc | 2 +- compiler/optimizing/codegen_test_utils.h | 2 +- compiler/optimizing/live_ranges_test.cc | 2 +- compiler/optimizing/liveness_test.cc | 2 +- compiler/optimizing/nodes.h | 17 ++++- compiler/optimizing/optimizing_compiler.cc | 2 +- .../prepare_for_register_allocation.cc | 16 ++++- .../prepare_for_register_allocation.h | 11 ++- compiler/optimizing/ssa_liveness_analysis.cc | 71 +++++++++++-------- compiler/optimizing/ssa_liveness_analysis.h | 7 ++ .../src/Main.java | 40 ++++++----- test/knownfailures.json | 6 -- tools/libcore_gcstress_failures.txt | 10 --- 15 files changed, 117 insertions(+), 104 deletions(-) diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index a13efcaee2..a90ff3f885 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -1394,37 +1394,12 @@ void CodeGenerator::EmitEnvironment(HEnvironment* environment, SlowPathCode* slo } bool CodeGenerator::CanMoveNullCheckToUser(HNullCheck* null_check) { - HInstruction* first_next_not_move = null_check->GetNextDisregardingMoves(); - - return (first_next_not_move != nullptr) - && first_next_not_move->CanDoImplicitNullCheckOn(null_check->InputAt(0)); + return null_check->IsEmittedAtUseSite(); } void CodeGenerator::MaybeRecordImplicitNullCheck(HInstruction* instr) { - if (!compiler_options_.GetImplicitNullChecks()) { - return; - } - - // If we are from a static path don't record the pc as we can't throw NPE. - // NB: having the checks here makes the code much less verbose in the arch - // specific code generators. - if (instr->IsStaticFieldSet() || instr->IsStaticFieldGet()) { - return; - } - - if (!instr->CanDoImplicitNullCheckOn(instr->InputAt(0))) { - return; - } - - // Find the first previous instruction which is not a move. - HInstruction* first_prev_not_move = instr->GetPreviousDisregardingMoves(); - - // If the instruction is a null check it means that `instr` is the first user - // and needs to record the pc. - if (first_prev_not_move != nullptr && first_prev_not_move->IsNullCheck()) { - HNullCheck* null_check = first_prev_not_move->AsNullCheck(); - // TODO: The parallel moves modify the environment. Their changes need to be - // reverted otherwise the stack maps at the throw point will not be correct. + HNullCheck* null_check = instr->GetImplicitNullCheck(); + if (null_check != nullptr) { RecordPcInfo(null_check, null_check->GetDexPc()); } } diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc index 260920cb0c..4ebe12e3af 100644 --- a/compiler/optimizing/code_generator_arm64.cc +++ b/compiler/optimizing/code_generator_arm64.cc @@ -5558,7 +5558,7 @@ void CodeGeneratorARM64::GenerateImplicitNullCheck(HNullCheck* instruction) { return; } { - // Ensure that between load and MaybeRecordImplicitNullCheck there are no pools emitted. + // Ensure that between load and RecordPcInfo there are no pools emitted. EmissionCheckScope guard(GetVIXLAssembler(), kMaxMacroInstructionSizeInBytes); Location obj = instruction->GetLocations()->InAt(0); __ Ldr(wzr, HeapOperandFrom(obj, Offset(0))); diff --git a/compiler/optimizing/codegen_test.cc b/compiler/optimizing/codegen_test.cc index 86687e60a9..f186191a0f 100644 --- a/compiler/optimizing/codegen_test.cc +++ b/compiler/optimizing/codegen_test.cc @@ -453,7 +453,7 @@ TEST_F(CodegenTest, NonMaterializedCondition) { ASSERT_FALSE(equal->IsEmittedAtUseSite()); graph->BuildDominatorTree(); - PrepareForRegisterAllocation(graph).Run(); + PrepareForRegisterAllocation(graph, *compiler_options_).Run(); ASSERT_TRUE(equal->IsEmittedAtUseSite()); auto hook_before_codegen = [](HGraph* graph_in) { diff --git a/compiler/optimizing/codegen_test_utils.h b/compiler/optimizing/codegen_test_utils.h index 91811262de..8c062f03b7 100644 --- a/compiler/optimizing/codegen_test_utils.h +++ b/compiler/optimizing/codegen_test_utils.h @@ -288,7 +288,7 @@ static void RunCodeNoCheck(CodeGenerator* codegen, { ScopedArenaAllocator local_allocator(graph->GetArenaStack()); SsaLivenessAnalysis liveness(graph, codegen, &local_allocator); - PrepareForRegisterAllocation(graph).Run(); + PrepareForRegisterAllocation(graph, codegen->GetCompilerOptions()).Run(); liveness.Analyze(); std::unique_ptr register_allocator = RegisterAllocator::Create(&local_allocator, codegen, liveness); diff --git a/compiler/optimizing/live_ranges_test.cc b/compiler/optimizing/live_ranges_test.cc index 0fb90fb370..60f513ca48 100644 --- a/compiler/optimizing/live_ranges_test.cc +++ b/compiler/optimizing/live_ranges_test.cc @@ -38,7 +38,7 @@ HGraph* LiveRangesTest::BuildGraph(const std::vector& data) { // on how instructions are ordered. RemoveSuspendChecks(graph); // `Inline` conditions into ifs. - PrepareForRegisterAllocation(graph).Run(); + PrepareForRegisterAllocation(graph, *compiler_options_).Run(); return graph; } diff --git a/compiler/optimizing/liveness_test.cc b/compiler/optimizing/liveness_test.cc index 72f995e773..f11f7a9779 100644 --- a/compiler/optimizing/liveness_test.cc +++ b/compiler/optimizing/liveness_test.cc @@ -47,7 +47,7 @@ static void DumpBitVector(BitVector* vector, void LivenessTest::TestCode(const std::vector& data, const char* expected) { HGraph* graph = CreateCFG(data); // `Inline` conditions into ifs. - PrepareForRegisterAllocation(graph).Run(); + PrepareForRegisterAllocation(graph, *compiler_options_).Run(); std::unique_ptr codegen = CodeGenerator::Create(graph, *compiler_options_); SsaLivenessAnalysis liveness(graph, codegen.get(), GetScopedAllocator()); liveness.Analyze(); diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 8b9e1da0d3..d88b0364f5 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -2079,6 +2079,19 @@ class HInstruction : public ArenaObject { return false; } + // If this instruction will do an implicit null check, return the `HNullCheck` associated + // with it. Otherwise return null. + HNullCheck* GetImplicitNullCheck() const { + // Find the first previous instruction which is not a move. + HInstruction* first_prev_not_move = GetPreviousDisregardingMoves(); + if (first_prev_not_move != nullptr && + first_prev_not_move->IsNullCheck() && + first_prev_not_move->IsEmittedAtUseSite()) { + return first_prev_not_move->AsNullCheck(); + } + return nullptr; + } + virtual bool IsActualObject() const { return GetType() == DataType::Type::kReference; } @@ -4713,7 +4726,7 @@ class HInvokeVirtual FINAL : public HInvoke { bool CanDoImplicitNullCheckOn(HInstruction* obj) const OVERRIDE { // TODO: Add implicit null checks in intrinsics. - return (obj == InputAt(0)) && !GetLocations()->Intrinsified(); + return (obj == InputAt(0)) && !IsIntrinsic(); } uint32_t GetVTableIndex() const { return vtable_index_; } @@ -4753,7 +4766,7 @@ class HInvokeInterface FINAL : public HInvoke { bool CanDoImplicitNullCheckOn(HInstruction* obj) const OVERRIDE { // TODO: Add implicit null checks in intrinsics. - return (obj == InputAt(0)) && !GetLocations()->Intrinsified(); + return (obj == InputAt(0)) && !IsIntrinsic(); } bool NeedsDexCacheOfDeclaringClass() const OVERRIDE { diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index c40cbcf52a..f52b96dac9 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -570,7 +570,7 @@ static void AllocateRegisters(HGraph* graph, { PassScope scope(PrepareForRegisterAllocation::kPrepareForRegisterAllocationPassName, pass_observer); - PrepareForRegisterAllocation(graph, stats).Run(); + PrepareForRegisterAllocation(graph, codegen->GetCompilerOptions(), stats).Run(); } // Use local allocator shared by SSA liveness analysis and register allocator. // (Register allocator creates new objects in the liveness data.) diff --git a/compiler/optimizing/prepare_for_register_allocation.cc b/compiler/optimizing/prepare_for_register_allocation.cc index 060613d349..fc81740013 100644 --- a/compiler/optimizing/prepare_for_register_allocation.cc +++ b/compiler/optimizing/prepare_for_register_allocation.cc @@ -17,6 +17,7 @@ #include "prepare_for_register_allocation.h" #include "dex/dex_file_types.h" +#include "driver/compiler_options.h" #include "jni/jni_internal.h" #include "optimizing_compiler_stats.h" #include "well_known_classes.h" @@ -27,7 +28,7 @@ void PrepareForRegisterAllocation::Run() { // Order does not matter. for (HBasicBlock* block : GetGraph()->GetReversePostOrder()) { // No need to visit the phis. - for (HInstructionIterator inst_it(block->GetInstructions()); !inst_it.Done(); + for (HInstructionIteratorHandleChanges inst_it(block->GetInstructions()); !inst_it.Done(); inst_it.Advance()) { inst_it.Current()->Accept(this); } @@ -50,6 +51,19 @@ void PrepareForRegisterAllocation::VisitInstanceOf(HInstanceOf* instance_of) { void PrepareForRegisterAllocation::VisitNullCheck(HNullCheck* check) { check->ReplaceWith(check->InputAt(0)); + if (compiler_options_.GetImplicitNullChecks()) { + HInstruction* next = check->GetNext(); + + // The `PrepareForRegisterAllocation` pass removes `HBoundType` from the graph, + // so do it ourselves now to not prevent optimizations. + while (next->IsBoundType()) { + next = next->GetNext(); + VisitBoundType(next->GetPrevious()->AsBoundType()); + } + if (next->CanDoImplicitNullCheckOn(check->InputAt(0))) { + check->MarkEmittedAtUseSite(); + } + } } void PrepareForRegisterAllocation::VisitDivZeroCheck(HDivZeroCheck* check) { diff --git a/compiler/optimizing/prepare_for_register_allocation.h b/compiler/optimizing/prepare_for_register_allocation.h index f6e4d3ef99..2978add703 100644 --- a/compiler/optimizing/prepare_for_register_allocation.h +++ b/compiler/optimizing/prepare_for_register_allocation.h @@ -21,6 +21,7 @@ namespace art { +class CompilerOptions; class OptimizingCompilerStats; /** @@ -30,9 +31,11 @@ class OptimizingCompilerStats; */ class PrepareForRegisterAllocation : public HGraphDelegateVisitor { public: - explicit PrepareForRegisterAllocation(HGraph* graph, - OptimizingCompilerStats* stats = nullptr) - : HGraphDelegateVisitor(graph, stats) {} + PrepareForRegisterAllocation(HGraph* graph, + const CompilerOptions& compiler_options, + OptimizingCompilerStats* stats = nullptr) + : HGraphDelegateVisitor(graph, stats), + compiler_options_(compiler_options) {} void Run(); @@ -56,6 +59,8 @@ class PrepareForRegisterAllocation : public HGraphDelegateVisitor { bool CanMoveClinitCheck(HInstruction* input, HInstruction* user) const; bool CanEmitConditionAt(HCondition* condition, HInstruction* user) const; + const CompilerOptions& compiler_options_; + DISALLOW_COPY_AND_ASSIGN(PrepareForRegisterAllocation); }; diff --git a/compiler/optimizing/ssa_liveness_analysis.cc b/compiler/optimizing/ssa_liveness_analysis.cc index 2f782f39fc..62a70d6b12 100644 --- a/compiler/optimizing/ssa_liveness_analysis.cc +++ b/compiler/optimizing/ssa_liveness_analysis.cc @@ -103,9 +103,9 @@ void SsaLivenessAnalysis::ComputeLiveness() { ComputeLiveInAndLiveOutSets(); } -static void RecursivelyProcessInputs(HInstruction* current, - HInstruction* actual_user, - BitVector* live_in) { +void SsaLivenessAnalysis::RecursivelyProcessInputs(HInstruction* current, + HInstruction* actual_user, + BitVector* live_in) { HInputsRef inputs = current->GetInputs(); for (size_t i = 0; i < inputs.size(); ++i) { HInstruction* input = inputs[i]; @@ -131,11 +131,40 @@ static void RecursivelyProcessInputs(HInstruction* current, // Check that the inlined input is not a phi. Recursing on loop phis could // lead to an infinite loop. DCHECK(!input->IsPhi()); + DCHECK(!input->HasEnvironment()); RecursivelyProcessInputs(input, actual_user, live_in); } } } +void SsaLivenessAnalysis::ProcessEnvironment(HInstruction* current, + HInstruction* actual_user, + BitVector* live_in) { + for (HEnvironment* environment = current->GetEnvironment(); + environment != nullptr; + environment = environment->GetParent()) { + // Handle environment uses. See statements (b) and (c) of the + // SsaLivenessAnalysis. + for (size_t i = 0, e = environment->Size(); i < e; ++i) { + HInstruction* instruction = environment->GetInstructionAt(i); + if (instruction == nullptr) { + continue; + } + bool should_be_live = ShouldBeLiveForEnvironment(current, instruction); + // If this environment use does not keep the instruction live, it does not + // affect the live range of that instruction. + if (should_be_live) { + CHECK(instruction->HasSsaIndex()) << instruction->DebugName(); + live_in->SetBit(instruction->GetSsaIndex()); + instruction->GetLiveInterval()->AddUse(current, + environment, + i, + actual_user); + } + } + } +} + void SsaLivenessAnalysis::ComputeLiveRanges() { // Do a post order visit, adding inputs of instructions live in the block where // that instruction is defined, and killing instructions that are being visited. @@ -186,32 +215,6 @@ void SsaLivenessAnalysis::ComputeLiveRanges() { current->GetLiveInterval()->SetFrom(current->GetLifetimePosition()); } - // Process the environment first, because we know their uses come after - // or at the same liveness position of inputs. - for (HEnvironment* environment = current->GetEnvironment(); - environment != nullptr; - environment = environment->GetParent()) { - // Handle environment uses. See statements (b) and (c) of the - // SsaLivenessAnalysis. - for (size_t i = 0, e = environment->Size(); i < e; ++i) { - HInstruction* instruction = environment->GetInstructionAt(i); - if (instruction == nullptr) { - continue; - } - bool should_be_live = ShouldBeLiveForEnvironment(current, instruction); - // If this environment use does not keep the instruction live, it does not - // affect the live range of that instruction. - if (should_be_live) { - CHECK(instruction->HasSsaIndex()) << instruction->DebugName(); - live_in->SetBit(instruction->GetSsaIndex()); - instruction->GetLiveInterval()->AddUse(current, - environment, - i, - /* actual_user */ nullptr); - } - } - } - // Process inputs of instructions. if (current->IsEmittedAtUseSite()) { if (kIsDebugBuild) { @@ -224,6 +227,16 @@ void SsaLivenessAnalysis::ComputeLiveRanges() { DCHECK(!current->HasEnvironmentUses()); } } else { + // Process the environment first, because we know their uses come after + // or at the same liveness position of inputs. + ProcessEnvironment(current, current, live_in); + + // Special case implicit null checks. We want their environment uses to be + // emitted at the instruction doing the actual null check. + HNullCheck* check = current->GetImplicitNullCheck(); + if (check != nullptr) { + ProcessEnvironment(check, current, live_in); + } RecursivelyProcessInputs(current, current, live_in); } } diff --git a/compiler/optimizing/ssa_liveness_analysis.h b/compiler/optimizing/ssa_liveness_analysis.h index 83ca5bd5fa..cebd4adcd8 100644 --- a/compiler/optimizing/ssa_liveness_analysis.h +++ b/compiler/optimizing/ssa_liveness_analysis.h @@ -1252,6 +1252,13 @@ class SsaLivenessAnalysis : public ValueObject { // Update the live_out set of the block and returns whether it has changed. bool UpdateLiveOut(const HBasicBlock& block); + static void ProcessEnvironment(HInstruction* instruction, + HInstruction* actual_user, + BitVector* live_in); + static void RecursivelyProcessInputs(HInstruction* instruction, + HInstruction* actual_user, + BitVector* live_in); + // Returns whether `instruction` in an HEnvironment held by `env_holder` // should be kept live by the HEnvironment. static bool ShouldBeLiveForEnvironment(HInstruction* env_holder, HInstruction* instruction) { diff --git a/test/565-checker-condition-liveness/src/Main.java b/test/565-checker-condition-liveness/src/Main.java index 6b6619fa43..374e136885 100644 --- a/test/565-checker-condition-liveness/src/Main.java +++ b/test/565-checker-condition-liveness/src/Main.java @@ -32,20 +32,20 @@ public class Main { } /// CHECK-START: void Main.testThrowIntoCatchBlock(int, java.lang.Object, int[]) liveness (after) - /// CHECK-DAG: <> ParameterValue env_uses:[21,25] - /// CHECK-DAG: <> ParameterValue env_uses:[11,21,25] - /// CHECK-DAG: <> ParameterValue env_uses:[11,21,25] - /// CHECK-DAG: <> IntConstant 1 env_uses:[21,25] + /// CHECK-DAG: <> ParameterValue env_uses:[25] + /// CHECK-DAG: <> ParameterValue env_uses:[11,25] + /// CHECK-DAG: <> ParameterValue env_uses:[11,25] + /// CHECK-DAG: <> IntConstant 1 env_uses:[25] /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:10 /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:20 /// CHECK-DAG: BoundsCheck env:[[<>,<>,<>,<>]] liveness:24 /// CHECK-DAG: TryBoundary /// CHECK-START-DEBUGGABLE: void Main.testThrowIntoCatchBlock(int, java.lang.Object, int[]) liveness (after) - /// CHECK-DAG: <> ParameterValue env_uses:[11,21,25] - /// CHECK-DAG: <> ParameterValue env_uses:[11,21,25] - /// CHECK-DAG: <> ParameterValue env_uses:[11,21,25] - /// CHECK-DAG: <> IntConstant 1 env_uses:[21,25] + /// CHECK-DAG: <> ParameterValue env_uses:[11,25] + /// CHECK-DAG: <> ParameterValue env_uses:[11,25] + /// CHECK-DAG: <> ParameterValue env_uses:[11,25] + /// CHECK-DAG: <> IntConstant 1 env_uses:[25] /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:10 /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:20 /// CHECK-DAG: BoundsCheck env:[[<>,<>,<>,<>]] liveness:24 @@ -62,18 +62,18 @@ public class Main { /// CHECK-START: void Main.testBoundsCheck(int, java.lang.Object, int[]) liveness (after) /// CHECK-DAG: <> ParameterValue env_uses:[] - /// CHECK-DAG: <> ParameterValue env_uses:[11,17,21] - /// CHECK-DAG: <> ParameterValue env_uses:[11,17,21] + /// CHECK-DAG: <> ParameterValue env_uses:[11,21] + /// CHECK-DAG: <> ParameterValue env_uses:[11,21] /// CHECK-DAG: <> IntConstant 1 env_uses:[] /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:10 /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:16 /// CHECK-DAG: BoundsCheck env:[[<>,<>,<>,<>]] liveness:20 /// CHECK-START-DEBUGGABLE: void Main.testBoundsCheck(int, java.lang.Object, int[]) liveness (after) - /// CHECK-DAG: <> ParameterValue env_uses:[11,17,21] - /// CHECK-DAG: <> ParameterValue env_uses:[11,17,21] - /// CHECK-DAG: <> ParameterValue env_uses:[11,17,21] - /// CHECK-DAG: <> IntConstant 1 env_uses:[17,21] + /// CHECK-DAG: <> ParameterValue env_uses:[11,21] + /// CHECK-DAG: <> ParameterValue env_uses:[11,21] + /// CHECK-DAG: <> ParameterValue env_uses:[11,21] + /// CHECK-DAG: <> IntConstant 1 env_uses:[21] /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:10 /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:16 /// CHECK-DAG: BoundsCheck env:[[<>,<>,<>,<>]] liveness:20 @@ -83,20 +83,22 @@ public class Main { /// CHECK-START: void Main.testDeoptimize(int, java.lang.Object, int[]) liveness (after) /// CHECK-DAG: <> ParameterValue env_uses:[25] - /// CHECK-DAG: <> ParameterValue env_uses:[13,19,25] - /// CHECK-DAG: <> ParameterValue env_uses:[13,19,25] + /// CHECK-DAG: <> ParameterValue env_uses:[13,21,25] + /// CHECK-DAG: <> ParameterValue env_uses:[13,21,25] /// CHECK-DAG: <> IntConstant 0 env_uses:[25] /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:12 /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:18 + /// CHECK-DAG: ArrayLength liveness:20 /// CHECK-DAG: Deoptimize env:[[<>,<>,<>,<>]] liveness:24 /// CHECK-START-DEBUGGABLE: void Main.testDeoptimize(int, java.lang.Object, int[]) liveness (after) - /// CHECK-DAG: <> ParameterValue env_uses:[13,19,25] - /// CHECK-DAG: <> ParameterValue env_uses:[13,19,25] - /// CHECK-DAG: <> ParameterValue env_uses:[13,19,25] + /// CHECK-DAG: <> ParameterValue env_uses:[13,21,25] + /// CHECK-DAG: <> ParameterValue env_uses:[13,21,25] + /// CHECK-DAG: <> ParameterValue env_uses:[13,21,25] /// CHECK-DAG: <> IntConstant 0 env_uses:[19,25] /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:12 /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:18 + /// CHECK-DAG: ArrayLength liveness:20 /// CHECK-DAG: Deoptimize env:[[<>,<>,<>,<>]] liveness:24 // // A value that's not live in compiled code may still be needed in interpreter, diff --git a/test/knownfailures.json b/test/knownfailures.json index 7322a35884..9378bffbcb 100644 --- a/test/knownfailures.json +++ b/test/knownfailures.json @@ -1037,12 +1037,6 @@ "bug": "b/111630237", "description": ["Test timing out under gcstress possibly due to slower unwinding by libbacktrace"] }, - { - "tests": ["624-checker-stringops"], - "variant": "optimizing & gcstress | speed-profile & gcstress", - "bug": "b/111545159", - "description": ["Seem to expose some error with our gc when run in these configurations"] - }, { "tests": ["021-string2"], "variant": "jit & debuggable", diff --git a/tools/libcore_gcstress_failures.txt b/tools/libcore_gcstress_failures.txt index 6840f9ebec..965e85c359 100644 --- a/tools/libcore_gcstress_failures.txt +++ b/tools/libcore_gcstress_failures.txt @@ -33,15 +33,5 @@ "org.apache.harmony.tests.java.util.WeakHashMapTest#test_keySet_hasNext", "libcore.java.text.DecimalFormatTest#testCurrencySymbolSpacing", "libcore.java.text.SimpleDateFormatTest#testLocales"] -}, -{ - description: "GC crash", - result: EXEC_FAILED, - bug: 111545159, - names: ["org.apache.harmony.tests.java.util.AbstractSequentialListTest#test_addAllILjava_util_Collection", - "org.apache.harmony.tests.java.util.HashtableTest#test_putLjava_lang_ObjectLjava_lang_Object", - "org.apache.harmony.tests.java.util.VectorTest#test_addAllILjava_util_Collection", - "org.apache.harmony.tests.java.util.VectorTest#test_addAllLjava_util_Collection", - "org.apache.harmony.tests.java.io.BufferedWriterTest#test_write_LStringII_Exception"] } ] -- GitLab From e3015b59fb297d236f0b3ce844eef81c67e423d3 Mon Sep 17 00:00:00 2001 From: Chris Wailes Date: Wed, 22 Aug 2018 16:16:58 -0700 Subject: [PATCH 003/126] Preparing for work on string interning for AppImages. * Allow classes that have string fields to be put into AppImages. * Updated tracing messages to be more descriptive and searchable. * Added new tracing objects to more accurately report time spent in handling AppImages. Test: Built image / flashed device / ran applications Change-Id: I1b85f963b514617532ac6ec68dc3851a6625f072 --- runtime/class_linker.cc | 10 ++++++---- runtime/class_linker.h | 2 +- runtime/oat_file_manager.cc | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index f80d34ca2f..3f5943adcb 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -1233,6 +1233,8 @@ void AppImageClassLoadersAndDexCachesHelper::Update( ClassTable::ClassSet* new_class_set) REQUIRES(!Locks::dex_lock_) REQUIRES_SHARED(Locks::mutator_lock_) { + ScopedTrace app_image_timing("AppImage:Updating"); + Thread* const self = Thread::Current(); gc::Heap* const heap = Runtime::Current()->GetHeap(); const ImageHeader& header = space->GetImageHeader(); @@ -1293,7 +1295,7 @@ void AppImageClassLoadersAndDexCachesHelper::Update( } if (ClassLinker::kAppImageMayContainStrings) { // Fixup all the literal strings happens at app images which are supposed to be interned. - ScopedTrace timing("Fixup String Intern in image and dex_cache"); + ScopedTrace timing("AppImage:InternString"); const auto& image_header = space->GetImageHeader(); const auto bitmap = space->GetMarkBitmap(); // bitmap of objects const uint8_t* target_base = space->GetMemMap()->Begin(); @@ -1306,7 +1308,7 @@ void AppImageClassLoadersAndDexCachesHelper::Update( bitmap->VisitMarkedRange(objects_begin, objects_end, fixup_intern_visitor); } if (kVerifyArtMethodDeclaringClasses) { - ScopedTrace timing("Verify declaring classes"); + ScopedTrace timing("AppImage:VerifyDeclaringClasses"); ReaderMutexLock rmu(self, *Locks::heap_bitmap_lock_); VerifyDeclaringClassVisitor visitor; header.VisitPackedArtMethods(&visitor, space->Begin(), kRuntimePointerSize); @@ -1824,7 +1826,7 @@ bool ClassLinker::AddImageSpace( // Force every app image class's SubtypeCheck to be at least kIninitialized. // // See also ImageWriter::FixupClass. - ScopedTrace trace("Recalculate app image SubtypeCheck bitstrings"); + ScopedTrace trace("AppImage:RecacluateSubtypeCheckBitstrings"); MutexLock subtype_check_lock(Thread::Current(), *Locks::subtype_check_lock_); for (const ClassTable::TableSlot& root : temp_set) { SubtypeCheck>::EnsureInitialized(root.Read()); @@ -1844,7 +1846,7 @@ bool ClassLinker::AddImageSpace( if (kIsDebugBuild && app_image) { // This verification needs to happen after the classes have been added to the class loader. // Since it ensures classes are in the class table. - ScopedTrace trace("VerifyAppImage"); + ScopedTrace trace("AppImage:Verify"); VerifyAppImage(header, class_loader, dex_caches, class_table, space); } diff --git a/runtime/class_linker.h b/runtime/class_linker.h index e4d9c96696..e0a46e2d05 100644 --- a/runtime/class_linker.h +++ b/runtime/class_linker.h @@ -111,7 +111,7 @@ class AllocatorVisitor { class ClassLinker { public: - static constexpr bool kAppImageMayContainStrings = false; + static constexpr bool kAppImageMayContainStrings = true; explicit ClassLinker(InternTable* intern_table); virtual ~ClassLinker(); diff --git a/runtime/oat_file_manager.cc b/runtime/oat_file_manager.cc index 59a1045ba2..9b2b89ea40 100644 --- a/runtime/oat_file_manager.cc +++ b/runtime/oat_file_manager.cc @@ -569,6 +569,8 @@ std::vector> OatFileManager::OpenDexFilesFromOat( if (source_oat_file != nullptr) { bool added_image_space = false; if (source_oat_file->IsExecutable()) { + ScopedTrace app_image_timing("AppImage:Loading"); + // We need to throw away the image space if we are debuggable but the oat-file source of the // image is not otherwise we might get classes with inlined methods or other such things. std::unique_ptr image_space; -- GitLab From 28dfc598b4527284ccca79679a3f29b4e8b114fc Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Wed, 22 Aug 2018 15:29:09 +0100 Subject: [PATCH 004/126] Rename mterp field helper methods. Unify the names in preparation to further refactoring. Test: test-art-host-gtest Change-Id: Ibdae453cf7fa327101e6586e162954679567008b --- runtime/interpreter/mterp/arm/op_iget.S | 2 +- .../interpreter/mterp/arm/op_iget_boolean.S | 2 +- runtime/interpreter/mterp/arm/op_iget_byte.S | 2 +- runtime/interpreter/mterp/arm/op_iget_char.S | 2 +- .../interpreter/mterp/arm/op_iget_object.S | 2 +- runtime/interpreter/mterp/arm/op_iget_short.S | 2 +- runtime/interpreter/mterp/arm/op_iget_wide.S | 2 +- runtime/interpreter/mterp/arm/op_iput.S | 6 +- .../interpreter/mterp/arm/op_iput_boolean.S | 2 +- runtime/interpreter/mterp/arm/op_iput_byte.S | 2 +- runtime/interpreter/mterp/arm/op_iput_char.S | 2 +- .../interpreter/mterp/arm/op_iput_object.S | 2 +- runtime/interpreter/mterp/arm/op_iput_short.S | 2 +- runtime/interpreter/mterp/arm/op_iput_wide.S | 4 +- runtime/interpreter/mterp/arm/op_sget.S | 2 +- .../interpreter/mterp/arm/op_sget_boolean.S | 2 +- runtime/interpreter/mterp/arm/op_sget_byte.S | 2 +- runtime/interpreter/mterp/arm/op_sget_char.S | 2 +- .../interpreter/mterp/arm/op_sget_object.S | 2 +- runtime/interpreter/mterp/arm/op_sget_short.S | 2 +- runtime/interpreter/mterp/arm/op_sget_wide.S | 4 +- runtime/interpreter/mterp/arm/op_sput.S | 2 +- .../interpreter/mterp/arm/op_sput_boolean.S | 2 +- runtime/interpreter/mterp/arm/op_sput_byte.S | 2 +- runtime/interpreter/mterp/arm/op_sput_char.S | 2 +- .../interpreter/mterp/arm/op_sput_object.S | 2 +- runtime/interpreter/mterp/arm/op_sput_short.S | 2 +- runtime/interpreter/mterp/arm/op_sput_wide.S | 4 +- runtime/interpreter/mterp/arm64/op_iget.S | 2 +- .../interpreter/mterp/arm64/op_iget_boolean.S | 2 +- .../interpreter/mterp/arm64/op_iget_byte.S | 2 +- .../interpreter/mterp/arm64/op_iget_char.S | 2 +- .../interpreter/mterp/arm64/op_iget_object.S | 2 +- .../interpreter/mterp/arm64/op_iget_short.S | 2 +- .../interpreter/mterp/arm64/op_iget_wide.S | 2 +- runtime/interpreter/mterp/arm64/op_iput.S | 6 +- .../interpreter/mterp/arm64/op_iput_boolean.S | 2 +- .../interpreter/mterp/arm64/op_iput_byte.S | 2 +- .../interpreter/mterp/arm64/op_iput_char.S | 2 +- .../interpreter/mterp/arm64/op_iput_object.S | 2 +- .../interpreter/mterp/arm64/op_iput_short.S | 2 +- .../interpreter/mterp/arm64/op_iput_wide.S | 4 +- runtime/interpreter/mterp/arm64/op_sget.S | 2 +- .../interpreter/mterp/arm64/op_sget_boolean.S | 2 +- .../interpreter/mterp/arm64/op_sget_byte.S | 2 +- .../interpreter/mterp/arm64/op_sget_char.S | 2 +- .../interpreter/mterp/arm64/op_sget_object.S | 2 +- .../interpreter/mterp/arm64/op_sget_short.S | 2 +- .../interpreter/mterp/arm64/op_sget_wide.S | 4 +- runtime/interpreter/mterp/arm64/op_sput.S | 2 +- .../interpreter/mterp/arm64/op_sput_boolean.S | 2 +- .../interpreter/mterp/arm64/op_sput_byte.S | 2 +- .../interpreter/mterp/arm64/op_sput_char.S | 2 +- .../interpreter/mterp/arm64/op_sput_object.S | 2 +- .../interpreter/mterp/arm64/op_sput_short.S | 2 +- .../interpreter/mterp/arm64/op_sput_wide.S | 4 +- runtime/interpreter/mterp/mips/op_iget.S | 2 +- .../interpreter/mterp/mips/op_iget_boolean.S | 2 +- runtime/interpreter/mterp/mips/op_iget_byte.S | 2 +- runtime/interpreter/mterp/mips/op_iget_char.S | 2 +- .../interpreter/mterp/mips/op_iget_object.S | 2 +- .../interpreter/mterp/mips/op_iget_short.S | 2 +- runtime/interpreter/mterp/mips/op_iget_wide.S | 2 +- runtime/interpreter/mterp/mips/op_iput.S | 6 +- .../interpreter/mterp/mips/op_iput_boolean.S | 2 +- runtime/interpreter/mterp/mips/op_iput_byte.S | 2 +- runtime/interpreter/mterp/mips/op_iput_char.S | 2 +- .../interpreter/mterp/mips/op_iput_object.S | 2 +- .../interpreter/mterp/mips/op_iput_short.S | 2 +- runtime/interpreter/mterp/mips/op_iput_wide.S | 4 +- runtime/interpreter/mterp/mips/op_sget.S | 2 +- .../interpreter/mterp/mips/op_sget_boolean.S | 2 +- runtime/interpreter/mterp/mips/op_sget_byte.S | 2 +- runtime/interpreter/mterp/mips/op_sget_char.S | 2 +- .../interpreter/mterp/mips/op_sget_object.S | 2 +- .../interpreter/mterp/mips/op_sget_short.S | 2 +- runtime/interpreter/mterp/mips/op_sget_wide.S | 4 +- runtime/interpreter/mterp/mips/op_sput.S | 2 +- .../interpreter/mterp/mips/op_sput_boolean.S | 2 +- runtime/interpreter/mterp/mips/op_sput_byte.S | 2 +- runtime/interpreter/mterp/mips/op_sput_char.S | 2 +- .../interpreter/mterp/mips/op_sput_object.S | 2 +- .../interpreter/mterp/mips/op_sput_short.S | 2 +- runtime/interpreter/mterp/mips/op_sput_wide.S | 4 +- runtime/interpreter/mterp/mips64/op_iget.S | 2 +- .../mterp/mips64/op_iget_boolean.S | 2 +- .../interpreter/mterp/mips64/op_iget_byte.S | 2 +- .../interpreter/mterp/mips64/op_iget_char.S | 2 +- .../interpreter/mterp/mips64/op_iget_object.S | 2 +- .../interpreter/mterp/mips64/op_iget_short.S | 2 +- .../interpreter/mterp/mips64/op_iget_wide.S | 4 +- runtime/interpreter/mterp/mips64/op_iput.S | 2 +- .../mterp/mips64/op_iput_boolean.S | 2 +- .../interpreter/mterp/mips64/op_iput_byte.S | 2 +- .../interpreter/mterp/mips64/op_iput_char.S | 2 +- .../interpreter/mterp/mips64/op_iput_object.S | 4 +- .../interpreter/mterp/mips64/op_iput_short.S | 2 +- .../interpreter/mterp/mips64/op_iput_wide.S | 4 +- runtime/interpreter/mterp/mips64/op_sget.S | 2 +- .../mterp/mips64/op_sget_boolean.S | 2 +- .../interpreter/mterp/mips64/op_sget_byte.S | 2 +- .../interpreter/mterp/mips64/op_sget_char.S | 2 +- .../interpreter/mterp/mips64/op_sget_object.S | 2 +- .../interpreter/mterp/mips64/op_sget_short.S | 2 +- .../interpreter/mterp/mips64/op_sget_wide.S | 4 +- runtime/interpreter/mterp/mips64/op_sput.S | 2 +- .../mterp/mips64/op_sput_boolean.S | 2 +- .../interpreter/mterp/mips64/op_sput_byte.S | 2 +- .../interpreter/mterp/mips64/op_sput_char.S | 2 +- .../interpreter/mterp/mips64/op_sput_object.S | 4 +- .../interpreter/mterp/mips64/op_sput_short.S | 2 +- .../interpreter/mterp/mips64/op_sput_wide.S | 4 +- runtime/interpreter/mterp/mterp.cc | 188 ++++++++++-------- runtime/interpreter/mterp/out/mterp_arm.S | 84 ++++---- runtime/interpreter/mterp/out/mterp_arm64.S | 82 ++++---- runtime/interpreter/mterp/out/mterp_mips.S | 84 ++++---- runtime/interpreter/mterp/out/mterp_mips64.S | 112 +++++------ runtime/interpreter/mterp/out/mterp_x86.S | 94 ++++----- runtime/interpreter/mterp/out/mterp_x86_64.S | 94 ++++----- runtime/interpreter/mterp/x86/op_iget.S | 2 +- .../interpreter/mterp/x86/op_iget_boolean.S | 2 +- runtime/interpreter/mterp/x86/op_iget_byte.S | 2 +- runtime/interpreter/mterp/x86/op_iget_char.S | 2 +- .../interpreter/mterp/x86/op_iget_object.S | 2 +- runtime/interpreter/mterp/x86/op_iget_short.S | 2 +- runtime/interpreter/mterp/x86/op_iget_wide.S | 2 +- runtime/interpreter/mterp/x86/op_iput.S | 6 +- .../interpreter/mterp/x86/op_iput_boolean.S | 2 +- runtime/interpreter/mterp/x86/op_iput_byte.S | 2 +- runtime/interpreter/mterp/x86/op_iput_char.S | 2 +- .../interpreter/mterp/x86/op_iput_object.S | 2 +- runtime/interpreter/mterp/x86/op_iput_short.S | 2 +- runtime/interpreter/mterp/x86/op_iput_wide.S | 4 +- runtime/interpreter/mterp/x86/op_sget.S | 2 +- .../interpreter/mterp/x86/op_sget_boolean.S | 2 +- runtime/interpreter/mterp/x86/op_sget_byte.S | 2 +- runtime/interpreter/mterp/x86/op_sget_char.S | 2 +- .../interpreter/mterp/x86/op_sget_object.S | 2 +- runtime/interpreter/mterp/x86/op_sget_short.S | 2 +- runtime/interpreter/mterp/x86/op_sget_wide.S | 4 +- runtime/interpreter/mterp/x86/op_sput.S | 2 +- .../interpreter/mterp/x86/op_sput_boolean.S | 2 +- runtime/interpreter/mterp/x86/op_sput_byte.S | 2 +- runtime/interpreter/mterp/x86/op_sput_char.S | 2 +- .../interpreter/mterp/x86/op_sput_object.S | 2 +- runtime/interpreter/mterp/x86/op_sput_short.S | 2 +- runtime/interpreter/mterp/x86/op_sput_wide.S | 4 +- runtime/interpreter/mterp/x86_64/op_iget.S | 2 +- .../mterp/x86_64/op_iget_boolean.S | 2 +- .../interpreter/mterp/x86_64/op_iget_byte.S | 2 +- .../interpreter/mterp/x86_64/op_iget_char.S | 2 +- .../interpreter/mterp/x86_64/op_iget_object.S | 2 +- .../interpreter/mterp/x86_64/op_iget_short.S | 2 +- .../interpreter/mterp/x86_64/op_iget_wide.S | 2 +- runtime/interpreter/mterp/x86_64/op_iput.S | 6 +- .../mterp/x86_64/op_iput_boolean.S | 2 +- .../interpreter/mterp/x86_64/op_iput_byte.S | 2 +- .../interpreter/mterp/x86_64/op_iput_char.S | 2 +- .../interpreter/mterp/x86_64/op_iput_object.S | 2 +- .../interpreter/mterp/x86_64/op_iput_short.S | 2 +- .../interpreter/mterp/x86_64/op_iput_wide.S | 4 +- runtime/interpreter/mterp/x86_64/op_sget.S | 2 +- .../mterp/x86_64/op_sget_boolean.S | 2 +- .../interpreter/mterp/x86_64/op_sget_byte.S | 2 +- .../interpreter/mterp/x86_64/op_sget_char.S | 2 +- .../interpreter/mterp/x86_64/op_sget_object.S | 2 +- .../interpreter/mterp/x86_64/op_sget_short.S | 2 +- .../interpreter/mterp/x86_64/op_sget_wide.S | 2 +- runtime/interpreter/mterp/x86_64/op_sput.S | 2 +- .../mterp/x86_64/op_sput_boolean.S | 2 +- .../interpreter/mterp/x86_64/op_sput_byte.S | 2 +- .../interpreter/mterp/x86_64/op_sput_char.S | 2 +- .../interpreter/mterp/x86_64/op_sput_object.S | 2 +- .../interpreter/mterp/x86_64/op_sput_short.S | 2 +- .../interpreter/mterp/x86_64/op_sput_wide.S | 4 +- 175 files changed, 574 insertions(+), 560 deletions(-) diff --git a/runtime/interpreter/mterp/arm/op_iget.S b/runtime/interpreter/mterp/arm/op_iget.S index c45880b1c4..1684a768df 100644 --- a/runtime/interpreter/mterp/arm/op_iget.S +++ b/runtime/interpreter/mterp/arm/op_iget.S @@ -1,4 +1,4 @@ -%default { "is_object":"0", "helper":"artGet32InstanceFromMterp"} +%default { "is_object":"0", "helper":"MterpIGetU32"} /* * General instance field get. * diff --git a/runtime/interpreter/mterp/arm/op_iget_boolean.S b/runtime/interpreter/mterp/arm/op_iget_boolean.S index 9da6c8add6..f23cb3aa97 100644 --- a/runtime/interpreter/mterp/arm/op_iget_boolean.S +++ b/runtime/interpreter/mterp/arm/op_iget_boolean.S @@ -1 +1 @@ -%include "arm/op_iget.S" { "helper":"artGetBooleanInstanceFromMterp" } +%include "arm/op_iget.S" { "helper":"MterpIGetU8" } diff --git a/runtime/interpreter/mterp/arm/op_iget_byte.S b/runtime/interpreter/mterp/arm/op_iget_byte.S index 3d1f52d359..9c4f37c8ac 100644 --- a/runtime/interpreter/mterp/arm/op_iget_byte.S +++ b/runtime/interpreter/mterp/arm/op_iget_byte.S @@ -1 +1 @@ -%include "arm/op_iget.S" { "helper":"artGetByteInstanceFromMterp" } +%include "arm/op_iget.S" { "helper":"MterpIGetI8" } diff --git a/runtime/interpreter/mterp/arm/op_iget_char.S b/runtime/interpreter/mterp/arm/op_iget_char.S index 6b7154d8b9..80c4227ed2 100644 --- a/runtime/interpreter/mterp/arm/op_iget_char.S +++ b/runtime/interpreter/mterp/arm/op_iget_char.S @@ -1 +1 @@ -%include "arm/op_iget.S" { "helper":"artGetCharInstanceFromMterp" } +%include "arm/op_iget.S" { "helper":"MterpIGetU16" } diff --git a/runtime/interpreter/mterp/arm/op_iget_object.S b/runtime/interpreter/mterp/arm/op_iget_object.S index a35b1c8976..e30b129efe 100644 --- a/runtime/interpreter/mterp/arm/op_iget_object.S +++ b/runtime/interpreter/mterp/arm/op_iget_object.S @@ -1 +1 @@ -%include "arm/op_iget.S" { "is_object":"1", "helper":"artGetObjInstanceFromMterp" } +%include "arm/op_iget.S" { "is_object":"1", "helper":"MterpIGetObj" } diff --git a/runtime/interpreter/mterp/arm/op_iget_short.S b/runtime/interpreter/mterp/arm/op_iget_short.S index 3254c07fd1..dd6bc9991c 100644 --- a/runtime/interpreter/mterp/arm/op_iget_short.S +++ b/runtime/interpreter/mterp/arm/op_iget_short.S @@ -1 +1 @@ -%include "arm/op_iget.S" { "helper":"artGetShortInstanceFromMterp" } +%include "arm/op_iget.S" { "helper":"MterpIGetI16" } diff --git a/runtime/interpreter/mterp/arm/op_iget_wide.S b/runtime/interpreter/mterp/arm/op_iget_wide.S index 30405bd94c..46e9ec869b 100644 --- a/runtime/interpreter/mterp/arm/op_iget_wide.S +++ b/runtime/interpreter/mterp/arm/op_iget_wide.S @@ -9,7 +9,7 @@ GET_VREG r1, r1 @ r1<- fp[B], the object pointer ldr r2, [rFP, #OFF_FP_METHOD] @ r2<- referrer mov r3, rSELF @ r3<- self - bl artGet64InstanceFromMterp + bl MterpIGetU64 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] ubfx r2, rINST, #8, #4 @ r2<- A PREFETCH_INST 2 diff --git a/runtime/interpreter/mterp/arm/op_iput.S b/runtime/interpreter/mterp/arm/op_iput.S index d224cd8a77..a16795da64 100644 --- a/runtime/interpreter/mterp/arm/op_iput.S +++ b/runtime/interpreter/mterp/arm/op_iput.S @@ -1,11 +1,11 @@ -%default { "is_object":"0", "handler":"artSet32InstanceFromMterp" } +%default { "is_object":"0", "helper":"MterpIPutU32" } /* * General 32-bit instance field put. * * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern $handler + .extern $helper EXPORT_PC FETCH r0, 1 @ r0<- field ref CCCC mov r1, rINST, lsr #12 @ r1<- B @@ -14,7 +14,7 @@ GET_VREG r2, r2 @ r2<- fp[A] ldr r3, [rFP, #OFF_FP_METHOD] @ r3<- referrer PREFETCH_INST 2 - bl $handler + bl $helper cmp r0, #0 bne MterpPossibleException ADVANCE 2 @ advance rPC diff --git a/runtime/interpreter/mterp/arm/op_iput_boolean.S b/runtime/interpreter/mterp/arm/op_iput_boolean.S index c9e8589de5..57edadddd7 100644 --- a/runtime/interpreter/mterp/arm/op_iput_boolean.S +++ b/runtime/interpreter/mterp/arm/op_iput_boolean.S @@ -1 +1 @@ -%include "arm/op_iput.S" { "handler":"artSet8InstanceFromMterp" } +%include "arm/op_iput.S" { "helper":"MterpIPutU8" } diff --git a/runtime/interpreter/mterp/arm/op_iput_byte.S b/runtime/interpreter/mterp/arm/op_iput_byte.S index c9e8589de5..ab283b90fb 100644 --- a/runtime/interpreter/mterp/arm/op_iput_byte.S +++ b/runtime/interpreter/mterp/arm/op_iput_byte.S @@ -1 +1 @@ -%include "arm/op_iput.S" { "handler":"artSet8InstanceFromMterp" } +%include "arm/op_iput.S" { "helper":"MterpIPutI8" } diff --git a/runtime/interpreter/mterp/arm/op_iput_char.S b/runtime/interpreter/mterp/arm/op_iput_char.S index 5046f6b6a3..0fe5d964cc 100644 --- a/runtime/interpreter/mterp/arm/op_iput_char.S +++ b/runtime/interpreter/mterp/arm/op_iput_char.S @@ -1 +1 @@ -%include "arm/op_iput.S" { "handler":"artSet16InstanceFromMterp" } +%include "arm/op_iput.S" { "helper":"MterpIPutU16" } diff --git a/runtime/interpreter/mterp/arm/op_iput_object.S b/runtime/interpreter/mterp/arm/op_iput_object.S index d942e846f2..4f401eb4f0 100644 --- a/runtime/interpreter/mterp/arm/op_iput_object.S +++ b/runtime/interpreter/mterp/arm/op_iput_object.S @@ -3,7 +3,7 @@ mov r1, rPC mov r2, rINST mov r3, rSELF - bl MterpIputObject + bl MterpIPutObj cmp r0, #0 beq MterpException FETCH_ADVANCE_INST 2 @ advance rPC, load rINST diff --git a/runtime/interpreter/mterp/arm/op_iput_short.S b/runtime/interpreter/mterp/arm/op_iput_short.S index 5046f6b6a3..cc983630ff 100644 --- a/runtime/interpreter/mterp/arm/op_iput_short.S +++ b/runtime/interpreter/mterp/arm/op_iput_short.S @@ -1 +1 @@ -%include "arm/op_iput.S" { "handler":"artSet16InstanceFromMterp" } +%include "arm/op_iput.S" { "helper":"MterpIPutI16" } diff --git a/runtime/interpreter/mterp/arm/op_iput_wide.S b/runtime/interpreter/mterp/arm/op_iput_wide.S index 3dda1877b5..6a414738d9 100644 --- a/runtime/interpreter/mterp/arm/op_iput_wide.S +++ b/runtime/interpreter/mterp/arm/op_iput_wide.S @@ -1,5 +1,5 @@ /* iput-wide vA, vB, field@CCCC */ - .extern artSet64InstanceFromMterp + .extern MterpIPutU64 EXPORT_PC FETCH r0, 1 @ r0<- field ref CCCC mov r1, rINST, lsr #12 @ r1<- B @@ -8,7 +8,7 @@ VREG_INDEX_TO_ADDR r2, r2 @ r2<- &fp[A] ldr r3, [rFP, #OFF_FP_METHOD] @ r3<- referrer PREFETCH_INST 2 - bl artSet64InstanceFromMterp + bl MterpIPutU64 cmp r0, #0 bne MterpPossibleException ADVANCE 2 @ advance rPC diff --git a/runtime/interpreter/mterp/arm/op_sget.S b/runtime/interpreter/mterp/arm/op_sget.S index 3c813efb31..575a8c0760 100644 --- a/runtime/interpreter/mterp/arm/op_sget.S +++ b/runtime/interpreter/mterp/arm/op_sget.S @@ -1,4 +1,4 @@ -%default { "is_object":"0", "helper":"MterpGet32Static" } +%default { "is_object":"0", "helper":"MterpSGetU32" } /* * General SGET handler wrapper. * diff --git a/runtime/interpreter/mterp/arm/op_sget_boolean.S b/runtime/interpreter/mterp/arm/op_sget_boolean.S index eb06aa881c..df1a0246b5 100644 --- a/runtime/interpreter/mterp/arm/op_sget_boolean.S +++ b/runtime/interpreter/mterp/arm/op_sget_boolean.S @@ -1 +1 @@ -%include "arm/op_sget.S" {"helper":"MterpGetBooleanStatic"} +%include "arm/op_sget.S" {"helper":"MterpSGetU8"} diff --git a/runtime/interpreter/mterp/arm/op_sget_byte.S b/runtime/interpreter/mterp/arm/op_sget_byte.S index 9f4c9046a2..8ad3ff0e65 100644 --- a/runtime/interpreter/mterp/arm/op_sget_byte.S +++ b/runtime/interpreter/mterp/arm/op_sget_byte.S @@ -1 +1 @@ -%include "arm/op_sget.S" {"helper":"MterpGetByteStatic"} +%include "arm/op_sget.S" {"helper":"MterpSGetI8"} diff --git a/runtime/interpreter/mterp/arm/op_sget_char.S b/runtime/interpreter/mterp/arm/op_sget_char.S index dd8c991264..523951490a 100644 --- a/runtime/interpreter/mterp/arm/op_sget_char.S +++ b/runtime/interpreter/mterp/arm/op_sget_char.S @@ -1 +1 @@ -%include "arm/op_sget.S" {"helper":"MterpGetCharStatic"} +%include "arm/op_sget.S" {"helper":"MterpSGetU16"} diff --git a/runtime/interpreter/mterp/arm/op_sget_object.S b/runtime/interpreter/mterp/arm/op_sget_object.S index e1d9eaee29..e61a5a7b21 100644 --- a/runtime/interpreter/mterp/arm/op_sget_object.S +++ b/runtime/interpreter/mterp/arm/op_sget_object.S @@ -1 +1 @@ -%include "arm/op_sget.S" {"is_object":"1", "helper":"MterpGetObjStatic"} +%include "arm/op_sget.S" {"is_object":"1", "helper":"MterpSGetObj"} diff --git a/runtime/interpreter/mterp/arm/op_sget_short.S b/runtime/interpreter/mterp/arm/op_sget_short.S index c0d61c4d33..49493ebc68 100644 --- a/runtime/interpreter/mterp/arm/op_sget_short.S +++ b/runtime/interpreter/mterp/arm/op_sget_short.S @@ -1 +1 @@ -%include "arm/op_sget.S" {"helper":"MterpGetShortStatic"} +%include "arm/op_sget.S" {"helper":"MterpSGetI16"} diff --git a/runtime/interpreter/mterp/arm/op_sget_wide.S b/runtime/interpreter/mterp/arm/op_sget_wide.S index aeee016294..5981ec4957 100644 --- a/runtime/interpreter/mterp/arm/op_sget_wide.S +++ b/runtime/interpreter/mterp/arm/op_sget_wide.S @@ -4,12 +4,12 @@ */ /* sget-wide vAA, field@BBBB */ - .extern MterpGet64Static + .extern MterpSGetU64 EXPORT_PC FETCH r0, 1 @ r0<- field ref BBBB ldr r1, [rFP, #OFF_FP_METHOD] mov r2, rSELF - bl MterpGet64Static + bl MterpSGetU64 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] mov r9, rINST, lsr #8 @ r9<- AA VREG_INDEX_TO_ADDR lr, r9 @ r9<- &fp[AA] diff --git a/runtime/interpreter/mterp/arm/op_sput.S b/runtime/interpreter/mterp/arm/op_sput.S index 494df8aa5d..c4a8978cd1 100644 --- a/runtime/interpreter/mterp/arm/op_sput.S +++ b/runtime/interpreter/mterp/arm/op_sput.S @@ -1,4 +1,4 @@ -%default { "helper":"MterpSet32Static"} +%default { "helper":"MterpSPutU32"} /* * General SPUT handler wrapper. * diff --git a/runtime/interpreter/mterp/arm/op_sput_boolean.S b/runtime/interpreter/mterp/arm/op_sput_boolean.S index 47bed0a2ce..0c37623fb6 100644 --- a/runtime/interpreter/mterp/arm/op_sput_boolean.S +++ b/runtime/interpreter/mterp/arm/op_sput_boolean.S @@ -1 +1 @@ -%include "arm/op_sput.S" {"helper":"MterpSetBooleanStatic"} +%include "arm/op_sput.S" {"helper":"MterpSPutU8"} diff --git a/runtime/interpreter/mterp/arm/op_sput_byte.S b/runtime/interpreter/mterp/arm/op_sput_byte.S index b4d22b4fd8..8d4e754229 100644 --- a/runtime/interpreter/mterp/arm/op_sput_byte.S +++ b/runtime/interpreter/mterp/arm/op_sput_byte.S @@ -1 +1 @@ -%include "arm/op_sput.S" {"helper":"MterpSetByteStatic"} +%include "arm/op_sput.S" {"helper":"MterpSPutI8"} diff --git a/runtime/interpreter/mterp/arm/op_sput_char.S b/runtime/interpreter/mterp/arm/op_sput_char.S index 58a957d1f6..442b56f7b1 100644 --- a/runtime/interpreter/mterp/arm/op_sput_char.S +++ b/runtime/interpreter/mterp/arm/op_sput_char.S @@ -1 +1 @@ -%include "arm/op_sput.S" {"helper":"MterpSetCharStatic"} +%include "arm/op_sput.S" {"helper":"MterpSPutU16"} diff --git a/runtime/interpreter/mterp/arm/op_sput_object.S b/runtime/interpreter/mterp/arm/op_sput_object.S index 6d3a9a7110..c58918fbbb 100644 --- a/runtime/interpreter/mterp/arm/op_sput_object.S +++ b/runtime/interpreter/mterp/arm/op_sput_object.S @@ -3,7 +3,7 @@ mov r1, rPC mov r2, rINST mov r3, rSELF - bl MterpSputObject + bl MterpSPutObj cmp r0, #0 beq MterpException FETCH_ADVANCE_INST 2 @ advance rPC, load rINST diff --git a/runtime/interpreter/mterp/arm/op_sput_short.S b/runtime/interpreter/mterp/arm/op_sput_short.S index 88c321127e..0eb533fe3c 100644 --- a/runtime/interpreter/mterp/arm/op_sput_short.S +++ b/runtime/interpreter/mterp/arm/op_sput_short.S @@ -1 +1 @@ -%include "arm/op_sput.S" {"helper":"MterpSetShortStatic"} +%include "arm/op_sput.S" {"helper":"MterpSPutI16"} diff --git a/runtime/interpreter/mterp/arm/op_sput_wide.S b/runtime/interpreter/mterp/arm/op_sput_wide.S index 1e8fcc9b75..0ed4017ce9 100644 --- a/runtime/interpreter/mterp/arm/op_sput_wide.S +++ b/runtime/interpreter/mterp/arm/op_sput_wide.S @@ -3,7 +3,7 @@ * */ /* sput-wide vAA, field@BBBB */ - .extern MterpSet64Static + .extern MterpSPutU64 EXPORT_PC FETCH r0, 1 @ r0<- field ref BBBB mov r1, rINST, lsr #8 @ r1<- AA @@ -11,7 +11,7 @@ ldr r2, [rFP, #OFF_FP_METHOD] mov r3, rSELF PREFETCH_INST 2 @ Get next inst, but don't advance rPC - bl MterpSet64Static + bl MterpSPutU64 cmp r0, #0 @ 0 on success, -1 on failure bne MterpException ADVANCE 2 @ Past exception point - now advance rPC diff --git a/runtime/interpreter/mterp/arm64/op_iget.S b/runtime/interpreter/mterp/arm64/op_iget.S index d9feac7765..cb453ac524 100644 --- a/runtime/interpreter/mterp/arm64/op_iget.S +++ b/runtime/interpreter/mterp/arm64/op_iget.S @@ -1,4 +1,4 @@ -%default { "extend":"", "is_object":"0", "helper":"artGet32InstanceFromMterp"} +%default { "extend":"", "is_object":"0", "helper":"MterpIGetU32"} /* * General instance field get. * diff --git a/runtime/interpreter/mterp/arm64/op_iget_boolean.S b/runtime/interpreter/mterp/arm64/op_iget_boolean.S index f6ea4dd8b5..3b17144478 100644 --- a/runtime/interpreter/mterp/arm64/op_iget_boolean.S +++ b/runtime/interpreter/mterp/arm64/op_iget_boolean.S @@ -1 +1 @@ -%include "arm64/op_iget.S" { "helper":"artGetBooleanInstanceFromMterp", "extend":"uxtb w0, w0" } +%include "arm64/op_iget.S" { "helper":"MterpIGetU8", "extend":"uxtb w0, w0" } diff --git a/runtime/interpreter/mterp/arm64/op_iget_byte.S b/runtime/interpreter/mterp/arm64/op_iget_byte.S index 497e2bf253..d5ef1d3c2b 100644 --- a/runtime/interpreter/mterp/arm64/op_iget_byte.S +++ b/runtime/interpreter/mterp/arm64/op_iget_byte.S @@ -1 +1 @@ -%include "arm64/op_iget.S" { "helper":"artGetByteInstanceFromMterp", "extend":"sxtb w0, w0" } +%include "arm64/op_iget.S" { "helper":"MterpIGetI8", "extend":"sxtb w0, w0" } diff --git a/runtime/interpreter/mterp/arm64/op_iget_char.S b/runtime/interpreter/mterp/arm64/op_iget_char.S index 4669859121..68e1435201 100644 --- a/runtime/interpreter/mterp/arm64/op_iget_char.S +++ b/runtime/interpreter/mterp/arm64/op_iget_char.S @@ -1 +1 @@ -%include "arm64/op_iget.S" { "helper":"artGetCharInstanceFromMterp", "extend":"uxth w0, w0" } +%include "arm64/op_iget.S" { "helper":"MterpIGetU16", "extend":"uxth w0, w0" } diff --git a/runtime/interpreter/mterp/arm64/op_iget_object.S b/runtime/interpreter/mterp/arm64/op_iget_object.S index eb7bdeaee3..40ddadd971 100644 --- a/runtime/interpreter/mterp/arm64/op_iget_object.S +++ b/runtime/interpreter/mterp/arm64/op_iget_object.S @@ -1 +1 @@ -%include "arm64/op_iget.S" { "is_object":"1", "helper":"artGetObjInstanceFromMterp" } +%include "arm64/op_iget.S" { "is_object":"1", "helper":"MterpIGetObj" } diff --git a/runtime/interpreter/mterp/arm64/op_iget_short.S b/runtime/interpreter/mterp/arm64/op_iget_short.S index 6f0a5055d7..714f4b9aef 100644 --- a/runtime/interpreter/mterp/arm64/op_iget_short.S +++ b/runtime/interpreter/mterp/arm64/op_iget_short.S @@ -1 +1 @@ -%include "arm64/op_iget.S" { "helper":"artGetShortInstanceFromMterp", "extend":"sxth w0, w0" } +%include "arm64/op_iget.S" { "helper":"MterpIGetI16", "extend":"sxth w0, w0" } diff --git a/runtime/interpreter/mterp/arm64/op_iget_wide.S b/runtime/interpreter/mterp/arm64/op_iget_wide.S index 02ef0a71fd..4fc735ce6b 100644 --- a/runtime/interpreter/mterp/arm64/op_iget_wide.S +++ b/runtime/interpreter/mterp/arm64/op_iget_wide.S @@ -9,7 +9,7 @@ GET_VREG w1, w1 // w1<- fp[B], the object pointer ldr x2, [xFP, #OFF_FP_METHOD] // w2<- referrer mov x3, xSELF // w3<- self - bl artGet64InstanceFromMterp + bl MterpIGetU64 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] ubfx w2, wINST, #8, #4 // w2<- A PREFETCH_INST 2 diff --git a/runtime/interpreter/mterp/arm64/op_iput.S b/runtime/interpreter/mterp/arm64/op_iput.S index a8c0e61a8f..5e21d5c6de 100644 --- a/runtime/interpreter/mterp/arm64/op_iput.S +++ b/runtime/interpreter/mterp/arm64/op_iput.S @@ -1,11 +1,11 @@ -%default { "is_object":"0", "handler":"artSet32InstanceFromMterp" } +%default { "is_object":"0", "helper":"MterpIPutU32" } /* * General 32-bit instance field put. * * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field//CCCC */ - .extern $handler + .extern $helper EXPORT_PC FETCH w0, 1 // w0<- field ref CCCC lsr w1, wINST, #12 // w1<- B @@ -14,7 +14,7 @@ GET_VREG w2, w2 // w2<- fp[A] ldr x3, [xFP, #OFF_FP_METHOD] // w3<- referrer PREFETCH_INST 2 - bl $handler + bl $helper cbnz w0, MterpPossibleException ADVANCE 2 // advance rPC GET_INST_OPCODE ip // extract opcode from rINST diff --git a/runtime/interpreter/mterp/arm64/op_iput_boolean.S b/runtime/interpreter/mterp/arm64/op_iput_boolean.S index bbf53192c5..12a278ccba 100644 --- a/runtime/interpreter/mterp/arm64/op_iput_boolean.S +++ b/runtime/interpreter/mterp/arm64/op_iput_boolean.S @@ -1 +1 @@ -%include "arm64/op_iput.S" { "handler":"artSet8InstanceFromMterp" } +%include "arm64/op_iput.S" { "helper":"MterpIPutU8" } diff --git a/runtime/interpreter/mterp/arm64/op_iput_byte.S b/runtime/interpreter/mterp/arm64/op_iput_byte.S index bbf53192c5..82b99e9765 100644 --- a/runtime/interpreter/mterp/arm64/op_iput_byte.S +++ b/runtime/interpreter/mterp/arm64/op_iput_byte.S @@ -1 +1 @@ -%include "arm64/op_iput.S" { "handler":"artSet8InstanceFromMterp" } +%include "arm64/op_iput.S" { "helper":"MterpIPutI8" } diff --git a/runtime/interpreter/mterp/arm64/op_iput_char.S b/runtime/interpreter/mterp/arm64/op_iput_char.S index 150d8794ca..427d92d9c0 100644 --- a/runtime/interpreter/mterp/arm64/op_iput_char.S +++ b/runtime/interpreter/mterp/arm64/op_iput_char.S @@ -1 +1 @@ -%include "arm64/op_iput.S" { "handler":"artSet16InstanceFromMterp" } +%include "arm64/op_iput.S" { "helper":"MterpIPutU16" } diff --git a/runtime/interpreter/mterp/arm64/op_iput_object.S b/runtime/interpreter/mterp/arm64/op_iput_object.S index 37a649be6b..0c0441a3f0 100644 --- a/runtime/interpreter/mterp/arm64/op_iput_object.S +++ b/runtime/interpreter/mterp/arm64/op_iput_object.S @@ -3,7 +3,7 @@ mov x1, xPC mov w2, wINST mov x3, xSELF - bl MterpIputObject + bl MterpIPutObj cbz w0, MterpException FETCH_ADVANCE_INST 2 // advance rPC, load rINST GET_INST_OPCODE ip // extract opcode from rINST diff --git a/runtime/interpreter/mterp/arm64/op_iput_short.S b/runtime/interpreter/mterp/arm64/op_iput_short.S index 150d8794ca..67f1ace8bf 100644 --- a/runtime/interpreter/mterp/arm64/op_iput_short.S +++ b/runtime/interpreter/mterp/arm64/op_iput_short.S @@ -1 +1 @@ -%include "arm64/op_iput.S" { "handler":"artSet16InstanceFromMterp" } +%include "arm64/op_iput.S" { "helper":"MterpIPutI16" } diff --git a/runtime/interpreter/mterp/arm64/op_iput_wide.S b/runtime/interpreter/mterp/arm64/op_iput_wide.S index e1ab1271f5..be6aeb0e3d 100644 --- a/runtime/interpreter/mterp/arm64/op_iput_wide.S +++ b/runtime/interpreter/mterp/arm64/op_iput_wide.S @@ -1,5 +1,5 @@ /* iput-wide vA, vB, field//CCCC */ - .extern artSet64InstanceFromMterp + .extern MterpIPutU64 EXPORT_PC FETCH w0, 1 // w0<- field ref CCCC lsr w1, wINST, #12 // w1<- B @@ -8,7 +8,7 @@ VREG_INDEX_TO_ADDR x2, x2 // w2<- &fp[A] ldr x3, [xFP, #OFF_FP_METHOD] // w3<- referrer PREFETCH_INST 2 - bl artSet64InstanceFromMterp + bl MterpIPutU64 cbnz w0, MterpPossibleException ADVANCE 2 // advance rPC GET_INST_OPCODE ip // extract opcode from wINST diff --git a/runtime/interpreter/mterp/arm64/op_sget.S b/runtime/interpreter/mterp/arm64/op_sget.S index 84e71ac15e..00b07fa484 100644 --- a/runtime/interpreter/mterp/arm64/op_sget.S +++ b/runtime/interpreter/mterp/arm64/op_sget.S @@ -1,4 +1,4 @@ -%default { "is_object":"0", "helper":"MterpGet32Static", "extend":"" } +%default { "is_object":"0", "helper":"MterpSGetU32", "extend":"" } /* * General SGET handler wrapper. * diff --git a/runtime/interpreter/mterp/arm64/op_sget_boolean.S b/runtime/interpreter/mterp/arm64/op_sget_boolean.S index 868f41cb7f..73f3a107f4 100644 --- a/runtime/interpreter/mterp/arm64/op_sget_boolean.S +++ b/runtime/interpreter/mterp/arm64/op_sget_boolean.S @@ -1 +1 @@ -%include "arm64/op_sget.S" {"helper":"MterpGetBooleanStatic", "extend":"uxtb w0, w0"} +%include "arm64/op_sget.S" {"helper":"MterpSGetU8", "extend":"uxtb w0, w0"} diff --git a/runtime/interpreter/mterp/arm64/op_sget_byte.S b/runtime/interpreter/mterp/arm64/op_sget_byte.S index e135aa737a..38c0da614f 100644 --- a/runtime/interpreter/mterp/arm64/op_sget_byte.S +++ b/runtime/interpreter/mterp/arm64/op_sget_byte.S @@ -1 +1 @@ -%include "arm64/op_sget.S" {"helper":"MterpGetByteStatic", "extend":"sxtb w0, w0"} +%include "arm64/op_sget.S" {"helper":"MterpSGetI8", "extend":"sxtb w0, w0"} diff --git a/runtime/interpreter/mterp/arm64/op_sget_char.S b/runtime/interpreter/mterp/arm64/op_sget_char.S index 05d57ac20b..c0801bfa2b 100644 --- a/runtime/interpreter/mterp/arm64/op_sget_char.S +++ b/runtime/interpreter/mterp/arm64/op_sget_char.S @@ -1 +1 @@ -%include "arm64/op_sget.S" {"helper":"MterpGetCharStatic", "extend":"uxth w0, w0"} +%include "arm64/op_sget.S" {"helper":"MterpSGetU16", "extend":"uxth w0, w0"} diff --git a/runtime/interpreter/mterp/arm64/op_sget_object.S b/runtime/interpreter/mterp/arm64/op_sget_object.S index 1faaf6eb8e..69d6adb549 100644 --- a/runtime/interpreter/mterp/arm64/op_sget_object.S +++ b/runtime/interpreter/mterp/arm64/op_sget_object.S @@ -1 +1 @@ -%include "arm64/op_sget.S" {"is_object":"1", "helper":"MterpGetObjStatic"} +%include "arm64/op_sget.S" {"is_object":"1", "helper":"MterpSGetObj"} diff --git a/runtime/interpreter/mterp/arm64/op_sget_short.S b/runtime/interpreter/mterp/arm64/op_sget_short.S index 5900231b06..81e043453e 100644 --- a/runtime/interpreter/mterp/arm64/op_sget_short.S +++ b/runtime/interpreter/mterp/arm64/op_sget_short.S @@ -1 +1 @@ -%include "arm64/op_sget.S" {"helper":"MterpGetShortStatic", "extend":"sxth w0, w0"} +%include "arm64/op_sget.S" {"helper":"MterpSGetI16", "extend":"sxth w0, w0"} diff --git a/runtime/interpreter/mterp/arm64/op_sget_wide.S b/runtime/interpreter/mterp/arm64/op_sget_wide.S index 92f3f7dd66..546ab9482d 100644 --- a/runtime/interpreter/mterp/arm64/op_sget_wide.S +++ b/runtime/interpreter/mterp/arm64/op_sget_wide.S @@ -4,12 +4,12 @@ */ /* sget-wide vAA, field//BBBB */ - .extern MterpGet64StaticFromCode + .extern MterpSGetU64 EXPORT_PC FETCH w0, 1 // w0<- field ref BBBB ldr x1, [xFP, #OFF_FP_METHOD] mov x2, xSELF - bl MterpGet64Static + bl MterpSGetU64 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] lsr w4, wINST, #8 // w4<- AA cbnz x3, MterpException // bail out diff --git a/runtime/interpreter/mterp/arm64/op_sput.S b/runtime/interpreter/mterp/arm64/op_sput.S index e322af0e76..7a0dc30c52 100644 --- a/runtime/interpreter/mterp/arm64/op_sput.S +++ b/runtime/interpreter/mterp/arm64/op_sput.S @@ -1,4 +1,4 @@ -%default { "helper":"MterpSet32Static"} +%default { "helper":"MterpSPutU32"} /* * General SPUT handler wrapper. * diff --git a/runtime/interpreter/mterp/arm64/op_sput_boolean.S b/runtime/interpreter/mterp/arm64/op_sput_boolean.S index 9928f31c98..3d0c7c0262 100644 --- a/runtime/interpreter/mterp/arm64/op_sput_boolean.S +++ b/runtime/interpreter/mterp/arm64/op_sput_boolean.S @@ -1 +1 @@ -%include "arm64/op_sput.S" {"helper":"MterpSetBooleanStatic"} +%include "arm64/op_sput.S" {"helper":"MterpSPutU8"} diff --git a/runtime/interpreter/mterp/arm64/op_sput_byte.S b/runtime/interpreter/mterp/arm64/op_sput_byte.S index 16d6ba96e0..489cf92149 100644 --- a/runtime/interpreter/mterp/arm64/op_sput_byte.S +++ b/runtime/interpreter/mterp/arm64/op_sput_byte.S @@ -1 +1 @@ -%include "arm64/op_sput.S" {"helper":"MterpSetByteStatic"} +%include "arm64/op_sput.S" {"helper":"MterpSPutI8"} diff --git a/runtime/interpreter/mterp/arm64/op_sput_char.S b/runtime/interpreter/mterp/arm64/op_sput_char.S index ab5e8152b9..f79d311c17 100644 --- a/runtime/interpreter/mterp/arm64/op_sput_char.S +++ b/runtime/interpreter/mterp/arm64/op_sput_char.S @@ -1 +1 @@ -%include "arm64/op_sput.S" {"helper":"MterpSetCharStatic"} +%include "arm64/op_sput.S" {"helper":"MterpSPutU16"} diff --git a/runtime/interpreter/mterp/arm64/op_sput_object.S b/runtime/interpreter/mterp/arm64/op_sput_object.S index c176da273f..a64965614b 100644 --- a/runtime/interpreter/mterp/arm64/op_sput_object.S +++ b/runtime/interpreter/mterp/arm64/op_sput_object.S @@ -3,7 +3,7 @@ mov x1, xPC mov x2, xINST mov x3, xSELF - bl MterpSputObject + bl MterpSPutObj cbz w0, MterpException FETCH_ADVANCE_INST 2 // advance rPC, load rINST GET_INST_OPCODE ip // extract opcode from rINST diff --git a/runtime/interpreter/mterp/arm64/op_sput_short.S b/runtime/interpreter/mterp/arm64/op_sput_short.S index b54f88ad48..06482cd7a0 100644 --- a/runtime/interpreter/mterp/arm64/op_sput_short.S +++ b/runtime/interpreter/mterp/arm64/op_sput_short.S @@ -1 +1 @@ -%include "arm64/op_sput.S" {"helper":"MterpSetShortStatic"} +%include "arm64/op_sput.S" {"helper":"MterpSPutI16"} diff --git a/runtime/interpreter/mterp/arm64/op_sput_wide.S b/runtime/interpreter/mterp/arm64/op_sput_wide.S index 4aeb8ff316..58b3c42333 100644 --- a/runtime/interpreter/mterp/arm64/op_sput_wide.S +++ b/runtime/interpreter/mterp/arm64/op_sput_wide.S @@ -3,7 +3,7 @@ * */ /* sput-wide vAA, field//BBBB */ - .extern MterpSet64Static + .extern MterpSPutU64 EXPORT_PC FETCH w0, 1 // w0<- field ref BBBB lsr w1, wINST, #8 // w1<- AA @@ -11,7 +11,7 @@ ldr x2, [xFP, #OFF_FP_METHOD] mov x3, xSELF PREFETCH_INST 2 // Get next inst, but don't advance rPC - bl MterpSet64Static + bl MterpSPutU64 cbnz w0, MterpException // 0 on success, -1 on failure ADVANCE 2 // Past exception point - now advance rPC GET_INST_OPCODE ip // extract opcode from wINST diff --git a/runtime/interpreter/mterp/mips/op_iget.S b/runtime/interpreter/mterp/mips/op_iget.S index 0785ac5e32..33717de640 100644 --- a/runtime/interpreter/mterp/mips/op_iget.S +++ b/runtime/interpreter/mterp/mips/op_iget.S @@ -1,4 +1,4 @@ -%default { "is_object":"0", "helper":"artGet32InstanceFromMterp"} +%default { "is_object":"0", "helper":"MterpIGetU32"} /* * General instance field get. * diff --git a/runtime/interpreter/mterp/mips/op_iget_boolean.S b/runtime/interpreter/mterp/mips/op_iget_boolean.S index a932c37a82..f2ef68d8b2 100644 --- a/runtime/interpreter/mterp/mips/op_iget_boolean.S +++ b/runtime/interpreter/mterp/mips/op_iget_boolean.S @@ -1 +1 @@ -%include "mips/op_iget.S" { "helper":"artGetBooleanInstanceFromMterp" } +%include "mips/op_iget.S" { "helper":"MterpIGetU8" } diff --git a/runtime/interpreter/mterp/mips/op_iget_byte.S b/runtime/interpreter/mterp/mips/op_iget_byte.S index e498a8c774..0c8fb7cf2c 100644 --- a/runtime/interpreter/mterp/mips/op_iget_byte.S +++ b/runtime/interpreter/mterp/mips/op_iget_byte.S @@ -1 +1 @@ -%include "mips/op_iget.S" { "helper":"artGetByteInstanceFromMterp" } +%include "mips/op_iget.S" { "helper":"MterpIGetI8" } diff --git a/runtime/interpreter/mterp/mips/op_iget_char.S b/runtime/interpreter/mterp/mips/op_iget_char.S index efd5b99372..69d04c4fa8 100644 --- a/runtime/interpreter/mterp/mips/op_iget_char.S +++ b/runtime/interpreter/mterp/mips/op_iget_char.S @@ -1 +1 @@ -%include "mips/op_iget.S" { "helper":"artGetCharInstanceFromMterp" } +%include "mips/op_iget.S" { "helper":"MterpIGetU16" } diff --git a/runtime/interpreter/mterp/mips/op_iget_object.S b/runtime/interpreter/mterp/mips/op_iget_object.S index 8fa96521f6..bea330a14b 100644 --- a/runtime/interpreter/mterp/mips/op_iget_object.S +++ b/runtime/interpreter/mterp/mips/op_iget_object.S @@ -1 +1 @@ -%include "mips/op_iget.S" { "is_object":"1", "helper":"artGetObjInstanceFromMterp" } +%include "mips/op_iget.S" { "is_object":"1", "helper":"MterpIGetObj" } diff --git a/runtime/interpreter/mterp/mips/op_iget_short.S b/runtime/interpreter/mterp/mips/op_iget_short.S index efc5de4890..357c7918e4 100644 --- a/runtime/interpreter/mterp/mips/op_iget_short.S +++ b/runtime/interpreter/mterp/mips/op_iget_short.S @@ -1 +1 @@ -%include "mips/op_iget.S" { "helper":"artGetShortInstanceFromMterp" } +%include "mips/op_iget.S" { "helper":"MterpIGetI16" } diff --git a/runtime/interpreter/mterp/mips/op_iget_wide.S b/runtime/interpreter/mterp/mips/op_iget_wide.S index e1d83a48f5..858a8898f4 100644 --- a/runtime/interpreter/mterp/mips/op_iget_wide.S +++ b/runtime/interpreter/mterp/mips/op_iget_wide.S @@ -10,7 +10,7 @@ GET_VREG(a1, a1) # a1 <- fp[B], the object pointer lw a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - JAL(artGet64InstanceFromMterp) + JAL(MterpIGetU64) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA4(a2) # a2<- A+ PREFETCH_INST(2) # load rINST diff --git a/runtime/interpreter/mterp/mips/op_iput.S b/runtime/interpreter/mterp/mips/op_iput.S index 9133d60ed8..4dd4075e92 100644 --- a/runtime/interpreter/mterp/mips/op_iput.S +++ b/runtime/interpreter/mterp/mips/op_iput.S @@ -1,11 +1,11 @@ -%default { "handler":"artSet32InstanceFromMterp" } +%default { "helper":"MterpIPutU32" } /* * General 32-bit instance field put. * * for: iput, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern $handler + .extern $helper EXPORT_PC() FETCH(a0, 1) # a0 <- field ref CCCC GET_OPB(a1) # a1 <- B @@ -14,7 +14,7 @@ GET_VREG(a2, a2) # a2 <- fp[A] lw a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST(2) # load rINST - JAL($handler) + JAL($helper) bnez v0, MterpPossibleException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST diff --git a/runtime/interpreter/mterp/mips/op_iput_boolean.S b/runtime/interpreter/mterp/mips/op_iput_boolean.S index da28c978a4..55ac4cedaa 100644 --- a/runtime/interpreter/mterp/mips/op_iput_boolean.S +++ b/runtime/interpreter/mterp/mips/op_iput_boolean.S @@ -1 +1 @@ -%include "mips/op_iput.S" { "handler":"artSet8InstanceFromMterp" } +%include "mips/op_iput.S" { "helper":"MterpIPutU8" } diff --git a/runtime/interpreter/mterp/mips/op_iput_byte.S b/runtime/interpreter/mterp/mips/op_iput_byte.S index da28c978a4..61e489be11 100644 --- a/runtime/interpreter/mterp/mips/op_iput_byte.S +++ b/runtime/interpreter/mterp/mips/op_iput_byte.S @@ -1 +1 @@ -%include "mips/op_iput.S" { "handler":"artSet8InstanceFromMterp" } +%include "mips/op_iput.S" { "helper":"MterpIPutI8" } diff --git a/runtime/interpreter/mterp/mips/op_iput_char.S b/runtime/interpreter/mterp/mips/op_iput_char.S index 389b0bf19b..2caad1e0a6 100644 --- a/runtime/interpreter/mterp/mips/op_iput_char.S +++ b/runtime/interpreter/mterp/mips/op_iput_char.S @@ -1 +1 @@ -%include "mips/op_iput.S" { "handler":"artSet16InstanceFromMterp" } +%include "mips/op_iput.S" { "helper":"MterpIPutU16" } diff --git a/runtime/interpreter/mterp/mips/op_iput_object.S b/runtime/interpreter/mterp/mips/op_iput_object.S index cfa56ec657..c96a4d4ec7 100644 --- a/runtime/interpreter/mterp/mips/op_iput_object.S +++ b/runtime/interpreter/mterp/mips/op_iput_object.S @@ -9,7 +9,7 @@ move a1, rPC move a2, rINST move a3, rSELF - JAL(MterpIputObject) + JAL(MterpIPutObj) beqz v0, MterpException FETCH_ADVANCE_INST(2) # advance rPC, load rINST GET_INST_OPCODE(t0) # extract opcode from rINST diff --git a/runtime/interpreter/mterp/mips/op_iput_short.S b/runtime/interpreter/mterp/mips/op_iput_short.S index 389b0bf19b..414a15bd70 100644 --- a/runtime/interpreter/mterp/mips/op_iput_short.S +++ b/runtime/interpreter/mterp/mips/op_iput_short.S @@ -1 +1 @@ -%include "mips/op_iput.S" { "handler":"artSet16InstanceFromMterp" } +%include "mips/op_iput.S" { "helper":"MterpIPutI16" } diff --git a/runtime/interpreter/mterp/mips/op_iput_wide.S b/runtime/interpreter/mterp/mips/op_iput_wide.S index bc3d758c5e..dccb6b71b1 100644 --- a/runtime/interpreter/mterp/mips/op_iput_wide.S +++ b/runtime/interpreter/mterp/mips/op_iput_wide.S @@ -1,5 +1,5 @@ /* iput-wide vA, vB, field@CCCC */ - .extern artSet64InstanceFromMterp + .extern MterpIPutU64 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref CCCC GET_OPB(a1) # a1 <- B @@ -8,7 +8,7 @@ EAS2(a2, rFP, a2) # a2 <- &fp[A] lw a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST(2) # load rINST - JAL(artSet64InstanceFromMterp) + JAL(MterpIPutU64) bnez v0, MterpPossibleException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST diff --git a/runtime/interpreter/mterp/mips/op_sget.S b/runtime/interpreter/mterp/mips/op_sget.S index 635df8aa1f..8750a17a41 100644 --- a/runtime/interpreter/mterp/mips/op_sget.S +++ b/runtime/interpreter/mterp/mips/op_sget.S @@ -1,4 +1,4 @@ -%default { "is_object":"0", "helper":"MterpGet32Static" } +%default { "is_object":"0", "helper":"MterpSGetU32" } /* * General SGET handler. * diff --git a/runtime/interpreter/mterp/mips/op_sget_boolean.S b/runtime/interpreter/mterp/mips/op_sget_boolean.S index 7829970d84..7a7012e81f 100644 --- a/runtime/interpreter/mterp/mips/op_sget_boolean.S +++ b/runtime/interpreter/mterp/mips/op_sget_boolean.S @@ -1 +1 @@ -%include "mips/op_sget.S" {"helper":"MterpGetBooleanStatic"} +%include "mips/op_sget.S" {"helper":"MterpSGetU8"} diff --git a/runtime/interpreter/mterp/mips/op_sget_byte.S b/runtime/interpreter/mterp/mips/op_sget_byte.S index ee0834201b..a2f1dbf606 100644 --- a/runtime/interpreter/mterp/mips/op_sget_byte.S +++ b/runtime/interpreter/mterp/mips/op_sget_byte.S @@ -1 +1 @@ -%include "mips/op_sget.S" {"helper":"MterpGetByteStatic"} +%include "mips/op_sget.S" {"helper":"MterpSGetI8"} diff --git a/runtime/interpreter/mterp/mips/op_sget_char.S b/runtime/interpreter/mterp/mips/op_sget_char.S index d8b477a7bc..07d40416a3 100644 --- a/runtime/interpreter/mterp/mips/op_sget_char.S +++ b/runtime/interpreter/mterp/mips/op_sget_char.S @@ -1 +1 @@ -%include "mips/op_sget.S" {"helper":"MterpGetCharStatic"} +%include "mips/op_sget.S" {"helper":"MterpSGetU16"} diff --git a/runtime/interpreter/mterp/mips/op_sget_object.S b/runtime/interpreter/mterp/mips/op_sget_object.S index 2dc00c386c..0a3c9eef88 100644 --- a/runtime/interpreter/mterp/mips/op_sget_object.S +++ b/runtime/interpreter/mterp/mips/op_sget_object.S @@ -1 +1 @@ -%include "mips/op_sget.S" {"is_object":"1", "helper":"MterpGetObjStatic"} +%include "mips/op_sget.S" {"is_object":"1", "helper":"MterpSGetObj"} diff --git a/runtime/interpreter/mterp/mips/op_sget_short.S b/runtime/interpreter/mterp/mips/op_sget_short.S index ab55d93060..29604430f2 100644 --- a/runtime/interpreter/mterp/mips/op_sget_short.S +++ b/runtime/interpreter/mterp/mips/op_sget_short.S @@ -1 +1 @@ -%include "mips/op_sget.S" {"helper":"MterpGetShortStatic"} +%include "mips/op_sget.S" {"helper":"MterpSGetI16"} diff --git a/runtime/interpreter/mterp/mips/op_sget_wide.S b/runtime/interpreter/mterp/mips/op_sget_wide.S index ec4295ad03..76f78cb35d 100644 --- a/runtime/interpreter/mterp/mips/op_sget_wide.S +++ b/runtime/interpreter/mterp/mips/op_sget_wide.S @@ -2,12 +2,12 @@ * 64-bit SGET handler. */ /* sget-wide vAA, field@BBBB */ - .extern MterpGet64Static + .extern MterpSGetU64 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref BBBB lw a1, OFF_FP_METHOD(rFP) # a1 <- method move a2, rSELF # a2 <- self - JAL(MterpGet64Static) + JAL(MterpSGetU64) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) bnez a3, MterpException GET_OPA(a1) # a1 <- AA diff --git a/runtime/interpreter/mterp/mips/op_sput.S b/runtime/interpreter/mterp/mips/op_sput.S index 37f8687aaa..547de3964a 100644 --- a/runtime/interpreter/mterp/mips/op_sput.S +++ b/runtime/interpreter/mterp/mips/op_sput.S @@ -1,4 +1,4 @@ -%default { "helper":"MterpSet32Static"} +%default { "helper":"MterpSPutU32"} /* * General SPUT handler. * diff --git a/runtime/interpreter/mterp/mips/op_sput_boolean.S b/runtime/interpreter/mterp/mips/op_sput_boolean.S index 6426cd40eb..0137430acc 100644 --- a/runtime/interpreter/mterp/mips/op_sput_boolean.S +++ b/runtime/interpreter/mterp/mips/op_sput_boolean.S @@ -1 +1 @@ -%include "mips/op_sput.S" {"helper":"MterpSetBooleanStatic"} +%include "mips/op_sput.S" {"helper":"MterpSPutU8"} diff --git a/runtime/interpreter/mterp/mips/op_sput_byte.S b/runtime/interpreter/mterp/mips/op_sput_byte.S index c68d18f2f7..5ae4256a98 100644 --- a/runtime/interpreter/mterp/mips/op_sput_byte.S +++ b/runtime/interpreter/mterp/mips/op_sput_byte.S @@ -1 +1 @@ -%include "mips/op_sput.S" {"helper":"MterpSetByteStatic"} +%include "mips/op_sput.S" {"helper":"MterpSPutI8"} diff --git a/runtime/interpreter/mterp/mips/op_sput_char.S b/runtime/interpreter/mterp/mips/op_sput_char.S index 9b8983e4c6..83787a7753 100644 --- a/runtime/interpreter/mterp/mips/op_sput_char.S +++ b/runtime/interpreter/mterp/mips/op_sput_char.S @@ -1 +1 @@ -%include "mips/op_sput.S" {"helper":"MterpSetCharStatic"} +%include "mips/op_sput.S" {"helper":"MterpSPutU16"} diff --git a/runtime/interpreter/mterp/mips/op_sput_object.S b/runtime/interpreter/mterp/mips/op_sput_object.S index 4f9034ec0e..55c88a6816 100644 --- a/runtime/interpreter/mterp/mips/op_sput_object.S +++ b/runtime/interpreter/mterp/mips/op_sput_object.S @@ -9,7 +9,7 @@ move a1, rPC move a2, rINST move a3, rSELF - JAL(MterpSputObject) + JAL(MterpSPutObj) beqz v0, MterpException FETCH_ADVANCE_INST(2) # advance rPC, load rINST GET_INST_OPCODE(t0) # extract opcode from rINST diff --git a/runtime/interpreter/mterp/mips/op_sput_short.S b/runtime/interpreter/mterp/mips/op_sput_short.S index 5a57ed9922..df99b4414d 100644 --- a/runtime/interpreter/mterp/mips/op_sput_short.S +++ b/runtime/interpreter/mterp/mips/op_sput_short.S @@ -1 +1 @@ -%include "mips/op_sput.S" {"helper":"MterpSetShortStatic"} +%include "mips/op_sput.S" {"helper":"MterpSPutI16"} diff --git a/runtime/interpreter/mterp/mips/op_sput_wide.S b/runtime/interpreter/mterp/mips/op_sput_wide.S index c090007968..cfaaaee6f3 100644 --- a/runtime/interpreter/mterp/mips/op_sput_wide.S +++ b/runtime/interpreter/mterp/mips/op_sput_wide.S @@ -2,7 +2,7 @@ * 64-bit SPUT handler. */ /* sput-wide vAA, field@BBBB */ - .extern MterpSet64Static + .extern MterpSPutU64 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref CCCC GET_OPA(a1) # a1 <- AA @@ -10,7 +10,7 @@ lw a2, OFF_FP_METHOD(rFP) # a2 <- method move a3, rSELF # a3 <- self PREFETCH_INST(2) # load rINST - JAL(MterpSet64Static) + JAL(MterpSPutU64) bnez v0, MterpException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST diff --git a/runtime/interpreter/mterp/mips64/op_iget.S b/runtime/interpreter/mterp/mips64/op_iget.S index 4158603e4a..a8ce94c3ba 100644 --- a/runtime/interpreter/mterp/mips64/op_iget.S +++ b/runtime/interpreter/mterp/mips64/op_iget.S @@ -1,4 +1,4 @@ -%default { "is_object":"0", "helper":"artGet32InstanceFromMterp"} +%default { "is_object":"0", "helper":"MterpIGetU32"} /* * General instance field get. * diff --git a/runtime/interpreter/mterp/mips64/op_iget_boolean.S b/runtime/interpreter/mterp/mips64/op_iget_boolean.S index e64b7982f8..dc2a42ad76 100644 --- a/runtime/interpreter/mterp/mips64/op_iget_boolean.S +++ b/runtime/interpreter/mterp/mips64/op_iget_boolean.S @@ -1 +1 @@ -%include "mips64/op_iget.S" { "helper":"artGetBooleanInstanceFromMterp" } +%include "mips64/op_iget.S" { "helper":"MterpIGetU8" } diff --git a/runtime/interpreter/mterp/mips64/op_iget_byte.S b/runtime/interpreter/mterp/mips64/op_iget_byte.S index fefe53f308..c5bf6506e6 100644 --- a/runtime/interpreter/mterp/mips64/op_iget_byte.S +++ b/runtime/interpreter/mterp/mips64/op_iget_byte.S @@ -1 +1 @@ -%include "mips64/op_iget.S" { "helper":"artGetByteInstanceFromMterp" } +%include "mips64/op_iget.S" { "helper":"MterpIGetI8" } diff --git a/runtime/interpreter/mterp/mips64/op_iget_char.S b/runtime/interpreter/mterp/mips64/op_iget_char.S index 9caf40ecff..3bf0c5aab9 100644 --- a/runtime/interpreter/mterp/mips64/op_iget_char.S +++ b/runtime/interpreter/mterp/mips64/op_iget_char.S @@ -1 +1 @@ -%include "mips64/op_iget.S" { "helper":"artGetCharInstanceFromMterp" } +%include "mips64/op_iget.S" { "helper":"MterpIGetU16" } diff --git a/runtime/interpreter/mterp/mips64/op_iget_object.S b/runtime/interpreter/mterp/mips64/op_iget_object.S index ce3421a94f..23fa187192 100644 --- a/runtime/interpreter/mterp/mips64/op_iget_object.S +++ b/runtime/interpreter/mterp/mips64/op_iget_object.S @@ -1 +1 @@ -%include "mips64/op_iget.S" { "is_object":"1", "helper":"artGetObjInstanceFromMterp" } +%include "mips64/op_iget.S" { "is_object":"1", "helper":"MterpIGetObj" } diff --git a/runtime/interpreter/mterp/mips64/op_iget_short.S b/runtime/interpreter/mterp/mips64/op_iget_short.S index e2d122d2af..a9927fc982 100644 --- a/runtime/interpreter/mterp/mips64/op_iget_short.S +++ b/runtime/interpreter/mterp/mips64/op_iget_short.S @@ -1 +1 @@ -%include "mips64/op_iget.S" { "helper":"artGetShortInstanceFromMterp" } +%include "mips64/op_iget.S" { "helper":"MterpIGetI16" } diff --git a/runtime/interpreter/mterp/mips64/op_iget_wide.S b/runtime/interpreter/mterp/mips64/op_iget_wide.S index ca793e0a27..08bf544265 100644 --- a/runtime/interpreter/mterp/mips64/op_iget_wide.S +++ b/runtime/interpreter/mterp/mips64/op_iget_wide.S @@ -3,14 +3,14 @@ * * for: iget-wide */ - .extern artGet64InstanceFromMterp + .extern MterpIGetU64 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B GET_VREG_U a1, a1 # a1 <- fp[B], the object pointer ld a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - jal artGet64InstanceFromMterp + jal MterpIGetU64 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) ext a2, rINST, 8, 4 # a2 <- A PREFETCH_INST 2 diff --git a/runtime/interpreter/mterp/mips64/op_iput.S b/runtime/interpreter/mterp/mips64/op_iput.S index a906a0fc82..9a789e612d 100644 --- a/runtime/interpreter/mterp/mips64/op_iput.S +++ b/runtime/interpreter/mterp/mips64/op_iput.S @@ -1,4 +1,4 @@ -%default { "helper":"artSet32InstanceFromMterp" } +%default { "helper":"MterpIPutU32" } /* * General 32-bit instance field put. * diff --git a/runtime/interpreter/mterp/mips64/op_iput_boolean.S b/runtime/interpreter/mterp/mips64/op_iput_boolean.S index 3034fa59d5..8e1d083759 100644 --- a/runtime/interpreter/mterp/mips64/op_iput_boolean.S +++ b/runtime/interpreter/mterp/mips64/op_iput_boolean.S @@ -1 +1 @@ -%include "mips64/op_iput.S" { "helper":"artSet8InstanceFromMterp" } +%include "mips64/op_iput.S" { "helper":"MterpIPutU8" } diff --git a/runtime/interpreter/mterp/mips64/op_iput_byte.S b/runtime/interpreter/mterp/mips64/op_iput_byte.S index 3034fa59d5..ce3b614b0c 100644 --- a/runtime/interpreter/mterp/mips64/op_iput_byte.S +++ b/runtime/interpreter/mterp/mips64/op_iput_byte.S @@ -1 +1 @@ -%include "mips64/op_iput.S" { "helper":"artSet8InstanceFromMterp" } +%include "mips64/op_iput.S" { "helper":"MterpIPutI8" } diff --git a/runtime/interpreter/mterp/mips64/op_iput_char.S b/runtime/interpreter/mterp/mips64/op_iput_char.S index 4c2fa28776..1d587fad6b 100644 --- a/runtime/interpreter/mterp/mips64/op_iput_char.S +++ b/runtime/interpreter/mterp/mips64/op_iput_char.S @@ -1 +1 @@ -%include "mips64/op_iput.S" { "helper":"artSet16InstanceFromMterp" } +%include "mips64/op_iput.S" { "helper":"MterpIPutU16" } diff --git a/runtime/interpreter/mterp/mips64/op_iput_object.S b/runtime/interpreter/mterp/mips64/op_iput_object.S index 9a42f54669..dd1938ec63 100644 --- a/runtime/interpreter/mterp/mips64/op_iput_object.S +++ b/runtime/interpreter/mterp/mips64/op_iput_object.S @@ -1,10 +1,10 @@ - .extern MterpIputObject + .extern MterpIPutObj EXPORT_PC daddu a0, rFP, OFF_FP_SHADOWFRAME move a1, rPC move a2, rINST move a3, rSELF - jal MterpIputObject + jal MterpIPutObj beqzc v0, MterpException FETCH_ADVANCE_INST 2 # advance rPC, load rINST GET_INST_OPCODE v0 # extract opcode from rINST diff --git a/runtime/interpreter/mterp/mips64/op_iput_short.S b/runtime/interpreter/mterp/mips64/op_iput_short.S index 4c2fa28776..dd68bbeaaa 100644 --- a/runtime/interpreter/mterp/mips64/op_iput_short.S +++ b/runtime/interpreter/mterp/mips64/op_iput_short.S @@ -1 +1 @@ -%include "mips64/op_iput.S" { "helper":"artSet16InstanceFromMterp" } +%include "mips64/op_iput.S" { "helper":"MterpIPutI16" } diff --git a/runtime/interpreter/mterp/mips64/op_iput_wide.S b/runtime/interpreter/mterp/mips64/op_iput_wide.S index 9b790f812a..62726908fb 100644 --- a/runtime/interpreter/mterp/mips64/op_iput_wide.S +++ b/runtime/interpreter/mterp/mips64/op_iput_wide.S @@ -1,5 +1,5 @@ /* iput-wide vA, vB, field//CCCC */ - .extern artSet64InstanceFromMterp + .extern MterpIPutU64 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B @@ -8,7 +8,7 @@ dlsa a2, a2, rFP, 2 # a2 <- &fp[A] ld a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST 2 - jal artSet64InstanceFromMterp + jal MterpIPutU64 bnez v0, MterpPossibleException # bail out ADVANCE 2 GET_INST_OPCODE v0 # extract opcode from rINST diff --git a/runtime/interpreter/mterp/mips64/op_sget.S b/runtime/interpreter/mterp/mips64/op_sget.S index 71046dba1a..b7b0382b1c 100644 --- a/runtime/interpreter/mterp/mips64/op_sget.S +++ b/runtime/interpreter/mterp/mips64/op_sget.S @@ -1,4 +1,4 @@ -%default { "is_object":"0", "helper":"MterpGet32Static", "extend":"" } +%default { "is_object":"0", "helper":"MterpSGetU32", "extend":"" } /* * General SGET handler wrapper. * diff --git a/runtime/interpreter/mterp/mips64/op_sget_boolean.S b/runtime/interpreter/mterp/mips64/op_sget_boolean.S index ec1ce9eb14..fe2deb1479 100644 --- a/runtime/interpreter/mterp/mips64/op_sget_boolean.S +++ b/runtime/interpreter/mterp/mips64/op_sget_boolean.S @@ -1 +1 @@ -%include "mips64/op_sget.S" {"helper":"MterpGetBooleanStatic", "extend":"and v0, v0, 0xff"} +%include "mips64/op_sget.S" {"helper":"MterpSGetU8", "extend":"and v0, v0, 0xff"} diff --git a/runtime/interpreter/mterp/mips64/op_sget_byte.S b/runtime/interpreter/mterp/mips64/op_sget_byte.S index 6a802f63ea..a7e2bef4bc 100644 --- a/runtime/interpreter/mterp/mips64/op_sget_byte.S +++ b/runtime/interpreter/mterp/mips64/op_sget_byte.S @@ -1 +1 @@ -%include "mips64/op_sget.S" {"helper":"MterpGetByteStatic", "extend":"seb v0, v0"} +%include "mips64/op_sget.S" {"helper":"MterpSGetI8", "extend":"seb v0, v0"} diff --git a/runtime/interpreter/mterp/mips64/op_sget_char.S b/runtime/interpreter/mterp/mips64/op_sget_char.S index 483d085719..ed86f32588 100644 --- a/runtime/interpreter/mterp/mips64/op_sget_char.S +++ b/runtime/interpreter/mterp/mips64/op_sget_char.S @@ -1 +1 @@ -%include "mips64/op_sget.S" {"helper":"MterpGetCharStatic", "extend":"and v0, v0, 0xffff"} +%include "mips64/op_sget.S" {"helper":"MterpSGetU16", "extend":"and v0, v0, 0xffff"} diff --git a/runtime/interpreter/mterp/mips64/op_sget_object.S b/runtime/interpreter/mterp/mips64/op_sget_object.S index 2250696a97..3b260e6ee2 100644 --- a/runtime/interpreter/mterp/mips64/op_sget_object.S +++ b/runtime/interpreter/mterp/mips64/op_sget_object.S @@ -1 +1 @@ -%include "mips64/op_sget.S" {"is_object":"1", "helper":"MterpGetObjStatic"} +%include "mips64/op_sget.S" {"is_object":"1", "helper":"MterpSGetObj"} diff --git a/runtime/interpreter/mterp/mips64/op_sget_short.S b/runtime/interpreter/mterp/mips64/op_sget_short.S index b257bbbba1..f708a201ce 100644 --- a/runtime/interpreter/mterp/mips64/op_sget_short.S +++ b/runtime/interpreter/mterp/mips64/op_sget_short.S @@ -1 +1 @@ -%include "mips64/op_sget.S" {"helper":"MterpGetShortStatic", "extend":"seh v0, v0"} +%include "mips64/op_sget.S" {"helper":"MterpSGetI16", "extend":"seh v0, v0"} diff --git a/runtime/interpreter/mterp/mips64/op_sget_wide.S b/runtime/interpreter/mterp/mips64/op_sget_wide.S index ace64f8e80..7c31252aed 100644 --- a/runtime/interpreter/mterp/mips64/op_sget_wide.S +++ b/runtime/interpreter/mterp/mips64/op_sget_wide.S @@ -3,12 +3,12 @@ * */ /* sget-wide vAA, field//BBBB */ - .extern MterpGet64Static + .extern MterpSGetU64 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB ld a1, OFF_FP_METHOD(rFP) move a2, rSELF - jal MterpGet64Static + jal MterpSGetU64 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) srl a4, rINST, 8 # a4 <- AA bnez a3, MterpException # bail out diff --git a/runtime/interpreter/mterp/mips64/op_sput.S b/runtime/interpreter/mterp/mips64/op_sput.S index 466f3339c2..28b8c3ea26 100644 --- a/runtime/interpreter/mterp/mips64/op_sput.S +++ b/runtime/interpreter/mterp/mips64/op_sput.S @@ -1,4 +1,4 @@ -%default { "helper":"MterpSet32Static" } +%default { "helper":"MterpSPutU32" } /* * General SPUT handler wrapper. * diff --git a/runtime/interpreter/mterp/mips64/op_sput_boolean.S b/runtime/interpreter/mterp/mips64/op_sput_boolean.S index eba58f7fa1..2e769d5e1a 100644 --- a/runtime/interpreter/mterp/mips64/op_sput_boolean.S +++ b/runtime/interpreter/mterp/mips64/op_sput_boolean.S @@ -1 +1 @@ -%include "mips64/op_sput.S" {"helper":"MterpSetBooleanStatic"} +%include "mips64/op_sput.S" {"helper":"MterpSPutU8"} diff --git a/runtime/interpreter/mterp/mips64/op_sput_byte.S b/runtime/interpreter/mterp/mips64/op_sput_byte.S index 80a26c0161..0b04b590ee 100644 --- a/runtime/interpreter/mterp/mips64/op_sput_byte.S +++ b/runtime/interpreter/mterp/mips64/op_sput_byte.S @@ -1 +1 @@ -%include "mips64/op_sput.S" {"helper":"MterpSetByteStatic"} +%include "mips64/op_sput.S" {"helper":"MterpSPutI8"} diff --git a/runtime/interpreter/mterp/mips64/op_sput_char.S b/runtime/interpreter/mterp/mips64/op_sput_char.S index c0d5bf3bba..4a80375d65 100644 --- a/runtime/interpreter/mterp/mips64/op_sput_char.S +++ b/runtime/interpreter/mterp/mips64/op_sput_char.S @@ -1 +1 @@ -%include "mips64/op_sput.S" {"helper":"MterpSetCharStatic"} +%include "mips64/op_sput.S" {"helper":"MterpSPutU16"} diff --git a/runtime/interpreter/mterp/mips64/op_sput_object.S b/runtime/interpreter/mterp/mips64/op_sput_object.S index ef4c685116..ff43967666 100644 --- a/runtime/interpreter/mterp/mips64/op_sput_object.S +++ b/runtime/interpreter/mterp/mips64/op_sput_object.S @@ -1,10 +1,10 @@ - .extern MterpSputObject + .extern MterpSPutObj EXPORT_PC daddu a0, rFP, OFF_FP_SHADOWFRAME move a1, rPC move a2, rINST move a3, rSELF - jal MterpSputObject + jal MterpSPutObj beqzc v0, MterpException FETCH_ADVANCE_INST 2 # advance rPC, load rINST GET_INST_OPCODE v0 # extract opcode from rINST diff --git a/runtime/interpreter/mterp/mips64/op_sput_short.S b/runtime/interpreter/mterp/mips64/op_sput_short.S index b001832bc4..c00043b6b7 100644 --- a/runtime/interpreter/mterp/mips64/op_sput_short.S +++ b/runtime/interpreter/mterp/mips64/op_sput_short.S @@ -1 +1 @@ -%include "mips64/op_sput.S" {"helper":"MterpSetShortStatic"} +%include "mips64/op_sput.S" {"helper":"MterpSPutI16"} diff --git a/runtime/interpreter/mterp/mips64/op_sput_wide.S b/runtime/interpreter/mterp/mips64/op_sput_wide.S index aa3d5b4157..bfb6983bb4 100644 --- a/runtime/interpreter/mterp/mips64/op_sput_wide.S +++ b/runtime/interpreter/mterp/mips64/op_sput_wide.S @@ -3,7 +3,7 @@ * */ /* sput-wide vAA, field//BBBB */ - .extern MterpSet64Static + .extern MterpSPutU64 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB srl a1, rINST, 8 # a2 <- AA @@ -11,7 +11,7 @@ ld a2, OFF_FP_METHOD(rFP) move a3, rSELF PREFETCH_INST 2 # Get next inst, but don't advance rPC - jal MterpSet64Static + jal MterpSPutU64 bnezc v0, MterpException # 0 on success, -1 on failure ADVANCE 2 # Past exception point - now advance rPC GET_INST_OPCODE v0 # extract opcode from rINST diff --git a/runtime/interpreter/mterp/mterp.cc b/runtime/interpreter/mterp/mterp.cc index e0a48740dc..7b37c9aaef 100644 --- a/runtime/interpreter/mterp/mterp.cc +++ b/runtime/interpreter/mterp/mterp.cc @@ -490,7 +490,7 @@ extern "C" size_t MterpNewInstance(ShadowFrame* shadow_frame, Thread* self, uint return true; } -extern "C" size_t MterpSputObject(ShadowFrame* shadow_frame, uint16_t* dex_pc_ptr, +extern "C" size_t MterpSPutObj(ShadowFrame* shadow_frame, uint16_t* dex_pc_ptr, uint32_t inst_data, Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { const Instruction* inst = Instruction::At(dex_pc_ptr); @@ -498,7 +498,7 @@ extern "C" size_t MterpSputObject(ShadowFrame* shadow_frame, uint16_t* dex_pc_pt (self, *shadow_frame, inst, inst_data); } -extern "C" size_t MterpIputObject(ShadowFrame* shadow_frame, +extern "C" size_t MterpIPutObj(ShadowFrame* shadow_frame, uint16_t* dex_pc_ptr, uint32_t inst_data, Thread* self) @@ -734,11 +734,11 @@ ALWAYS_INLINE RetType artGetInstanceFromMterpFast(uint32_t field_idx, return artGetInstanceFromMterp(field_idx, obj, referrer, self); } -#define ART_GET_FIELD_FROM_MTERP(Kind, PrimType, RetType, Ptr) \ -extern "C" RetType artGet ## Kind ## InstanceFromMterp(uint32_t field_idx, \ - mirror::Object* obj, \ - ArtMethod* referrer, \ - Thread* self) \ +#define ART_GET_FIELD_FROM_MTERP(Suffix, Kind, PrimType, RetType, Ptr) \ +extern "C" RetType MterpIGet ## Suffix(uint32_t field_idx, \ + mirror::Object* obj, \ + ArtMethod* referrer, \ + Thread* self) \ REQUIRES_SHARED(Locks::mutator_lock_) { \ struct Getter { /* Specialize the field load depending on the field type */ \ static RetType Get(mirror::Object* o, ArtField* f) REQUIRES_SHARED(Locks::mutator_lock_) { \ @@ -748,58 +748,72 @@ extern "C" RetType artGet ## Kind ## InstanceFromMterp(uint32_t field_idx, return artGetInstanceFromMterpFast(field_idx, obj, referrer, self); \ } \ -ART_GET_FIELD_FROM_MTERP(Byte, int8_t, ssize_t, ) -ART_GET_FIELD_FROM_MTERP(Boolean, uint8_t, size_t, ) -ART_GET_FIELD_FROM_MTERP(Short, int16_t, ssize_t, ) -ART_GET_FIELD_FROM_MTERP(Char, uint16_t, size_t, ) -ART_GET_FIELD_FROM_MTERP(32, uint32_t, size_t, ) -ART_GET_FIELD_FROM_MTERP(64, uint64_t, uint64_t, ) -ART_GET_FIELD_FROM_MTERP(Obj, mirror::HeapReference, mirror::Object*, .Ptr()) +ART_GET_FIELD_FROM_MTERP(I8, Byte, int8_t, ssize_t, ) +ART_GET_FIELD_FROM_MTERP(U8, Boolean, uint8_t, size_t, ) +ART_GET_FIELD_FROM_MTERP(I16, Short, int16_t, ssize_t, ) +ART_GET_FIELD_FROM_MTERP(U16, Char, uint16_t, size_t, ) +ART_GET_FIELD_FROM_MTERP(U32, 32, uint32_t, size_t, ) +ART_GET_FIELD_FROM_MTERP(U64, 64, uint64_t, uint64_t, ) +ART_GET_FIELD_FROM_MTERP(Obj, Obj, mirror::HeapReference, mirror::Object*, .Ptr()) #undef ART_GET_FIELD_FROM_MTERP -extern "C" ssize_t artSet8InstanceFromMterp(uint32_t field_idx, - mirror::Object* obj, - uint8_t new_value, - ArtMethod* referrer) +extern "C" ssize_t MterpIPutU8(uint32_t field_idx, + mirror::Object* obj, + uint8_t new_value, + ArtMethod* referrer) REQUIRES_SHARED(Locks::mutator_lock_) { ArtField* field = referrer->GetDexCache()->GetResolvedField(field_idx, kRuntimePointerSize); if (LIKELY(field != nullptr && obj != nullptr)) { - Primitive::Type type = field->GetTypeAsPrimitiveType(); - if (type == Primitive::kPrimBoolean) { - field->SetBoolean(obj, new_value); - } else { - DCHECK_EQ(Primitive::kPrimByte, type); - field->SetByte(obj, new_value); - } + field->SetBoolean(obj, new_value); return 0; // success } return -1; // failure } -extern "C" ssize_t artSet16InstanceFromMterp(uint32_t field_idx, - mirror::Object* obj, - uint16_t new_value, - ArtMethod* referrer) +extern "C" ssize_t MterpIPutI8(uint32_t field_idx, + mirror::Object* obj, + uint8_t new_value, + ArtMethod* referrer) REQUIRES_SHARED(Locks::mutator_lock_) { ArtField* field = referrer->GetDexCache()->GetResolvedField(field_idx, kRuntimePointerSize); if (LIKELY(field != nullptr && obj != nullptr)) { - Primitive::Type type = field->GetTypeAsPrimitiveType(); - if (type == Primitive::kPrimChar) { - field->SetChar(obj, new_value); - } else { - DCHECK_EQ(Primitive::kPrimShort, type); - field->SetShort(obj, new_value); - } + field->SetByte(obj, new_value); + return 0; // success + } + return -1; // failure +} + +extern "C" ssize_t MterpIPutU16(uint32_t field_idx, + mirror::Object* obj, + uint16_t new_value, + ArtMethod* referrer) + REQUIRES_SHARED(Locks::mutator_lock_) { + ArtField* field = referrer->GetDexCache()->GetResolvedField(field_idx, kRuntimePointerSize); + if (LIKELY(field != nullptr && obj != nullptr)) { + field->SetChar(obj, new_value); + return 0; // success + } + return -1; // failure +} + +extern "C" ssize_t MterpIPutI16(uint32_t field_idx, + mirror::Object* obj, + uint16_t new_value, + ArtMethod* referrer) + REQUIRES_SHARED(Locks::mutator_lock_) { + ArtField* field = referrer->GetDexCache()->GetResolvedField(field_idx, kRuntimePointerSize); + if (LIKELY(field != nullptr && obj != nullptr)) { + field->SetShort(obj, new_value); return 0; // success } return -1; // failure } -extern "C" ssize_t artSet32InstanceFromMterp(uint32_t field_idx, - mirror::Object* obj, - uint32_t new_value, - ArtMethod* referrer) +extern "C" ssize_t MterpIPutU32(uint32_t field_idx, + mirror::Object* obj, + uint32_t new_value, + ArtMethod* referrer) REQUIRES_SHARED(Locks::mutator_lock_) { ArtField* field = referrer->GetDexCache()->GetResolvedField(field_idx, kRuntimePointerSize); if (LIKELY(field != nullptr && obj != nullptr)) { @@ -809,10 +823,10 @@ extern "C" ssize_t artSet32InstanceFromMterp(uint32_t field_idx, return -1; // failure } -extern "C" ssize_t artSet64InstanceFromMterp(uint32_t field_idx, - mirror::Object* obj, - uint64_t* new_value, - ArtMethod* referrer) +extern "C" ssize_t MterpIPutU64(uint32_t field_idx, + mirror::Object* obj, + uint64_t* new_value, + ArtMethod* referrer) REQUIRES_SHARED(Locks::mutator_lock_) { ArtField* field = referrer->GetDexCache()->GetResolvedField(field_idx, kRuntimePointerSize); if (LIKELY(field != nullptr && obj != nullptr)) { @@ -854,9 +868,9 @@ ALWAYS_INLINE return_type MterpGetStatic(uint32_t field_idx, return res; } -extern "C" int32_t MterpGetBooleanStatic(uint32_t field_idx, - ArtMethod* referrer, - Thread* self) +extern "C" int32_t MterpSGetU8(uint32_t field_idx, + ArtMethod* referrer, + Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { return MterpGetStatic(field_idx, referrer, @@ -864,9 +878,9 @@ extern "C" int32_t MterpGetBooleanStatic(uint32_t field_idx, &ArtField::GetBoolean); } -extern "C" int32_t MterpGetByteStatic(uint32_t field_idx, - ArtMethod* referrer, - Thread* self) +extern "C" int32_t MterpSGetI8(uint32_t field_idx, + ArtMethod* referrer, + Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { return MterpGetStatic(field_idx, referrer, @@ -874,9 +888,9 @@ extern "C" int32_t MterpGetByteStatic(uint32_t field_idx, &ArtField::GetByte); } -extern "C" uint32_t MterpGetCharStatic(uint32_t field_idx, - ArtMethod* referrer, - Thread* self) +extern "C" uint32_t MterpSGetU16(uint32_t field_idx, + ArtMethod* referrer, + Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { return MterpGetStatic(field_idx, referrer, @@ -884,9 +898,9 @@ extern "C" uint32_t MterpGetCharStatic(uint32_t field_idx, &ArtField::GetChar); } -extern "C" int32_t MterpGetShortStatic(uint32_t field_idx, - ArtMethod* referrer, - Thread* self) +extern "C" int32_t MterpSGetI16(uint32_t field_idx, + ArtMethod* referrer, + Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { return MterpGetStatic(field_idx, referrer, @@ -894,9 +908,9 @@ extern "C" int32_t MterpGetShortStatic(uint32_t field_idx, &ArtField::GetShort); } -extern "C" mirror::Object* MterpGetObjStatic(uint32_t field_idx, - ArtMethod* referrer, - Thread* self) +extern "C" mirror::Object* MterpSGetObj(uint32_t field_idx, + ArtMethod* referrer, + Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { return MterpGetStatic, Primitive::kPrimNot>(field_idx, referrer, @@ -904,9 +918,9 @@ extern "C" mirror::Object* MterpGetObjStatic(uint32_t field_idx, &ArtField::GetObject).Ptr(); } -extern "C" int32_t MterpGet32Static(uint32_t field_idx, - ArtMethod* referrer, - Thread* self) +extern "C" int32_t MterpSGetU32(uint32_t field_idx, + ArtMethod* referrer, + Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { return MterpGetStatic(field_idx, referrer, @@ -914,7 +928,7 @@ extern "C" int32_t MterpGet32Static(uint32_t field_idx, &ArtField::GetInt); } -extern "C" int64_t MterpGet64Static(uint32_t field_idx, ArtMethod* referrer, Thread* self) +extern "C" int64_t MterpSGetU64(uint32_t field_idx, ArtMethod* referrer, Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { return MterpGetStatic(field_idx, referrer, @@ -942,10 +956,10 @@ int MterpSetStatic(uint32_t field_idx, return res; } -extern "C" int MterpSetBooleanStatic(uint32_t field_idx, - uint8_t new_value, - ArtMethod* referrer, - Thread* self) +extern "C" int MterpSPutU8(uint32_t field_idx, + uint8_t new_value, + ArtMethod* referrer, + Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { return MterpSetStatic(field_idx, new_value, @@ -954,10 +968,10 @@ extern "C" int MterpSetBooleanStatic(uint32_t field_idx, &ArtField::SetBoolean); } -extern "C" int MterpSetByteStatic(uint32_t field_idx, - int8_t new_value, - ArtMethod* referrer, - Thread* self) +extern "C" int MterpSPutI8(uint32_t field_idx, + int8_t new_value, + ArtMethod* referrer, + Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { return MterpSetStatic(field_idx, new_value, @@ -966,10 +980,10 @@ extern "C" int MterpSetByteStatic(uint32_t field_idx, &ArtField::SetByte); } -extern "C" int MterpSetCharStatic(uint32_t field_idx, - uint16_t new_value, - ArtMethod* referrer, - Thread* self) +extern "C" int MterpSPutU16(uint32_t field_idx, + uint16_t new_value, + ArtMethod* referrer, + Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { return MterpSetStatic(field_idx, new_value, @@ -978,10 +992,10 @@ extern "C" int MterpSetCharStatic(uint32_t field_idx, &ArtField::SetChar); } -extern "C" int MterpSetShortStatic(uint32_t field_idx, - int16_t new_value, - ArtMethod* referrer, - Thread* self) +extern "C" int MterpSPutI16(uint32_t field_idx, + int16_t new_value, + ArtMethod* referrer, + Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { return MterpSetStatic(field_idx, new_value, @@ -990,10 +1004,10 @@ extern "C" int MterpSetShortStatic(uint32_t field_idx, &ArtField::SetShort); } -extern "C" int MterpSet32Static(uint32_t field_idx, - int32_t new_value, - ArtMethod* referrer, - Thread* self) +extern "C" int MterpSPutU32(uint32_t field_idx, + int32_t new_value, + ArtMethod* referrer, + Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { return MterpSetStatic(field_idx, new_value, @@ -1002,10 +1016,10 @@ extern "C" int MterpSet32Static(uint32_t field_idx, &ArtField::SetInt); } -extern "C" int MterpSet64Static(uint32_t field_idx, - int64_t* new_value, - ArtMethod* referrer, - Thread* self) +extern "C" int MterpSPutU64(uint32_t field_idx, + int64_t* new_value, + ArtMethod* referrer, + Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { return MterpSetStatic(field_idx, *new_value, diff --git a/runtime/interpreter/mterp/out/mterp_arm.S b/runtime/interpreter/mterp/out/mterp_arm.S index fd5d647624..b73067f64a 100644 --- a/runtime/interpreter/mterp/out/mterp_arm.S +++ b/runtime/interpreter/mterp/out/mterp_arm.S @@ -2255,7 +2255,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG r1, r1 @ r1<- fp[B], the object pointer ldr r2, [rFP, #OFF_FP_METHOD] @ r2<- referrer mov r3, rSELF @ r3<- self - bl artGet32InstanceFromMterp + bl MterpIGetU32 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] ubfx r2, rINST, #8, #4 @ r2<- A PREFETCH_INST 2 @@ -2285,7 +2285,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG r1, r1 @ r1<- fp[B], the object pointer ldr r2, [rFP, #OFF_FP_METHOD] @ r2<- referrer mov r3, rSELF @ r3<- self - bl artGet64InstanceFromMterp + bl MterpIGetU64 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] ubfx r2, rINST, #8, #4 @ r2<- A PREFETCH_INST 2 @@ -2314,7 +2314,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG r1, r1 @ r1<- fp[B], the object pointer ldr r2, [rFP, #OFF_FP_METHOD] @ r2<- referrer mov r3, rSELF @ r3<- self - bl artGetObjInstanceFromMterp + bl MterpIGetObj ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] ubfx r2, rINST, #8, #4 @ r2<- A PREFETCH_INST 2 @@ -2346,7 +2346,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG r1, r1 @ r1<- fp[B], the object pointer ldr r2, [rFP, #OFF_FP_METHOD] @ r2<- referrer mov r3, rSELF @ r3<- self - bl artGetBooleanInstanceFromMterp + bl MterpIGetU8 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] ubfx r2, rINST, #8, #4 @ r2<- A PREFETCH_INST 2 @@ -2378,7 +2378,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG r1, r1 @ r1<- fp[B], the object pointer ldr r2, [rFP, #OFF_FP_METHOD] @ r2<- referrer mov r3, rSELF @ r3<- self - bl artGetByteInstanceFromMterp + bl MterpIGetI8 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] ubfx r2, rINST, #8, #4 @ r2<- A PREFETCH_INST 2 @@ -2410,7 +2410,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG r1, r1 @ r1<- fp[B], the object pointer ldr r2, [rFP, #OFF_FP_METHOD] @ r2<- referrer mov r3, rSELF @ r3<- self - bl artGetCharInstanceFromMterp + bl MterpIGetU16 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] ubfx r2, rINST, #8, #4 @ r2<- A PREFETCH_INST 2 @@ -2442,7 +2442,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG r1, r1 @ r1<- fp[B], the object pointer ldr r2, [rFP, #OFF_FP_METHOD] @ r2<- referrer mov r3, rSELF @ r3<- self - bl artGetShortInstanceFromMterp + bl MterpIGetI16 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] ubfx r2, rINST, #8, #4 @ r2<- A PREFETCH_INST 2 @@ -2468,7 +2468,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet32InstanceFromMterp + .extern MterpIPutU32 EXPORT_PC FETCH r0, 1 @ r0<- field ref CCCC mov r1, rINST, lsr #12 @ r1<- B @@ -2477,7 +2477,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG r2, r2 @ r2<- fp[A] ldr r3, [rFP, #OFF_FP_METHOD] @ r3<- referrer PREFETCH_INST 2 - bl artSet32InstanceFromMterp + bl MterpIPutU32 cmp r0, #0 bne MterpPossibleException ADVANCE 2 @ advance rPC @@ -2489,7 +2489,7 @@ artMterpAsmInstructionStart = .L_op_nop .L_op_iput_wide: /* 0x5a */ /* File: arm/op_iput_wide.S */ /* iput-wide vA, vB, field@CCCC */ - .extern artSet64InstanceFromMterp + .extern MterpIPutU64 EXPORT_PC FETCH r0, 1 @ r0<- field ref CCCC mov r1, rINST, lsr #12 @ r1<- B @@ -2498,7 +2498,7 @@ artMterpAsmInstructionStart = .L_op_nop VREG_INDEX_TO_ADDR r2, r2 @ r2<- &fp[A] ldr r3, [rFP, #OFF_FP_METHOD] @ r3<- referrer PREFETCH_INST 2 - bl artSet64InstanceFromMterp + bl MterpIPutU64 cmp r0, #0 bne MterpPossibleException ADVANCE 2 @ advance rPC @@ -2514,7 +2514,7 @@ artMterpAsmInstructionStart = .L_op_nop mov r1, rPC mov r2, rINST mov r3, rSELF - bl MterpIputObject + bl MterpIPutObj cmp r0, #0 beq MterpException FETCH_ADVANCE_INST 2 @ advance rPC, load rINST @@ -2532,7 +2532,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet8InstanceFromMterp + .extern MterpIPutU8 EXPORT_PC FETCH r0, 1 @ r0<- field ref CCCC mov r1, rINST, lsr #12 @ r1<- B @@ -2541,7 +2541,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG r2, r2 @ r2<- fp[A] ldr r3, [rFP, #OFF_FP_METHOD] @ r3<- referrer PREFETCH_INST 2 - bl artSet8InstanceFromMterp + bl MterpIPutU8 cmp r0, #0 bne MterpPossibleException ADVANCE 2 @ advance rPC @@ -2560,7 +2560,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet8InstanceFromMterp + .extern MterpIPutI8 EXPORT_PC FETCH r0, 1 @ r0<- field ref CCCC mov r1, rINST, lsr #12 @ r1<- B @@ -2569,7 +2569,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG r2, r2 @ r2<- fp[A] ldr r3, [rFP, #OFF_FP_METHOD] @ r3<- referrer PREFETCH_INST 2 - bl artSet8InstanceFromMterp + bl MterpIPutI8 cmp r0, #0 bne MterpPossibleException ADVANCE 2 @ advance rPC @@ -2588,7 +2588,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet16InstanceFromMterp + .extern MterpIPutU16 EXPORT_PC FETCH r0, 1 @ r0<- field ref CCCC mov r1, rINST, lsr #12 @ r1<- B @@ -2597,7 +2597,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG r2, r2 @ r2<- fp[A] ldr r3, [rFP, #OFF_FP_METHOD] @ r3<- referrer PREFETCH_INST 2 - bl artSet16InstanceFromMterp + bl MterpIPutU16 cmp r0, #0 bne MterpPossibleException ADVANCE 2 @ advance rPC @@ -2616,7 +2616,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet16InstanceFromMterp + .extern MterpIPutI16 EXPORT_PC FETCH r0, 1 @ r0<- field ref CCCC mov r1, rINST, lsr #12 @ r1<- B @@ -2625,7 +2625,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG r2, r2 @ r2<- fp[A] ldr r3, [rFP, #OFF_FP_METHOD] @ r3<- referrer PREFETCH_INST 2 - bl artSet16InstanceFromMterp + bl MterpIPutI16 cmp r0, #0 bne MterpPossibleException ADVANCE 2 @ advance rPC @@ -2644,12 +2644,12 @@ artMterpAsmInstructionStart = .L_op_nop */ /* op vAA, field@BBBB */ - .extern MterpGet32Static + .extern MterpSGetU32 EXPORT_PC FETCH r0, 1 @ r0<- field ref BBBB ldr r1, [rFP, #OFF_FP_METHOD] mov r2, rSELF - bl MterpGet32Static + bl MterpSGetU32 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] mov r2, rINST, lsr #8 @ r2<- AA PREFETCH_INST 2 @@ -2674,12 +2674,12 @@ artMterpAsmInstructionStart = .L_op_nop */ /* sget-wide vAA, field@BBBB */ - .extern MterpGet64Static + .extern MterpSGetU64 EXPORT_PC FETCH r0, 1 @ r0<- field ref BBBB ldr r1, [rFP, #OFF_FP_METHOD] mov r2, rSELF - bl MterpGet64Static + bl MterpSGetU64 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] mov r9, rINST, lsr #8 @ r9<- AA VREG_INDEX_TO_ADDR lr, r9 @ r9<- &fp[AA] @@ -2703,12 +2703,12 @@ artMterpAsmInstructionStart = .L_op_nop */ /* op vAA, field@BBBB */ - .extern MterpGetObjStatic + .extern MterpSGetObj EXPORT_PC FETCH r0, 1 @ r0<- field ref BBBB ldr r1, [rFP, #OFF_FP_METHOD] mov r2, rSELF - bl MterpGetObjStatic + bl MterpSGetObj ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] mov r2, rINST, lsr #8 @ r2<- AA PREFETCH_INST 2 @@ -2736,12 +2736,12 @@ artMterpAsmInstructionStart = .L_op_nop */ /* op vAA, field@BBBB */ - .extern MterpGetBooleanStatic + .extern MterpSGetU8 EXPORT_PC FETCH r0, 1 @ r0<- field ref BBBB ldr r1, [rFP, #OFF_FP_METHOD] mov r2, rSELF - bl MterpGetBooleanStatic + bl MterpSGetU8 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] mov r2, rINST, lsr #8 @ r2<- AA PREFETCH_INST 2 @@ -2769,12 +2769,12 @@ artMterpAsmInstructionStart = .L_op_nop */ /* op vAA, field@BBBB */ - .extern MterpGetByteStatic + .extern MterpSGetI8 EXPORT_PC FETCH r0, 1 @ r0<- field ref BBBB ldr r1, [rFP, #OFF_FP_METHOD] mov r2, rSELF - bl MterpGetByteStatic + bl MterpSGetI8 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] mov r2, rINST, lsr #8 @ r2<- AA PREFETCH_INST 2 @@ -2802,12 +2802,12 @@ artMterpAsmInstructionStart = .L_op_nop */ /* op vAA, field@BBBB */ - .extern MterpGetCharStatic + .extern MterpSGetU16 EXPORT_PC FETCH r0, 1 @ r0<- field ref BBBB ldr r1, [rFP, #OFF_FP_METHOD] mov r2, rSELF - bl MterpGetCharStatic + bl MterpSGetU16 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] mov r2, rINST, lsr #8 @ r2<- AA PREFETCH_INST 2 @@ -2835,12 +2835,12 @@ artMterpAsmInstructionStart = .L_op_nop */ /* op vAA, field@BBBB */ - .extern MterpGetShortStatic + .extern MterpSGetI16 EXPORT_PC FETCH r0, 1 @ r0<- field ref BBBB ldr r1, [rFP, #OFF_FP_METHOD] mov r2, rSELF - bl MterpGetShortStatic + bl MterpSGetI16 ldr r3, [rSELF, #THREAD_EXCEPTION_OFFSET] mov r2, rINST, lsr #8 @ r2<- AA PREFETCH_INST 2 @@ -2873,7 +2873,7 @@ artMterpAsmInstructionStart = .L_op_nop ldr r2, [rFP, #OFF_FP_METHOD] mov r3, rSELF PREFETCH_INST 2 @ Get next inst, but don't advance rPC - bl MterpSet32Static + bl MterpSPutU32 cmp r0, #0 @ 0 on success, -1 on failure bne MterpException ADVANCE 2 @ Past exception point - now advance rPC @@ -2889,7 +2889,7 @@ artMterpAsmInstructionStart = .L_op_nop * */ /* sput-wide vAA, field@BBBB */ - .extern MterpSet64Static + .extern MterpSPutU64 EXPORT_PC FETCH r0, 1 @ r0<- field ref BBBB mov r1, rINST, lsr #8 @ r1<- AA @@ -2897,7 +2897,7 @@ artMterpAsmInstructionStart = .L_op_nop ldr r2, [rFP, #OFF_FP_METHOD] mov r3, rSELF PREFETCH_INST 2 @ Get next inst, but don't advance rPC - bl MterpSet64Static + bl MterpSPutU64 cmp r0, #0 @ 0 on success, -1 on failure bne MterpException ADVANCE 2 @ Past exception point - now advance rPC @@ -2913,7 +2913,7 @@ artMterpAsmInstructionStart = .L_op_nop mov r1, rPC mov r2, rINST mov r3, rSELF - bl MterpSputObject + bl MterpSPutObj cmp r0, #0 beq MterpException FETCH_ADVANCE_INST 2 @ advance rPC, load rINST @@ -2938,7 +2938,7 @@ artMterpAsmInstructionStart = .L_op_nop ldr r2, [rFP, #OFF_FP_METHOD] mov r3, rSELF PREFETCH_INST 2 @ Get next inst, but don't advance rPC - bl MterpSetBooleanStatic + bl MterpSPutU8 cmp r0, #0 @ 0 on success, -1 on failure bne MterpException ADVANCE 2 @ Past exception point - now advance rPC @@ -2964,7 +2964,7 @@ artMterpAsmInstructionStart = .L_op_nop ldr r2, [rFP, #OFF_FP_METHOD] mov r3, rSELF PREFETCH_INST 2 @ Get next inst, but don't advance rPC - bl MterpSetByteStatic + bl MterpSPutI8 cmp r0, #0 @ 0 on success, -1 on failure bne MterpException ADVANCE 2 @ Past exception point - now advance rPC @@ -2990,7 +2990,7 @@ artMterpAsmInstructionStart = .L_op_nop ldr r2, [rFP, #OFF_FP_METHOD] mov r3, rSELF PREFETCH_INST 2 @ Get next inst, but don't advance rPC - bl MterpSetCharStatic + bl MterpSPutU16 cmp r0, #0 @ 0 on success, -1 on failure bne MterpException ADVANCE 2 @ Past exception point - now advance rPC @@ -3016,7 +3016,7 @@ artMterpAsmInstructionStart = .L_op_nop ldr r2, [rFP, #OFF_FP_METHOD] mov r3, rSELF PREFETCH_INST 2 @ Get next inst, but don't advance rPC - bl MterpSetShortStatic + bl MterpSPutI16 cmp r0, #0 @ 0 on success, -1 on failure bne MterpException ADVANCE 2 @ Past exception point - now advance rPC diff --git a/runtime/interpreter/mterp/out/mterp_arm64.S b/runtime/interpreter/mterp/out/mterp_arm64.S index 213f7ff842..770b109f41 100644 --- a/runtime/interpreter/mterp/out/mterp_arm64.S +++ b/runtime/interpreter/mterp/out/mterp_arm64.S @@ -2192,7 +2192,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG w1, w1 // w1<- fp[B], the object pointer ldr x2, [xFP, #OFF_FP_METHOD] // w2<- referrer mov x3, xSELF // w3<- self - bl artGet32InstanceFromMterp + bl MterpIGetU32 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] ubfx w2, wINST, #8, #4 // w2<- A @@ -2222,7 +2222,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG w1, w1 // w1<- fp[B], the object pointer ldr x2, [xFP, #OFF_FP_METHOD] // w2<- referrer mov x3, xSELF // w3<- self - bl artGet64InstanceFromMterp + bl MterpIGetU64 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] ubfx w2, wINST, #8, #4 // w2<- A PREFETCH_INST 2 @@ -2249,7 +2249,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG w1, w1 // w1<- fp[B], the object pointer ldr x2, [xFP, #OFF_FP_METHOD] // w2<- referrer mov x3, xSELF // w3<- self - bl artGetObjInstanceFromMterp + bl MterpIGetObj ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] ubfx w2, wINST, #8, #4 // w2<- A @@ -2281,7 +2281,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG w1, w1 // w1<- fp[B], the object pointer ldr x2, [xFP, #OFF_FP_METHOD] // w2<- referrer mov x3, xSELF // w3<- self - bl artGetBooleanInstanceFromMterp + bl MterpIGetU8 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] uxtb w0, w0 ubfx w2, wINST, #8, #4 // w2<- A @@ -2313,7 +2313,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG w1, w1 // w1<- fp[B], the object pointer ldr x2, [xFP, #OFF_FP_METHOD] // w2<- referrer mov x3, xSELF // w3<- self - bl artGetByteInstanceFromMterp + bl MterpIGetI8 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] sxtb w0, w0 ubfx w2, wINST, #8, #4 // w2<- A @@ -2345,7 +2345,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG w1, w1 // w1<- fp[B], the object pointer ldr x2, [xFP, #OFF_FP_METHOD] // w2<- referrer mov x3, xSELF // w3<- self - bl artGetCharInstanceFromMterp + bl MterpIGetU16 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] uxth w0, w0 ubfx w2, wINST, #8, #4 // w2<- A @@ -2377,7 +2377,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG w1, w1 // w1<- fp[B], the object pointer ldr x2, [xFP, #OFF_FP_METHOD] // w2<- referrer mov x3, xSELF // w3<- self - bl artGetShortInstanceFromMterp + bl MterpIGetI16 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] sxth w0, w0 ubfx w2, wINST, #8, #4 // w2<- A @@ -2403,7 +2403,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field//CCCC */ - .extern artSet32InstanceFromMterp + .extern MterpIPutU32 EXPORT_PC FETCH w0, 1 // w0<- field ref CCCC lsr w1, wINST, #12 // w1<- B @@ -2412,7 +2412,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG w2, w2 // w2<- fp[A] ldr x3, [xFP, #OFF_FP_METHOD] // w3<- referrer PREFETCH_INST 2 - bl artSet32InstanceFromMterp + bl MterpIPutU32 cbnz w0, MterpPossibleException ADVANCE 2 // advance rPC GET_INST_OPCODE ip // extract opcode from rINST @@ -2423,7 +2423,7 @@ artMterpAsmInstructionStart = .L_op_nop .L_op_iput_wide: /* 0x5a */ /* File: arm64/op_iput_wide.S */ /* iput-wide vA, vB, field//CCCC */ - .extern artSet64InstanceFromMterp + .extern MterpIPutU64 EXPORT_PC FETCH w0, 1 // w0<- field ref CCCC lsr w1, wINST, #12 // w1<- B @@ -2432,7 +2432,7 @@ artMterpAsmInstructionStart = .L_op_nop VREG_INDEX_TO_ADDR x2, x2 // w2<- &fp[A] ldr x3, [xFP, #OFF_FP_METHOD] // w3<- referrer PREFETCH_INST 2 - bl artSet64InstanceFromMterp + bl MterpIPutU64 cbnz w0, MterpPossibleException ADVANCE 2 // advance rPC GET_INST_OPCODE ip // extract opcode from wINST @@ -2447,7 +2447,7 @@ artMterpAsmInstructionStart = .L_op_nop mov x1, xPC mov w2, wINST mov x3, xSELF - bl MterpIputObject + bl MterpIPutObj cbz w0, MterpException FETCH_ADVANCE_INST 2 // advance rPC, load rINST GET_INST_OPCODE ip // extract opcode from rINST @@ -2464,7 +2464,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field//CCCC */ - .extern artSet8InstanceFromMterp + .extern MterpIPutU8 EXPORT_PC FETCH w0, 1 // w0<- field ref CCCC lsr w1, wINST, #12 // w1<- B @@ -2473,7 +2473,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG w2, w2 // w2<- fp[A] ldr x3, [xFP, #OFF_FP_METHOD] // w3<- referrer PREFETCH_INST 2 - bl artSet8InstanceFromMterp + bl MterpIPutU8 cbnz w0, MterpPossibleException ADVANCE 2 // advance rPC GET_INST_OPCODE ip // extract opcode from rINST @@ -2491,7 +2491,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field//CCCC */ - .extern artSet8InstanceFromMterp + .extern MterpIPutI8 EXPORT_PC FETCH w0, 1 // w0<- field ref CCCC lsr w1, wINST, #12 // w1<- B @@ -2500,7 +2500,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG w2, w2 // w2<- fp[A] ldr x3, [xFP, #OFF_FP_METHOD] // w3<- referrer PREFETCH_INST 2 - bl artSet8InstanceFromMterp + bl MterpIPutI8 cbnz w0, MterpPossibleException ADVANCE 2 // advance rPC GET_INST_OPCODE ip // extract opcode from rINST @@ -2518,7 +2518,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field//CCCC */ - .extern artSet16InstanceFromMterp + .extern MterpIPutU16 EXPORT_PC FETCH w0, 1 // w0<- field ref CCCC lsr w1, wINST, #12 // w1<- B @@ -2527,7 +2527,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG w2, w2 // w2<- fp[A] ldr x3, [xFP, #OFF_FP_METHOD] // w3<- referrer PREFETCH_INST 2 - bl artSet16InstanceFromMterp + bl MterpIPutU16 cbnz w0, MterpPossibleException ADVANCE 2 // advance rPC GET_INST_OPCODE ip // extract opcode from rINST @@ -2545,7 +2545,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field//CCCC */ - .extern artSet16InstanceFromMterp + .extern MterpIPutI16 EXPORT_PC FETCH w0, 1 // w0<- field ref CCCC lsr w1, wINST, #12 // w1<- B @@ -2554,7 +2554,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG w2, w2 // w2<- fp[A] ldr x3, [xFP, #OFF_FP_METHOD] // w3<- referrer PREFETCH_INST 2 - bl artSet16InstanceFromMterp + bl MterpIPutI16 cbnz w0, MterpPossibleException ADVANCE 2 // advance rPC GET_INST_OPCODE ip // extract opcode from rINST @@ -2572,12 +2572,12 @@ artMterpAsmInstructionStart = .L_op_nop */ /* op vAA, field//BBBB */ - .extern MterpGet32Static + .extern MterpSGetU32 EXPORT_PC FETCH w0, 1 // w0<- field ref BBBB ldr x1, [xFP, #OFF_FP_METHOD] mov x2, xSELF - bl MterpGet32Static + bl MterpSGetU32 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] lsr w2, wINST, #8 // w2<- AA @@ -2607,7 +2607,7 @@ artMterpAsmInstructionStart = .L_op_nop FETCH w0, 1 // w0<- field ref BBBB ldr x1, [xFP, #OFF_FP_METHOD] mov x2, xSELF - bl MterpGet64Static + bl MterpSGetU64 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] lsr w4, wINST, #8 // w4<- AA cbnz x3, MterpException // bail out @@ -2628,12 +2628,12 @@ artMterpAsmInstructionStart = .L_op_nop */ /* op vAA, field//BBBB */ - .extern MterpGetObjStatic + .extern MterpSGetObj EXPORT_PC FETCH w0, 1 // w0<- field ref BBBB ldr x1, [xFP, #OFF_FP_METHOD] mov x2, xSELF - bl MterpGetObjStatic + bl MterpSGetObj ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] lsr w2, wINST, #8 // w2<- AA @@ -2661,12 +2661,12 @@ artMterpAsmInstructionStart = .L_op_nop */ /* op vAA, field//BBBB */ - .extern MterpGetBooleanStatic + .extern MterpSGetU8 EXPORT_PC FETCH w0, 1 // w0<- field ref BBBB ldr x1, [xFP, #OFF_FP_METHOD] mov x2, xSELF - bl MterpGetBooleanStatic + bl MterpSGetU8 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] lsr w2, wINST, #8 // w2<- AA uxtb w0, w0 @@ -2694,12 +2694,12 @@ artMterpAsmInstructionStart = .L_op_nop */ /* op vAA, field//BBBB */ - .extern MterpGetByteStatic + .extern MterpSGetI8 EXPORT_PC FETCH w0, 1 // w0<- field ref BBBB ldr x1, [xFP, #OFF_FP_METHOD] mov x2, xSELF - bl MterpGetByteStatic + bl MterpSGetI8 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] lsr w2, wINST, #8 // w2<- AA sxtb w0, w0 @@ -2727,12 +2727,12 @@ artMterpAsmInstructionStart = .L_op_nop */ /* op vAA, field//BBBB */ - .extern MterpGetCharStatic + .extern MterpSGetU16 EXPORT_PC FETCH w0, 1 // w0<- field ref BBBB ldr x1, [xFP, #OFF_FP_METHOD] mov x2, xSELF - bl MterpGetCharStatic + bl MterpSGetU16 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] lsr w2, wINST, #8 // w2<- AA uxth w0, w0 @@ -2760,12 +2760,12 @@ artMterpAsmInstructionStart = .L_op_nop */ /* op vAA, field//BBBB */ - .extern MterpGetShortStatic + .extern MterpSGetI16 EXPORT_PC FETCH w0, 1 // w0<- field ref BBBB ldr x1, [xFP, #OFF_FP_METHOD] mov x2, xSELF - bl MterpGetShortStatic + bl MterpSGetI16 ldr x3, [xSELF, #THREAD_EXCEPTION_OFFSET] lsr w2, wINST, #8 // w2<- AA sxth w0, w0 @@ -2798,7 +2798,7 @@ artMterpAsmInstructionStart = .L_op_nop ldr x2, [xFP, #OFF_FP_METHOD] mov x3, xSELF PREFETCH_INST 2 // Get next inst, but don't advance rPC - bl MterpSet32Static + bl MterpSPutU32 cbnz w0, MterpException // 0 on success ADVANCE 2 // Past exception point - now advance rPC GET_INST_OPCODE ip // extract opcode from rINST @@ -2813,7 +2813,7 @@ artMterpAsmInstructionStart = .L_op_nop * */ /* sput-wide vAA, field//BBBB */ - .extern MterpSet64Static + .extern MterpSPutU64 EXPORT_PC FETCH w0, 1 // w0<- field ref BBBB lsr w1, wINST, #8 // w1<- AA @@ -2821,7 +2821,7 @@ artMterpAsmInstructionStart = .L_op_nop ldr x2, [xFP, #OFF_FP_METHOD] mov x3, xSELF PREFETCH_INST 2 // Get next inst, but don't advance rPC - bl MterpSet64Static + bl MterpSPutU64 cbnz w0, MterpException // 0 on success, -1 on failure ADVANCE 2 // Past exception point - now advance rPC GET_INST_OPCODE ip // extract opcode from wINST @@ -2836,7 +2836,7 @@ artMterpAsmInstructionStart = .L_op_nop mov x1, xPC mov x2, xINST mov x3, xSELF - bl MterpSputObject + bl MterpSPutObj cbz w0, MterpException FETCH_ADVANCE_INST 2 // advance rPC, load rINST GET_INST_OPCODE ip // extract opcode from rINST @@ -2860,7 +2860,7 @@ artMterpAsmInstructionStart = .L_op_nop ldr x2, [xFP, #OFF_FP_METHOD] mov x3, xSELF PREFETCH_INST 2 // Get next inst, but don't advance rPC - bl MterpSetBooleanStatic + bl MterpSPutU8 cbnz w0, MterpException // 0 on success ADVANCE 2 // Past exception point - now advance rPC GET_INST_OPCODE ip // extract opcode from rINST @@ -2885,7 +2885,7 @@ artMterpAsmInstructionStart = .L_op_nop ldr x2, [xFP, #OFF_FP_METHOD] mov x3, xSELF PREFETCH_INST 2 // Get next inst, but don't advance rPC - bl MterpSetByteStatic + bl MterpSPutI8 cbnz w0, MterpException // 0 on success ADVANCE 2 // Past exception point - now advance rPC GET_INST_OPCODE ip // extract opcode from rINST @@ -2910,7 +2910,7 @@ artMterpAsmInstructionStart = .L_op_nop ldr x2, [xFP, #OFF_FP_METHOD] mov x3, xSELF PREFETCH_INST 2 // Get next inst, but don't advance rPC - bl MterpSetCharStatic + bl MterpSPutU16 cbnz w0, MterpException // 0 on success ADVANCE 2 // Past exception point - now advance rPC GET_INST_OPCODE ip // extract opcode from rINST @@ -2935,7 +2935,7 @@ artMterpAsmInstructionStart = .L_op_nop ldr x2, [xFP, #OFF_FP_METHOD] mov x3, xSELF PREFETCH_INST 2 // Get next inst, but don't advance rPC - bl MterpSetShortStatic + bl MterpSPutI16 cbnz w0, MterpException // 0 on success ADVANCE 2 // Past exception point - now advance rPC GET_INST_OPCODE ip // extract opcode from rINST diff --git a/runtime/interpreter/mterp/out/mterp_mips.S b/runtime/interpreter/mterp/out/mterp_mips.S index c749057ee6..fb7d52eed4 100644 --- a/runtime/interpreter/mterp/out/mterp_mips.S +++ b/runtime/interpreter/mterp/out/mterp_mips.S @@ -2677,7 +2677,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG(a1, a1) # a1 <- fp[B], the object pointer lw a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - JAL(artGet32InstanceFromMterp) + JAL(MterpIGetU32) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA4(a2) # a2<- A+ PREFETCH_INST(2) # load rINST @@ -2706,7 +2706,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG(a1, a1) # a1 <- fp[B], the object pointer lw a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - JAL(artGet64InstanceFromMterp) + JAL(MterpIGetU64) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA4(a2) # a2<- A+ PREFETCH_INST(2) # load rINST @@ -2732,7 +2732,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG(a1, a1) # a1 <- fp[B], the object pointer lw a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - JAL(artGetObjInstanceFromMterp) + JAL(MterpIGetObj) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA4(a2) # a2<- A+ PREFETCH_INST(2) # load rINST @@ -2763,7 +2763,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG(a1, a1) # a1 <- fp[B], the object pointer lw a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - JAL(artGetBooleanInstanceFromMterp) + JAL(MterpIGetU8) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA4(a2) # a2<- A+ PREFETCH_INST(2) # load rINST @@ -2794,7 +2794,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG(a1, a1) # a1 <- fp[B], the object pointer lw a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - JAL(artGetByteInstanceFromMterp) + JAL(MterpIGetI8) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA4(a2) # a2<- A+ PREFETCH_INST(2) # load rINST @@ -2825,7 +2825,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG(a1, a1) # a1 <- fp[B], the object pointer lw a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - JAL(artGetCharInstanceFromMterp) + JAL(MterpIGetU16) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA4(a2) # a2<- A+ PREFETCH_INST(2) # load rINST @@ -2856,7 +2856,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG(a1, a1) # a1 <- fp[B], the object pointer lw a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - JAL(artGetShortInstanceFromMterp) + JAL(MterpIGetI16) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA4(a2) # a2<- A+ PREFETCH_INST(2) # load rINST @@ -2880,7 +2880,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet32InstanceFromMterp + .extern MterpIPutU32 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref CCCC GET_OPB(a1) # a1 <- B @@ -2889,7 +2889,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG(a2, a2) # a2 <- fp[A] lw a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST(2) # load rINST - JAL(artSet32InstanceFromMterp) + JAL(MterpIPutU32) bnez v0, MterpPossibleException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST @@ -2900,7 +2900,7 @@ artMterpAsmInstructionStart = .L_op_nop .L_op_iput_wide: /* 0x5a */ /* File: mips/op_iput_wide.S */ /* iput-wide vA, vB, field@CCCC */ - .extern artSet64InstanceFromMterp + .extern MterpIPutU64 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref CCCC GET_OPB(a1) # a1 <- B @@ -2909,7 +2909,7 @@ artMterpAsmInstructionStart = .L_op_nop EAS2(a2, rFP, a2) # a2 <- &fp[A] lw a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST(2) # load rINST - JAL(artSet64InstanceFromMterp) + JAL(MterpIPutU64) bnez v0, MterpPossibleException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST @@ -2930,7 +2930,7 @@ artMterpAsmInstructionStart = .L_op_nop move a1, rPC move a2, rINST move a3, rSELF - JAL(MterpIputObject) + JAL(MterpIPutObj) beqz v0, MterpException FETCH_ADVANCE_INST(2) # advance rPC, load rINST GET_INST_OPCODE(t0) # extract opcode from rINST @@ -2947,7 +2947,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet8InstanceFromMterp + .extern MterpIPutU8 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref CCCC GET_OPB(a1) # a1 <- B @@ -2956,7 +2956,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG(a2, a2) # a2 <- fp[A] lw a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST(2) # load rINST - JAL(artSet8InstanceFromMterp) + JAL(MterpIPutU8) bnez v0, MterpPossibleException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST @@ -2974,7 +2974,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet8InstanceFromMterp + .extern MterpIPutI8 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref CCCC GET_OPB(a1) # a1 <- B @@ -2983,7 +2983,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG(a2, a2) # a2 <- fp[A] lw a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST(2) # load rINST - JAL(artSet8InstanceFromMterp) + JAL(MterpIPutI8) bnez v0, MterpPossibleException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST @@ -3001,7 +3001,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet16InstanceFromMterp + .extern MterpIPutU16 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref CCCC GET_OPB(a1) # a1 <- B @@ -3010,7 +3010,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG(a2, a2) # a2 <- fp[A] lw a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST(2) # load rINST - JAL(artSet16InstanceFromMterp) + JAL(MterpIPutU16) bnez v0, MterpPossibleException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST @@ -3028,7 +3028,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet16InstanceFromMterp + .extern MterpIPutI16 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref CCCC GET_OPB(a1) # a1 <- B @@ -3037,7 +3037,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG(a2, a2) # a2 <- fp[A] lw a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST(2) # load rINST - JAL(artSet16InstanceFromMterp) + JAL(MterpIPutI16) bnez v0, MterpPossibleException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST @@ -3054,12 +3054,12 @@ artMterpAsmInstructionStart = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field@BBBB */ - .extern MterpGet32Static + .extern MterpSGetU32 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref BBBB lw a1, OFF_FP_METHOD(rFP) # a1 <- method move a2, rSELF # a2 <- self - JAL(MterpGet32Static) + JAL(MterpSGetU32) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA(a2) # a2 <- AA PREFETCH_INST(2) @@ -3080,12 +3080,12 @@ artMterpAsmInstructionStart = .L_op_nop * 64-bit SGET handler. */ /* sget-wide vAA, field@BBBB */ - .extern MterpGet64Static + .extern MterpSGetU64 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref BBBB lw a1, OFF_FP_METHOD(rFP) # a1 <- method move a2, rSELF # a2 <- self - JAL(MterpGet64Static) + JAL(MterpSGetU64) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) bnez a3, MterpException GET_OPA(a1) # a1 <- AA @@ -3104,12 +3104,12 @@ artMterpAsmInstructionStart = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field@BBBB */ - .extern MterpGetObjStatic + .extern MterpSGetObj EXPORT_PC() FETCH(a0, 1) # a0 <- field ref BBBB lw a1, OFF_FP_METHOD(rFP) # a1 <- method move a2, rSELF # a2 <- self - JAL(MterpGetObjStatic) + JAL(MterpSGetObj) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA(a2) # a2 <- AA PREFETCH_INST(2) @@ -3134,12 +3134,12 @@ artMterpAsmInstructionStart = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field@BBBB */ - .extern MterpGetBooleanStatic + .extern MterpSGetU8 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref BBBB lw a1, OFF_FP_METHOD(rFP) # a1 <- method move a2, rSELF # a2 <- self - JAL(MterpGetBooleanStatic) + JAL(MterpSGetU8) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA(a2) # a2 <- AA PREFETCH_INST(2) @@ -3164,12 +3164,12 @@ artMterpAsmInstructionStart = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field@BBBB */ - .extern MterpGetByteStatic + .extern MterpSGetI8 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref BBBB lw a1, OFF_FP_METHOD(rFP) # a1 <- method move a2, rSELF # a2 <- self - JAL(MterpGetByteStatic) + JAL(MterpSGetI8) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA(a2) # a2 <- AA PREFETCH_INST(2) @@ -3194,12 +3194,12 @@ artMterpAsmInstructionStart = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field@BBBB */ - .extern MterpGetCharStatic + .extern MterpSGetU16 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref BBBB lw a1, OFF_FP_METHOD(rFP) # a1 <- method move a2, rSELF # a2 <- self - JAL(MterpGetCharStatic) + JAL(MterpSGetU16) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA(a2) # a2 <- AA PREFETCH_INST(2) @@ -3224,12 +3224,12 @@ artMterpAsmInstructionStart = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field@BBBB */ - .extern MterpGetShortStatic + .extern MterpSGetI16 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref BBBB lw a1, OFF_FP_METHOD(rFP) # a1 <- method move a2, rSELF # a2 <- self - JAL(MterpGetShortStatic) + JAL(MterpSGetI16) lw a3, THREAD_EXCEPTION_OFFSET(rSELF) GET_OPA(a2) # a2 <- AA PREFETCH_INST(2) @@ -3260,7 +3260,7 @@ artMterpAsmInstructionStart = .L_op_nop lw a2, OFF_FP_METHOD(rFP) # a2 <- method move a3, rSELF # a3 <- self PREFETCH_INST(2) # load rINST - JAL(MterpSet32Static) + JAL(MterpSPutU32) bnez v0, MterpException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST @@ -3274,7 +3274,7 @@ artMterpAsmInstructionStart = .L_op_nop * 64-bit SPUT handler. */ /* sput-wide vAA, field@BBBB */ - .extern MterpSet64Static + .extern MterpSPutU64 EXPORT_PC() FETCH(a0, 1) # a0 <- field ref CCCC GET_OPA(a1) # a1 <- AA @@ -3282,7 +3282,7 @@ artMterpAsmInstructionStart = .L_op_nop lw a2, OFF_FP_METHOD(rFP) # a2 <- method move a3, rSELF # a3 <- self PREFETCH_INST(2) # load rINST - JAL(MterpSet64Static) + JAL(MterpSPutU64) bnez v0, MterpException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST @@ -3303,7 +3303,7 @@ artMterpAsmInstructionStart = .L_op_nop move a1, rPC move a2, rINST move a3, rSELF - JAL(MterpSputObject) + JAL(MterpSPutObj) beqz v0, MterpException FETCH_ADVANCE_INST(2) # advance rPC, load rINST GET_INST_OPCODE(t0) # extract opcode from rINST @@ -3327,7 +3327,7 @@ artMterpAsmInstructionStart = .L_op_nop lw a2, OFF_FP_METHOD(rFP) # a2 <- method move a3, rSELF # a3 <- self PREFETCH_INST(2) # load rINST - JAL(MterpSetBooleanStatic) + JAL(MterpSPutU8) bnez v0, MterpException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST @@ -3352,7 +3352,7 @@ artMterpAsmInstructionStart = .L_op_nop lw a2, OFF_FP_METHOD(rFP) # a2 <- method move a3, rSELF # a3 <- self PREFETCH_INST(2) # load rINST - JAL(MterpSetByteStatic) + JAL(MterpSPutI8) bnez v0, MterpException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST @@ -3377,7 +3377,7 @@ artMterpAsmInstructionStart = .L_op_nop lw a2, OFF_FP_METHOD(rFP) # a2 <- method move a3, rSELF # a3 <- self PREFETCH_INST(2) # load rINST - JAL(MterpSetCharStatic) + JAL(MterpSPutU16) bnez v0, MterpException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST @@ -3402,7 +3402,7 @@ artMterpAsmInstructionStart = .L_op_nop lw a2, OFF_FP_METHOD(rFP) # a2 <- method move a3, rSELF # a3 <- self PREFETCH_INST(2) # load rINST - JAL(MterpSetShortStatic) + JAL(MterpSPutI16) bnez v0, MterpException # bail out ADVANCE(2) # advance rPC GET_INST_OPCODE(t0) # extract opcode from rINST diff --git a/runtime/interpreter/mterp/out/mterp_mips64.S b/runtime/interpreter/mterp/out/mterp_mips64.S index f9b270b01e..65616919c9 100644 --- a/runtime/interpreter/mterp/out/mterp_mips64.S +++ b/runtime/interpreter/mterp/out/mterp_mips64.S @@ -2246,14 +2246,14 @@ artMterpAsmInstructionStart = .L_op_nop * * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short */ - .extern artGet32InstanceFromMterp + .extern MterpIGetU32 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B GET_VREG_U a1, a1 # a1 <- fp[B], the object pointer ld a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - jal artGet32InstanceFromMterp + jal MterpIGetU32 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) ext a2, rINST, 8, 4 # a2 <- A PREFETCH_INST 2 @@ -2276,14 +2276,14 @@ artMterpAsmInstructionStart = .L_op_nop * * for: iget-wide */ - .extern artGet64InstanceFromMterp + .extern MterpIGetU64 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B GET_VREG_U a1, a1 # a1 <- fp[B], the object pointer ld a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - jal artGet64InstanceFromMterp + jal MterpIGetU64 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) ext a2, rINST, 8, 4 # a2 <- A PREFETCH_INST 2 @@ -2303,14 +2303,14 @@ artMterpAsmInstructionStart = .L_op_nop * * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short */ - .extern artGetObjInstanceFromMterp + .extern MterpIGetObj EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B GET_VREG_U a1, a1 # a1 <- fp[B], the object pointer ld a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - jal artGetObjInstanceFromMterp + jal MterpIGetObj ld a3, THREAD_EXCEPTION_OFFSET(rSELF) ext a2, rINST, 8, 4 # a2 <- A PREFETCH_INST 2 @@ -2335,14 +2335,14 @@ artMterpAsmInstructionStart = .L_op_nop * * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short */ - .extern artGetBooleanInstanceFromMterp + .extern MterpIGetU8 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B GET_VREG_U a1, a1 # a1 <- fp[B], the object pointer ld a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - jal artGetBooleanInstanceFromMterp + jal MterpIGetU8 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) ext a2, rINST, 8, 4 # a2 <- A PREFETCH_INST 2 @@ -2367,14 +2367,14 @@ artMterpAsmInstructionStart = .L_op_nop * * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short */ - .extern artGetByteInstanceFromMterp + .extern MterpIGetI8 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B GET_VREG_U a1, a1 # a1 <- fp[B], the object pointer ld a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - jal artGetByteInstanceFromMterp + jal MterpIGetI8 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) ext a2, rINST, 8, 4 # a2 <- A PREFETCH_INST 2 @@ -2399,14 +2399,14 @@ artMterpAsmInstructionStart = .L_op_nop * * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short */ - .extern artGetCharInstanceFromMterp + .extern MterpIGetU16 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B GET_VREG_U a1, a1 # a1 <- fp[B], the object pointer ld a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - jal artGetCharInstanceFromMterp + jal MterpIGetU16 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) ext a2, rINST, 8, 4 # a2 <- A PREFETCH_INST 2 @@ -2431,14 +2431,14 @@ artMterpAsmInstructionStart = .L_op_nop * * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short */ - .extern artGetShortInstanceFromMterp + .extern MterpIGetI16 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B GET_VREG_U a1, a1 # a1 <- fp[B], the object pointer ld a2, OFF_FP_METHOD(rFP) # a2 <- referrer move a3, rSELF # a3 <- self - jal artGetShortInstanceFromMterp + jal MterpIGetI16 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) ext a2, rINST, 8, 4 # a2 <- A PREFETCH_INST 2 @@ -2463,7 +2463,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field//CCCC */ - .extern artSet32InstanceFromMterp + .extern MterpIPutU32 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B @@ -2472,7 +2472,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG a2, a2 # a2 <- fp[A] ld a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST 2 - jal artSet32InstanceFromMterp + jal MterpIPutU32 bnez v0, MterpPossibleException # bail out ADVANCE 2 GET_INST_OPCODE v0 # extract opcode from rINST @@ -2483,7 +2483,7 @@ artMterpAsmInstructionStart = .L_op_nop .L_op_iput_wide: /* 0x5a */ /* File: mips64/op_iput_wide.S */ /* iput-wide vA, vB, field//CCCC */ - .extern artSet64InstanceFromMterp + .extern MterpIPutU64 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B @@ -2492,7 +2492,7 @@ artMterpAsmInstructionStart = .L_op_nop dlsa a2, a2, rFP, 2 # a2 <- &fp[A] ld a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST 2 - jal artSet64InstanceFromMterp + jal MterpIPutU64 bnez v0, MterpPossibleException # bail out ADVANCE 2 GET_INST_OPCODE v0 # extract opcode from rINST @@ -2502,13 +2502,13 @@ artMterpAsmInstructionStart = .L_op_nop .balign 128 .L_op_iput_object: /* 0x5b */ /* File: mips64/op_iput_object.S */ - .extern MterpIputObject + .extern MterpIPutObj EXPORT_PC daddu a0, rFP, OFF_FP_SHADOWFRAME move a1, rPC move a2, rINST move a3, rSELF - jal MterpIputObject + jal MterpIPutObj beqzc v0, MterpException FETCH_ADVANCE_INST 2 # advance rPC, load rINST GET_INST_OPCODE v0 # extract opcode from rINST @@ -2525,7 +2525,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field//CCCC */ - .extern artSet8InstanceFromMterp + .extern MterpIPutU8 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B @@ -2534,7 +2534,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG a2, a2 # a2 <- fp[A] ld a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST 2 - jal artSet8InstanceFromMterp + jal MterpIPutU8 bnez v0, MterpPossibleException # bail out ADVANCE 2 GET_INST_OPCODE v0 # extract opcode from rINST @@ -2552,7 +2552,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field//CCCC */ - .extern artSet8InstanceFromMterp + .extern MterpIPutI8 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B @@ -2561,7 +2561,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG a2, a2 # a2 <- fp[A] ld a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST 2 - jal artSet8InstanceFromMterp + jal MterpIPutI8 bnez v0, MterpPossibleException # bail out ADVANCE 2 GET_INST_OPCODE v0 # extract opcode from rINST @@ -2579,7 +2579,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field//CCCC */ - .extern artSet16InstanceFromMterp + .extern MterpIPutU16 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B @@ -2588,7 +2588,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG a2, a2 # a2 <- fp[A] ld a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST 2 - jal artSet16InstanceFromMterp + jal MterpIPutU16 bnez v0, MterpPossibleException # bail out ADVANCE 2 GET_INST_OPCODE v0 # extract opcode from rINST @@ -2606,7 +2606,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: iput, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field//CCCC */ - .extern artSet16InstanceFromMterp + .extern MterpIPutI16 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref CCCC srl a1, rINST, 12 # a1 <- B @@ -2615,7 +2615,7 @@ artMterpAsmInstructionStart = .L_op_nop GET_VREG a2, a2 # a2 <- fp[A] ld a3, OFF_FP_METHOD(rFP) # a3 <- referrer PREFETCH_INST 2 - jal artSet16InstanceFromMterp + jal MterpIPutI16 bnez v0, MterpPossibleException # bail out ADVANCE 2 GET_INST_OPCODE v0 # extract opcode from rINST @@ -2632,12 +2632,12 @@ artMterpAsmInstructionStart = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field//BBBB */ - .extern MterpGet32Static + .extern MterpSGetU32 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB ld a1, OFF_FP_METHOD(rFP) move a2, rSELF - jal MterpGet32Static + jal MterpSGetU32 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) srl a2, rINST, 8 # a2 <- AA @@ -2661,12 +2661,12 @@ artMterpAsmInstructionStart = .L_op_nop * */ /* sget-wide vAA, field//BBBB */ - .extern MterpGet64Static + .extern MterpSGetU64 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB ld a1, OFF_FP_METHOD(rFP) move a2, rSELF - jal MterpGet64Static + jal MterpSGetU64 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) srl a4, rINST, 8 # a4 <- AA bnez a3, MterpException # bail out @@ -2686,12 +2686,12 @@ artMterpAsmInstructionStart = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field//BBBB */ - .extern MterpGetObjStatic + .extern MterpSGetObj EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB ld a1, OFF_FP_METHOD(rFP) move a2, rSELF - jal MterpGetObjStatic + jal MterpSGetObj ld a3, THREAD_EXCEPTION_OFFSET(rSELF) srl a2, rINST, 8 # a2 <- AA @@ -2718,12 +2718,12 @@ artMterpAsmInstructionStart = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field//BBBB */ - .extern MterpGetBooleanStatic + .extern MterpSGetU8 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB ld a1, OFF_FP_METHOD(rFP) move a2, rSELF - jal MterpGetBooleanStatic + jal MterpSGetU8 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) srl a2, rINST, 8 # a2 <- AA and v0, v0, 0xff @@ -2750,12 +2750,12 @@ artMterpAsmInstructionStart = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field//BBBB */ - .extern MterpGetByteStatic + .extern MterpSGetI8 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB ld a1, OFF_FP_METHOD(rFP) move a2, rSELF - jal MterpGetByteStatic + jal MterpSGetI8 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) srl a2, rINST, 8 # a2 <- AA seb v0, v0 @@ -2782,12 +2782,12 @@ artMterpAsmInstructionStart = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field//BBBB */ - .extern MterpGetCharStatic + .extern MterpSGetU16 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB ld a1, OFF_FP_METHOD(rFP) move a2, rSELF - jal MterpGetCharStatic + jal MterpSGetU16 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) srl a2, rINST, 8 # a2 <- AA and v0, v0, 0xffff @@ -2814,12 +2814,12 @@ artMterpAsmInstructionStart = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field//BBBB */ - .extern MterpGetShortStatic + .extern MterpSGetI16 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB ld a1, OFF_FP_METHOD(rFP) move a2, rSELF - jal MterpGetShortStatic + jal MterpSGetI16 ld a3, THREAD_EXCEPTION_OFFSET(rSELF) srl a2, rINST, 8 # a2 <- AA seh v0, v0 @@ -2845,7 +2845,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field//BBBB */ - .extern MterpSet32Static + .extern MterpSPutU32 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB srl a3, rINST, 8 # a3 <- AA @@ -2853,7 +2853,7 @@ artMterpAsmInstructionStart = .L_op_nop ld a2, OFF_FP_METHOD(rFP) move a3, rSELF PREFETCH_INST 2 # Get next inst, but don't advance rPC - jal MterpSet32Static + jal MterpSPutU32 bnezc v0, MterpException # 0 on success ADVANCE 2 # Past exception point - now advance rPC GET_INST_OPCODE v0 # extract opcode from rINST @@ -2868,7 +2868,7 @@ artMterpAsmInstructionStart = .L_op_nop * */ /* sput-wide vAA, field//BBBB */ - .extern MterpSet64Static + .extern MterpSPutU64 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB srl a1, rINST, 8 # a2 <- AA @@ -2876,7 +2876,7 @@ artMterpAsmInstructionStart = .L_op_nop ld a2, OFF_FP_METHOD(rFP) move a3, rSELF PREFETCH_INST 2 # Get next inst, but don't advance rPC - jal MterpSet64Static + jal MterpSPutU64 bnezc v0, MterpException # 0 on success, -1 on failure ADVANCE 2 # Past exception point - now advance rPC GET_INST_OPCODE v0 # extract opcode from rINST @@ -2886,13 +2886,13 @@ artMterpAsmInstructionStart = .L_op_nop .balign 128 .L_op_sput_object: /* 0x69 */ /* File: mips64/op_sput_object.S */ - .extern MterpSputObject + .extern MterpSPutObj EXPORT_PC daddu a0, rFP, OFF_FP_SHADOWFRAME move a1, rPC move a2, rINST move a3, rSELF - jal MterpSputObject + jal MterpSPutObj beqzc v0, MterpException FETCH_ADVANCE_INST 2 # advance rPC, load rINST GET_INST_OPCODE v0 # extract opcode from rINST @@ -2909,7 +2909,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field//BBBB */ - .extern MterpSetBooleanStatic + .extern MterpSPutU8 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB srl a3, rINST, 8 # a3 <- AA @@ -2917,7 +2917,7 @@ artMterpAsmInstructionStart = .L_op_nop ld a2, OFF_FP_METHOD(rFP) move a3, rSELF PREFETCH_INST 2 # Get next inst, but don't advance rPC - jal MterpSetBooleanStatic + jal MterpSPutU8 bnezc v0, MterpException # 0 on success ADVANCE 2 # Past exception point - now advance rPC GET_INST_OPCODE v0 # extract opcode from rINST @@ -2935,7 +2935,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field//BBBB */ - .extern MterpSetByteStatic + .extern MterpSPutI8 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB srl a3, rINST, 8 # a3 <- AA @@ -2943,7 +2943,7 @@ artMterpAsmInstructionStart = .L_op_nop ld a2, OFF_FP_METHOD(rFP) move a3, rSELF PREFETCH_INST 2 # Get next inst, but don't advance rPC - jal MterpSetByteStatic + jal MterpSPutI8 bnezc v0, MterpException # 0 on success ADVANCE 2 # Past exception point - now advance rPC GET_INST_OPCODE v0 # extract opcode from rINST @@ -2961,7 +2961,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field//BBBB */ - .extern MterpSetCharStatic + .extern MterpSPutU16 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB srl a3, rINST, 8 # a3 <- AA @@ -2969,7 +2969,7 @@ artMterpAsmInstructionStart = .L_op_nop ld a2, OFF_FP_METHOD(rFP) move a3, rSELF PREFETCH_INST 2 # Get next inst, but don't advance rPC - jal MterpSetCharStatic + jal MterpSPutU16 bnezc v0, MterpException # 0 on success ADVANCE 2 # Past exception point - now advance rPC GET_INST_OPCODE v0 # extract opcode from rINST @@ -2987,7 +2987,7 @@ artMterpAsmInstructionStart = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field//BBBB */ - .extern MterpSetShortStatic + .extern MterpSPutI16 EXPORT_PC lhu a0, 2(rPC) # a0 <- field ref BBBB srl a3, rINST, 8 # a3 <- AA @@ -2995,7 +2995,7 @@ artMterpAsmInstructionStart = .L_op_nop ld a2, OFF_FP_METHOD(rFP) move a3, rSELF PREFETCH_INST 2 # Get next inst, but don't advance rPC - jal MterpSetShortStatic + jal MterpSPutI16 bnezc v0, MterpException # 0 on success ADVANCE 2 # Past exception point - now advance rPC GET_INST_OPCODE v0 # extract opcode from rINST diff --git a/runtime/interpreter/mterp/out/mterp_x86.S b/runtime/interpreter/mterp/out/mterp_x86.S index ad74b29871..c78eb4942a 100644 --- a/runtime/interpreter/mterp/out/mterp_x86.S +++ b/runtime/interpreter/mterp/out/mterp_x86.S @@ -2132,7 +2132,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # referrer mov rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(artGet32InstanceFromMterp) + call SYMBOL(MterpIGetU32) movl rSELF, %ecx RESTORE_IBASE_FROM_SELF %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) @@ -2165,7 +2165,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # referrer mov rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(artGet64InstanceFromMterp) + call SYMBOL(MterpIGetU64) mov rSELF, %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) jnz MterpException # bail out @@ -2196,7 +2196,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # referrer mov rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(artGetObjInstanceFromMterp) + call SYMBOL(MterpIGetObj) movl rSELF, %ecx RESTORE_IBASE_FROM_SELF %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) @@ -2231,7 +2231,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # referrer mov rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(artGetBooleanInstanceFromMterp) + call SYMBOL(MterpIGetU8) movl rSELF, %ecx RESTORE_IBASE_FROM_SELF %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) @@ -2266,7 +2266,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # referrer mov rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(artGetByteInstanceFromMterp) + call SYMBOL(MterpIGetI8) movl rSELF, %ecx RESTORE_IBASE_FROM_SELF %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) @@ -2301,7 +2301,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # referrer mov rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(artGetCharInstanceFromMterp) + call SYMBOL(MterpIGetU16) movl rSELF, %ecx RESTORE_IBASE_FROM_SELF %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) @@ -2336,7 +2336,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # referrer mov rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(artGetShortInstanceFromMterp) + call SYMBOL(MterpIGetI16) movl rSELF, %ecx RESTORE_IBASE_FROM_SELF %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) @@ -2360,7 +2360,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet32InstanceFromMterp + .extern MterpIPutU32 EXPORT_PC movzwl 2(rPC), %eax # eax<- 0000CCCC movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -2373,7 +2373,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # fp[A] movl OFF_FP_METHOD(rFP), %eax movl %eax, OUT_ARG3(%esp) # referrer - call SYMBOL(artSet32InstanceFromMterp) + call SYMBOL(MterpIPutU32) testb %al, %al jnz MterpPossibleException RESTORE_IBASE @@ -2384,7 +2384,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop .L_op_iput_wide: /* 0x5a */ /* File: x86/op_iput_wide.S */ /* iput-wide vA, vB, field@CCCC */ - .extern artSet64InstanceFromMterp + .extern MterpIPutU64 EXPORT_PC movzwl 2(rPC), %eax # eax <- 0000CCCC movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -2397,7 +2397,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # &fp[A] movl OFF_FP_METHOD(rFP), %eax movl %eax, OUT_ARG3(%esp) # referrer - call SYMBOL(artSet64InstanceFromMterp) + call SYMBOL(MterpIPutU64) testb %al, %al jnz MterpPossibleException RESTORE_IBASE @@ -2415,7 +2415,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl rINST, OUT_ARG2(%esp) movl rSELF, %eax movl %eax, OUT_ARG3(%esp) - call SYMBOL(MterpIputObject) + call SYMBOL(MterpIPutObj) testb %al, %al jz MterpException RESTORE_IBASE @@ -2432,7 +2432,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet8InstanceFromMterp + .extern MterpIPutU8 EXPORT_PC movzwl 2(rPC), %eax # eax<- 0000CCCC movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -2445,7 +2445,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # fp[A] movl OFF_FP_METHOD(rFP), %eax movl %eax, OUT_ARG3(%esp) # referrer - call SYMBOL(artSet8InstanceFromMterp) + call SYMBOL(MterpIPutU8) testb %al, %al jnz MterpPossibleException RESTORE_IBASE @@ -2463,7 +2463,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet8InstanceFromMterp + .extern MterpIPutI8 EXPORT_PC movzwl 2(rPC), %eax # eax<- 0000CCCC movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -2476,7 +2476,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # fp[A] movl OFF_FP_METHOD(rFP), %eax movl %eax, OUT_ARG3(%esp) # referrer - call SYMBOL(artSet8InstanceFromMterp) + call SYMBOL(MterpIPutI8) testb %al, %al jnz MterpPossibleException RESTORE_IBASE @@ -2494,7 +2494,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet16InstanceFromMterp + .extern MterpIPutU16 EXPORT_PC movzwl 2(rPC), %eax # eax<- 0000CCCC movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -2507,7 +2507,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # fp[A] movl OFF_FP_METHOD(rFP), %eax movl %eax, OUT_ARG3(%esp) # referrer - call SYMBOL(artSet16InstanceFromMterp) + call SYMBOL(MterpIPutU16) testb %al, %al jnz MterpPossibleException RESTORE_IBASE @@ -2525,7 +2525,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet16InstanceFromMterp + .extern MterpIPutI16 EXPORT_PC movzwl 2(rPC), %eax # eax<- 0000CCCC movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -2538,7 +2538,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # fp[A] movl OFF_FP_METHOD(rFP), %eax movl %eax, OUT_ARG3(%esp) # referrer - call SYMBOL(artSet16InstanceFromMterp) + call SYMBOL(MterpIPutI16) testb %al, %al jnz MterpPossibleException RESTORE_IBASE @@ -2555,7 +2555,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field@BBBB */ - .extern MterpGet32Static + .extern MterpSGetU32 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -2563,7 +2563,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG1(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG2(%esp) # self - call SYMBOL(MterpGet32Static) + call SYMBOL(MterpSGetU32) movl rSELF, %ecx RESTORE_IBASE_FROM_SELF %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) @@ -2584,7 +2584,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * */ /* sget-wide vAA, field@BBBB */ - .extern MterpGet64Static + .extern MterpSGetU64 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -2592,7 +2592,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG1(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG2(%esp) # self - call SYMBOL(MterpGet64Static) + call SYMBOL(MterpSGetU64) movl rSELF, %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) jnz MterpException @@ -2612,7 +2612,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field@BBBB */ - .extern MterpGetObjStatic + .extern MterpSGetObj EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -2620,7 +2620,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG1(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG2(%esp) # self - call SYMBOL(MterpGetObjStatic) + call SYMBOL(MterpSGetObj) movl rSELF, %ecx RESTORE_IBASE_FROM_SELF %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) @@ -2644,7 +2644,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field@BBBB */ - .extern MterpGetBooleanStatic + .extern MterpSGetU8 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -2652,7 +2652,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG1(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG2(%esp) # self - call SYMBOL(MterpGetBooleanStatic) + call SYMBOL(MterpSGetU8) movl rSELF, %ecx RESTORE_IBASE_FROM_SELF %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) @@ -2676,7 +2676,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field@BBBB */ - .extern MterpGetByteStatic + .extern MterpSGetI8 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -2684,7 +2684,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG1(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG2(%esp) # self - call SYMBOL(MterpGetByteStatic) + call SYMBOL(MterpSGetI8) movl rSELF, %ecx RESTORE_IBASE_FROM_SELF %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) @@ -2708,7 +2708,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field@BBBB */ - .extern MterpGetCharStatic + .extern MterpSGetU16 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -2716,7 +2716,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG1(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG2(%esp) # self - call SYMBOL(MterpGetCharStatic) + call SYMBOL(MterpSGetU16) movl rSELF, %ecx RESTORE_IBASE_FROM_SELF %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) @@ -2740,7 +2740,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short */ /* op vAA, field@BBBB */ - .extern MterpGetShortStatic + .extern MterpSGetI16 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -2748,7 +2748,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG1(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG2(%esp) # self - call SYMBOL(MterpGetShortStatic) + call SYMBOL(MterpSGetI16) movl rSELF, %ecx RESTORE_IBASE_FROM_SELF %ecx cmpl $0, THREAD_EXCEPTION_OFFSET(%ecx) @@ -2771,7 +2771,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field@BBBB */ - .extern MterpSet32Static + .extern MterpSPutU32 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref BBBB @@ -2781,7 +2781,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(MterpSet32Static) + call SYMBOL(MterpSPutU32) testb %al, %al jnz MterpException RESTORE_IBASE @@ -2796,7 +2796,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * */ /* sput-wide vAA, field@BBBB */ - .extern MterpSet64Static + .extern MterpSPutU64 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref BBBB @@ -2806,7 +2806,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(MterpSet64Static) + call SYMBOL(MterpSPutU64) testb %al, %al jnz MterpException RESTORE_IBASE @@ -2824,7 +2824,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl rINST, OUT_ARG2(%esp) movl rSELF, %ecx movl %ecx, OUT_ARG3(%esp) - call SYMBOL(MterpSputObject) + call SYMBOL(MterpSPutObj) testb %al, %al jz MterpException RESTORE_IBASE @@ -2841,7 +2841,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field@BBBB */ - .extern MterpSetBooleanStatic + .extern MterpSPutU8 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref BBBB @@ -2851,7 +2851,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(MterpSetBooleanStatic) + call SYMBOL(MterpSPutU8) testb %al, %al jnz MterpException RESTORE_IBASE @@ -2869,7 +2869,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field@BBBB */ - .extern MterpSetByteStatic + .extern MterpSPutI8 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref BBBB @@ -2879,7 +2879,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(MterpSetByteStatic) + call SYMBOL(MterpSPutI8) testb %al, %al jnz MterpException RESTORE_IBASE @@ -2897,7 +2897,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field@BBBB */ - .extern MterpSetCharStatic + .extern MterpSPutU16 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref BBBB @@ -2907,7 +2907,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(MterpSetCharStatic) + call SYMBOL(MterpSPutU16) testb %al, %al jnz MterpException RESTORE_IBASE @@ -2925,7 +2925,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field@BBBB */ - .extern MterpSetShortStatic + .extern MterpSPutI16 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref BBBB @@ -2935,7 +2935,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop movl %eax, OUT_ARG2(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(MterpSetShortStatic) + call SYMBOL(MterpSPutI16) testb %al, %al jnz MterpException RESTORE_IBASE diff --git a/runtime/interpreter/mterp/out/mterp_x86_64.S b/runtime/interpreter/mterp/out/mterp_x86_64.S index 56d68e6caa..524dce412e 100644 --- a/runtime/interpreter/mterp/out/mterp_x86_64.S +++ b/runtime/interpreter/mterp/out/mterp_x86_64.S @@ -2075,7 +2075,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop GET_VREG OUT_32_ARG1, %rcx # the object pointer movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 - call SYMBOL(artGet32InstanceFromMterp) + call SYMBOL(MterpIGetU32) movq rSELF, %rcx cmpq $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException # bail out @@ -2108,7 +2108,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop GET_VREG OUT_32_ARG1, %rcx # the object pointer movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 - call SYMBOL(artGet64InstanceFromMterp) + call SYMBOL(MterpIGetU64) movq rSELF, %rcx cmpq $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException # bail out @@ -2142,7 +2142,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop GET_VREG OUT_32_ARG1, %rcx # the object pointer movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 - call SYMBOL(artGetObjInstanceFromMterp) + call SYMBOL(MterpIGetObj) movq rSELF, %rcx cmpq $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException # bail out @@ -2176,7 +2176,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop GET_VREG OUT_32_ARG1, %rcx # the object pointer movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 - call SYMBOL(artGetBooleanInstanceFromMterp) + call SYMBOL(MterpIGetU8) movq rSELF, %rcx cmpq $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException # bail out @@ -2210,7 +2210,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop GET_VREG OUT_32_ARG1, %rcx # the object pointer movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 - call SYMBOL(artGetByteInstanceFromMterp) + call SYMBOL(MterpIGetI8) movq rSELF, %rcx cmpq $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException # bail out @@ -2244,7 +2244,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop GET_VREG OUT_32_ARG1, %rcx # the object pointer movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 - call SYMBOL(artGetCharInstanceFromMterp) + call SYMBOL(MterpIGetU16) movq rSELF, %rcx cmpq $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException # bail out @@ -2278,7 +2278,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop GET_VREG OUT_32_ARG1, %rcx # the object pointer movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 - call SYMBOL(artGetShortInstanceFromMterp) + call SYMBOL(MterpIGetI16) movq rSELF, %rcx cmpq $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException # bail out @@ -2305,7 +2305,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet32InstanceFromMterp + .extern MterpIPutU32 EXPORT_PC movzwl 2(rPC), OUT_32_ARG0 # field ref <- 0000CCCC movzbq rINSTbl, %rcx # rcx<- BA @@ -2314,7 +2314,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop andb $0xf, rINSTbl # rINST<- A GET_VREG OUT_32_ARG2, rINSTq # fp[A] movq OFF_FP_METHOD(rFP), OUT_ARG3 # referrer - call SYMBOL(artSet32InstanceFromMterp) + call SYMBOL(MterpIPutU32) testb %al, %al jnz MterpPossibleException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 @@ -2324,7 +2324,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop .L_op_iput_wide: /* 0x5a */ /* File: x86_64/op_iput_wide.S */ /* iput-wide vA, vB, field@CCCC */ - .extern artSet64InstanceFromMterp + .extern MterpIPutU64 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref CCCC movzbq rINSTbl, %rcx # rcx <- BA @@ -2333,7 +2333,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop andb $0xf, rINSTbl # rINST <- A leaq VREG_ADDRESS(rINSTq), OUT_ARG2 # &fp[A] movq OFF_FP_METHOD(rFP), OUT_ARG3 # referrer - call SYMBOL(artSet64InstanceFromMterp) + call SYMBOL(MterpIPutU64) testb %al, %al jnz MterpPossibleException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 @@ -2348,7 +2348,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop REFRESH_INST 91 movl rINST, OUT_32_ARG2 movq rSELF, OUT_ARG3 - call SYMBOL(MterpIputObject) + call SYMBOL(MterpIPutObj) testb %al, %al jz MterpException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 @@ -2364,7 +2364,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet8InstanceFromMterp + .extern MterpIPutU8 EXPORT_PC movzwl 2(rPC), OUT_32_ARG0 # field ref <- 0000CCCC movzbq rINSTbl, %rcx # rcx<- BA @@ -2373,7 +2373,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop andb $0xf, rINSTbl # rINST<- A GET_VREG OUT_32_ARG2, rINSTq # fp[A] movq OFF_FP_METHOD(rFP), OUT_ARG3 # referrer - call SYMBOL(artSet8InstanceFromMterp) + call SYMBOL(MterpIPutU8) testb %al, %al jnz MterpPossibleException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 @@ -2390,7 +2390,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet8InstanceFromMterp + .extern MterpIPutI8 EXPORT_PC movzwl 2(rPC), OUT_32_ARG0 # field ref <- 0000CCCC movzbq rINSTbl, %rcx # rcx<- BA @@ -2399,7 +2399,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop andb $0xf, rINSTbl # rINST<- A GET_VREG OUT_32_ARG2, rINSTq # fp[A] movq OFF_FP_METHOD(rFP), OUT_ARG3 # referrer - call SYMBOL(artSet8InstanceFromMterp) + call SYMBOL(MterpIPutI8) testb %al, %al jnz MterpPossibleException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 @@ -2416,7 +2416,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet16InstanceFromMterp + .extern MterpIPutU16 EXPORT_PC movzwl 2(rPC), OUT_32_ARG0 # field ref <- 0000CCCC movzbq rINSTbl, %rcx # rcx<- BA @@ -2425,7 +2425,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop andb $0xf, rINSTbl # rINST<- A GET_VREG OUT_32_ARG2, rINSTq # fp[A] movq OFF_FP_METHOD(rFP), OUT_ARG3 # referrer - call SYMBOL(artSet16InstanceFromMterp) + call SYMBOL(MterpIPutU16) testb %al, %al jnz MterpPossibleException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 @@ -2442,7 +2442,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern artSet16InstanceFromMterp + .extern MterpIPutI16 EXPORT_PC movzwl 2(rPC), OUT_32_ARG0 # field ref <- 0000CCCC movzbq rINSTbl, %rcx # rcx<- BA @@ -2451,7 +2451,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop andb $0xf, rINSTbl # rINST<- A GET_VREG OUT_32_ARG2, rINSTq # fp[A] movq OFF_FP_METHOD(rFP), OUT_ARG3 # referrer - call SYMBOL(artSet16InstanceFromMterp) + call SYMBOL(MterpIPutI16) testb %al, %al jnz MterpPossibleException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 @@ -2467,12 +2467,12 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short, sget-wide */ /* op vAA, field@BBBB */ - .extern MterpGet32Static + .extern MterpSGetU32 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref CCCC movq OFF_FP_METHOD(rFP), OUT_ARG1 # referrer movq rSELF, OUT_ARG2 # self - call SYMBOL(MterpGet32Static) + call SYMBOL(MterpSGetU32) movq rSELF, %rcx cmpl $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException @@ -2498,12 +2498,12 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short, sget-wide */ /* op vAA, field@BBBB */ - .extern MterpGet64Static + .extern MterpSGetU64 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref CCCC movq OFF_FP_METHOD(rFP), OUT_ARG1 # referrer movq rSELF, OUT_ARG2 # self - call SYMBOL(MterpGet64Static) + call SYMBOL(MterpSGetU64) movq rSELF, %rcx cmpl $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException @@ -2530,12 +2530,12 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short, sget-wide */ /* op vAA, field@BBBB */ - .extern MterpGetObjStatic + .extern MterpSGetObj EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref CCCC movq OFF_FP_METHOD(rFP), OUT_ARG1 # referrer movq rSELF, OUT_ARG2 # self - call SYMBOL(MterpGetObjStatic) + call SYMBOL(MterpSGetObj) movq rSELF, %rcx cmpl $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException @@ -2562,12 +2562,12 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short, sget-wide */ /* op vAA, field@BBBB */ - .extern MterpGetBooleanStatic + .extern MterpSGetU8 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref CCCC movq OFF_FP_METHOD(rFP), OUT_ARG1 # referrer movq rSELF, OUT_ARG2 # self - call SYMBOL(MterpGetBooleanStatic) + call SYMBOL(MterpSGetU8) movq rSELF, %rcx cmpl $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException @@ -2594,12 +2594,12 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short, sget-wide */ /* op vAA, field@BBBB */ - .extern MterpGetByteStatic + .extern MterpSGetI8 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref CCCC movq OFF_FP_METHOD(rFP), OUT_ARG1 # referrer movq rSELF, OUT_ARG2 # self - call SYMBOL(MterpGetByteStatic) + call SYMBOL(MterpSGetI8) movq rSELF, %rcx cmpl $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException @@ -2626,12 +2626,12 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short, sget-wide */ /* op vAA, field@BBBB */ - .extern MterpGetCharStatic + .extern MterpSGetU16 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref CCCC movq OFF_FP_METHOD(rFP), OUT_ARG1 # referrer movq rSELF, OUT_ARG2 # self - call SYMBOL(MterpGetCharStatic) + call SYMBOL(MterpSGetU16) movq rSELF, %rcx cmpl $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException @@ -2658,12 +2658,12 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short, sget-wide */ /* op vAA, field@BBBB */ - .extern MterpGetShortStatic + .extern MterpSGetI16 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref CCCC movq OFF_FP_METHOD(rFP), OUT_ARG1 # referrer movq rSELF, OUT_ARG2 # self - call SYMBOL(MterpGetShortStatic) + call SYMBOL(MterpSGetI16) movq rSELF, %rcx cmpl $0, THREAD_EXCEPTION_OFFSET(%rcx) jnz MterpException @@ -2689,13 +2689,13 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field@BBBB */ - .extern MterpSet32Static + .extern MterpSPutU32 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref BBBB GET_VREG OUT_32_ARG1, rINSTq # fp[AA] movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 # self - call SYMBOL(MterpSet32Static) + call SYMBOL(MterpSPutU32) testb %al, %al jnz MterpException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 @@ -2709,13 +2709,13 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * */ /* sput-wide vAA, field@BBBB */ - .extern MterpSet64Static + .extern MterpSPutU64 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref BBBB leaq VREG_ADDRESS(rINSTq), OUT_ARG1 # &fp[AA] movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 # self - call SYMBOL(MterpSet64Static) + call SYMBOL(MterpSPutU64) testb %al, %al jnz MterpException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 @@ -2730,7 +2730,7 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop REFRESH_INST 105 movq rINSTq, OUT_ARG2 movq rSELF, OUT_ARG3 - call SYMBOL(MterpSputObject) + call SYMBOL(MterpSPutObj) testb %al, %al jz MterpException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 @@ -2746,13 +2746,13 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field@BBBB */ - .extern MterpSetBooleanStatic + .extern MterpSPutU8 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref BBBB GET_VREG OUT_32_ARG1, rINSTq # fp[AA] movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 # self - call SYMBOL(MterpSetBooleanStatic) + call SYMBOL(MterpSPutU8) testb %al, %al jnz MterpException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 @@ -2769,13 +2769,13 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field@BBBB */ - .extern MterpSetByteStatic + .extern MterpSPutI8 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref BBBB GET_VREG OUT_32_ARG1, rINSTq # fp[AA] movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 # self - call SYMBOL(MterpSetByteStatic) + call SYMBOL(MterpSPutI8) testb %al, %al jnz MterpException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 @@ -2792,13 +2792,13 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field@BBBB */ - .extern MterpSetCharStatic + .extern MterpSPutU16 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref BBBB GET_VREG OUT_32_ARG1, rINSTq # fp[AA] movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 # self - call SYMBOL(MterpSetCharStatic) + call SYMBOL(MterpSPutU16) testb %al, %al jnz MterpException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 @@ -2815,13 +2815,13 @@ SYMBOL(artMterpAsmInstructionStart) = .L_op_nop * for: sput, sput-boolean, sput-byte, sput-char, sput-short */ /* op vAA, field@BBBB */ - .extern MterpSetShortStatic + .extern MterpSPutI16 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref BBBB GET_VREG OUT_32_ARG1, rINSTq # fp[AA] movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 # self - call SYMBOL(MterpSetShortStatic) + call SYMBOL(MterpSPutI16) testb %al, %al jnz MterpException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 diff --git a/runtime/interpreter/mterp/x86/op_iget.S b/runtime/interpreter/mterp/x86/op_iget.S index 219463b646..0af1becb24 100644 --- a/runtime/interpreter/mterp/x86/op_iget.S +++ b/runtime/interpreter/mterp/x86/op_iget.S @@ -1,4 +1,4 @@ -%default { "is_object":"0", "helper":"artGet32InstanceFromMterp"} +%default { "is_object":"0", "helper":"MterpIGetU32"} /* * General instance field get. * diff --git a/runtime/interpreter/mterp/x86/op_iget_boolean.S b/runtime/interpreter/mterp/x86/op_iget_boolean.S index 4ab2afcd38..ddccc41cda 100644 --- a/runtime/interpreter/mterp/x86/op_iget_boolean.S +++ b/runtime/interpreter/mterp/x86/op_iget_boolean.S @@ -1 +1 @@ -%include "x86/op_iget.S" { "helper":"artGetBooleanInstanceFromMterp" } +%include "x86/op_iget.S" { "helper":"MterpIGetU8" } diff --git a/runtime/interpreter/mterp/x86/op_iget_byte.S b/runtime/interpreter/mterp/x86/op_iget_byte.S index bb282d4648..cd46d3de08 100644 --- a/runtime/interpreter/mterp/x86/op_iget_byte.S +++ b/runtime/interpreter/mterp/x86/op_iget_byte.S @@ -1 +1 @@ -%include "x86/op_iget.S" { "helper":"artGetByteInstanceFromMterp" } +%include "x86/op_iget.S" { "helper":"MterpIGetI8" } diff --git a/runtime/interpreter/mterp/x86/op_iget_char.S b/runtime/interpreter/mterp/x86/op_iget_char.S index a13203bb81..99697349ae 100644 --- a/runtime/interpreter/mterp/x86/op_iget_char.S +++ b/runtime/interpreter/mterp/x86/op_iget_char.S @@ -1 +1 @@ -%include "x86/op_iget.S" { "helper":"artGetCharInstanceFromMterp" } +%include "x86/op_iget.S" { "helper":"MterpIGetU16" } diff --git a/runtime/interpreter/mterp/x86/op_iget_object.S b/runtime/interpreter/mterp/x86/op_iget_object.S index 79d5e5fd94..3d421fcf7f 100644 --- a/runtime/interpreter/mterp/x86/op_iget_object.S +++ b/runtime/interpreter/mterp/x86/op_iget_object.S @@ -1 +1 @@ -%include "x86/op_iget.S" { "is_object":"1", "helper":"artGetObjInstanceFromMterp" } +%include "x86/op_iget.S" { "is_object":"1", "helper":"MterpIGetObj" } diff --git a/runtime/interpreter/mterp/x86/op_iget_short.S b/runtime/interpreter/mterp/x86/op_iget_short.S index 8fc18a570f..c7477f5db3 100644 --- a/runtime/interpreter/mterp/x86/op_iget_short.S +++ b/runtime/interpreter/mterp/x86/op_iget_short.S @@ -1 +1 @@ -%include "x86/op_iget.S" { "helper":"artGetShortInstanceFromMterp" } +%include "x86/op_iget.S" { "helper":"MterpIGetI16" } diff --git a/runtime/interpreter/mterp/x86/op_iget_wide.S b/runtime/interpreter/mterp/x86/op_iget_wide.S index b111b29587..da27df952b 100644 --- a/runtime/interpreter/mterp/x86/op_iget_wide.S +++ b/runtime/interpreter/mterp/x86/op_iget_wide.S @@ -14,7 +14,7 @@ movl %eax, OUT_ARG2(%esp) # referrer mov rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(artGet64InstanceFromMterp) + call SYMBOL(MterpIGetU64) mov rSELF, %ecx cmpl $$0, THREAD_EXCEPTION_OFFSET(%ecx) jnz MterpException # bail out diff --git a/runtime/interpreter/mterp/x86/op_iput.S b/runtime/interpreter/mterp/x86/op_iput.S index c847e2dc88..4c6603a572 100644 --- a/runtime/interpreter/mterp/x86/op_iput.S +++ b/runtime/interpreter/mterp/x86/op_iput.S @@ -1,11 +1,11 @@ -%default { "handler":"artSet32InstanceFromMterp" } +%default { "helper":"MterpIPutU32" } /* * General 32-bit instance field put. * * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern $handler + .extern $helper EXPORT_PC movzwl 2(rPC), %eax # eax<- 0000CCCC movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -18,7 +18,7 @@ movl %eax, OUT_ARG2(%esp) # fp[A] movl OFF_FP_METHOD(rFP), %eax movl %eax, OUT_ARG3(%esp) # referrer - call SYMBOL($handler) + call SYMBOL($helper) testb %al, %al jnz MterpPossibleException RESTORE_IBASE diff --git a/runtime/interpreter/mterp/x86/op_iput_boolean.S b/runtime/interpreter/mterp/x86/op_iput_boolean.S index 11cab8880f..fdd530374e 100644 --- a/runtime/interpreter/mterp/x86/op_iput_boolean.S +++ b/runtime/interpreter/mterp/x86/op_iput_boolean.S @@ -1 +1 @@ -%include "x86/op_iput.S" { "handler":"artSet8InstanceFromMterp" } +%include "x86/op_iput.S" { "helper":"MterpIPutU8" } diff --git a/runtime/interpreter/mterp/x86/op_iput_byte.S b/runtime/interpreter/mterp/x86/op_iput_byte.S index 11cab8880f..b81850c538 100644 --- a/runtime/interpreter/mterp/x86/op_iput_byte.S +++ b/runtime/interpreter/mterp/x86/op_iput_byte.S @@ -1 +1 @@ -%include "x86/op_iput.S" { "handler":"artSet8InstanceFromMterp" } +%include "x86/op_iput.S" { "helper":"MterpIPutI8" } diff --git a/runtime/interpreter/mterp/x86/op_iput_char.S b/runtime/interpreter/mterp/x86/op_iput_char.S index abbf2bdc6e..dde385371e 100644 --- a/runtime/interpreter/mterp/x86/op_iput_char.S +++ b/runtime/interpreter/mterp/x86/op_iput_char.S @@ -1 +1 @@ -%include "x86/op_iput.S" { "handler":"artSet16InstanceFromMterp" } +%include "x86/op_iput.S" { "helper":"MterpIPutU16" } diff --git a/runtime/interpreter/mterp/x86/op_iput_object.S b/runtime/interpreter/mterp/x86/op_iput_object.S index e0136970b0..56e026e40a 100644 --- a/runtime/interpreter/mterp/x86/op_iput_object.S +++ b/runtime/interpreter/mterp/x86/op_iput_object.S @@ -6,7 +6,7 @@ movl rINST, OUT_ARG2(%esp) movl rSELF, %eax movl %eax, OUT_ARG3(%esp) - call SYMBOL(MterpIputObject) + call SYMBOL(MterpIPutObj) testb %al, %al jz MterpException RESTORE_IBASE diff --git a/runtime/interpreter/mterp/x86/op_iput_short.S b/runtime/interpreter/mterp/x86/op_iput_short.S index abbf2bdc6e..130e875bb2 100644 --- a/runtime/interpreter/mterp/x86/op_iput_short.S +++ b/runtime/interpreter/mterp/x86/op_iput_short.S @@ -1 +1 @@ -%include "x86/op_iput.S" { "handler":"artSet16InstanceFromMterp" } +%include "x86/op_iput.S" { "helper":"MterpIPutI16" } diff --git a/runtime/interpreter/mterp/x86/op_iput_wide.S b/runtime/interpreter/mterp/x86/op_iput_wide.S index 122eecf43f..ea22b919c3 100644 --- a/runtime/interpreter/mterp/x86/op_iput_wide.S +++ b/runtime/interpreter/mterp/x86/op_iput_wide.S @@ -1,5 +1,5 @@ /* iput-wide vA, vB, field@CCCC */ - .extern artSet64InstanceFromMterp + .extern MterpIPutU64 EXPORT_PC movzwl 2(rPC), %eax # eax <- 0000CCCC movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -12,7 +12,7 @@ movl %eax, OUT_ARG2(%esp) # &fp[A] movl OFF_FP_METHOD(rFP), %eax movl %eax, OUT_ARG3(%esp) # referrer - call SYMBOL(artSet64InstanceFromMterp) + call SYMBOL(MterpIPutU64) testb %al, %al jnz MterpPossibleException RESTORE_IBASE diff --git a/runtime/interpreter/mterp/x86/op_sget.S b/runtime/interpreter/mterp/x86/op_sget.S index 6e42d323e6..66c7b0bac5 100644 --- a/runtime/interpreter/mterp/x86/op_sget.S +++ b/runtime/interpreter/mterp/x86/op_sget.S @@ -1,4 +1,4 @@ -%default { "is_object":"0", "helper":"MterpGet32Static" } +%default { "is_object":"0", "helper":"MterpSGetU32" } /* * General SGET handler wrapper. * diff --git a/runtime/interpreter/mterp/x86/op_sget_boolean.S b/runtime/interpreter/mterp/x86/op_sget_boolean.S index 5fa2bf0cfc..3936eeae45 100644 --- a/runtime/interpreter/mterp/x86/op_sget_boolean.S +++ b/runtime/interpreter/mterp/x86/op_sget_boolean.S @@ -1 +1 @@ -%include "x86/op_sget.S" {"helper":"MterpGetBooleanStatic"} +%include "x86/op_sget.S" {"helper":"MterpSGetU8"} diff --git a/runtime/interpreter/mterp/x86/op_sget_byte.S b/runtime/interpreter/mterp/x86/op_sget_byte.S index ef812f118e..967586d944 100644 --- a/runtime/interpreter/mterp/x86/op_sget_byte.S +++ b/runtime/interpreter/mterp/x86/op_sget_byte.S @@ -1 +1 @@ -%include "x86/op_sget.S" {"helper":"MterpGetByteStatic"} +%include "x86/op_sget.S" {"helper":"MterpSGetI8"} diff --git a/runtime/interpreter/mterp/x86/op_sget_char.S b/runtime/interpreter/mterp/x86/op_sget_char.S index 3bc34ef338..b706f18638 100644 --- a/runtime/interpreter/mterp/x86/op_sget_char.S +++ b/runtime/interpreter/mterp/x86/op_sget_char.S @@ -1 +1 @@ -%include "x86/op_sget.S" {"helper":"MterpGetCharStatic"} +%include "x86/op_sget.S" {"helper":"MterpSGetU16"} diff --git a/runtime/interpreter/mterp/x86/op_sget_object.S b/runtime/interpreter/mterp/x86/op_sget_object.S index b829e75f30..eac8836534 100644 --- a/runtime/interpreter/mterp/x86/op_sget_object.S +++ b/runtime/interpreter/mterp/x86/op_sget_object.S @@ -1 +1 @@ -%include "x86/op_sget.S" {"is_object":"1", "helper":"MterpGetObjStatic"} +%include "x86/op_sget.S" {"is_object":"1", "helper":"MterpSGetObj"} diff --git a/runtime/interpreter/mterp/x86/op_sget_short.S b/runtime/interpreter/mterp/x86/op_sget_short.S index 449cf6f918..ee058a6016 100644 --- a/runtime/interpreter/mterp/x86/op_sget_short.S +++ b/runtime/interpreter/mterp/x86/op_sget_short.S @@ -1 +1 @@ -%include "x86/op_sget.S" {"helper":"MterpGetShortStatic"} +%include "x86/op_sget.S" {"helper":"MterpSGetI16"} diff --git a/runtime/interpreter/mterp/x86/op_sget_wide.S b/runtime/interpreter/mterp/x86/op_sget_wide.S index a605bcf2e5..994cc3aebb 100644 --- a/runtime/interpreter/mterp/x86/op_sget_wide.S +++ b/runtime/interpreter/mterp/x86/op_sget_wide.S @@ -3,7 +3,7 @@ * */ /* sget-wide vAA, field@BBBB */ - .extern MterpGet64Static + .extern MterpSGetU64 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref CCCC @@ -11,7 +11,7 @@ movl %eax, OUT_ARG1(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG2(%esp) # self - call SYMBOL(MterpGet64Static) + call SYMBOL(MterpSGetU64) movl rSELF, %ecx cmpl $$0, THREAD_EXCEPTION_OFFSET(%ecx) jnz MterpException diff --git a/runtime/interpreter/mterp/x86/op_sput.S b/runtime/interpreter/mterp/x86/op_sput.S index 99f6088982..e99e7a7239 100644 --- a/runtime/interpreter/mterp/x86/op_sput.S +++ b/runtime/interpreter/mterp/x86/op_sput.S @@ -1,4 +1,4 @@ -%default { "helper":"MterpSet32Static"} +%default { "helper":"MterpSPutU32"} /* * General SPUT handler wrapper. * diff --git a/runtime/interpreter/mterp/x86/op_sput_boolean.S b/runtime/interpreter/mterp/x86/op_sput_boolean.S index a7fffda1db..c6aa7c4cd1 100644 --- a/runtime/interpreter/mterp/x86/op_sput_boolean.S +++ b/runtime/interpreter/mterp/x86/op_sput_boolean.S @@ -1 +1 @@ -%include "x86/op_sput.S" {"helper":"MterpSetBooleanStatic"} +%include "x86/op_sput.S" {"helper":"MterpSPutU8"} diff --git a/runtime/interpreter/mterp/x86/op_sput_byte.S b/runtime/interpreter/mterp/x86/op_sput_byte.S index 3a5ff9267d..fd504a8023 100644 --- a/runtime/interpreter/mterp/x86/op_sput_byte.S +++ b/runtime/interpreter/mterp/x86/op_sput_byte.S @@ -1 +1 @@ -%include "x86/op_sput.S" {"helper":"MterpSetByteStatic"} +%include "x86/op_sput.S" {"helper":"MterpSPutI8"} diff --git a/runtime/interpreter/mterp/x86/op_sput_char.S b/runtime/interpreter/mterp/x86/op_sput_char.S index 565cc2aa0f..b4d0997737 100644 --- a/runtime/interpreter/mterp/x86/op_sput_char.S +++ b/runtime/interpreter/mterp/x86/op_sput_char.S @@ -1 +1 @@ -%include "x86/op_sput.S" {"helper":"MterpSetCharStatic"} +%include "x86/op_sput.S" {"helper":"MterpSPutU16"} diff --git a/runtime/interpreter/mterp/x86/op_sput_object.S b/runtime/interpreter/mterp/x86/op_sput_object.S index 0db517723b..941b07201e 100644 --- a/runtime/interpreter/mterp/x86/op_sput_object.S +++ b/runtime/interpreter/mterp/x86/op_sput_object.S @@ -6,7 +6,7 @@ movl rINST, OUT_ARG2(%esp) movl rSELF, %ecx movl %ecx, OUT_ARG3(%esp) - call SYMBOL(MterpSputObject) + call SYMBOL(MterpSPutObj) testb %al, %al jz MterpException RESTORE_IBASE diff --git a/runtime/interpreter/mterp/x86/op_sput_short.S b/runtime/interpreter/mterp/x86/op_sput_short.S index 85c344165e..eba01bdfd0 100644 --- a/runtime/interpreter/mterp/x86/op_sput_short.S +++ b/runtime/interpreter/mterp/x86/op_sput_short.S @@ -1 +1 @@ -%include "x86/op_sput.S" {"helper":"MterpSetShortStatic"} +%include "x86/op_sput.S" {"helper":"MterpSPutI16"} diff --git a/runtime/interpreter/mterp/x86/op_sput_wide.S b/runtime/interpreter/mterp/x86/op_sput_wide.S index 8cc7e28554..f58150706e 100644 --- a/runtime/interpreter/mterp/x86/op_sput_wide.S +++ b/runtime/interpreter/mterp/x86/op_sput_wide.S @@ -3,7 +3,7 @@ * */ /* sput-wide vAA, field@BBBB */ - .extern MterpSet64Static + .extern MterpSPutU64 EXPORT_PC movzwl 2(rPC), %eax movl %eax, OUT_ARG0(%esp) # field ref BBBB @@ -13,7 +13,7 @@ movl %eax, OUT_ARG2(%esp) # referrer movl rSELF, %ecx movl %ecx, OUT_ARG3(%esp) # self - call SYMBOL(MterpSet64Static) + call SYMBOL(MterpSPutU64) testb %al, %al jnz MterpException RESTORE_IBASE diff --git a/runtime/interpreter/mterp/x86_64/op_iget.S b/runtime/interpreter/mterp/x86_64/op_iget.S index ffc14b5d22..5c6cab6acb 100644 --- a/runtime/interpreter/mterp/x86_64/op_iget.S +++ b/runtime/interpreter/mterp/x86_64/op_iget.S @@ -1,4 +1,4 @@ -%default { "is_object":"0", "helper":"artGet32InstanceFromMterp", "wide":"0"} +%default { "is_object":"0", "helper":"MterpIGetU32", "wide":"0"} /* * General instance field get. * diff --git a/runtime/interpreter/mterp/x86_64/op_iget_boolean.S b/runtime/interpreter/mterp/x86_64/op_iget_boolean.S index 1379d53cfe..18e9264926 100644 --- a/runtime/interpreter/mterp/x86_64/op_iget_boolean.S +++ b/runtime/interpreter/mterp/x86_64/op_iget_boolean.S @@ -1 +1 @@ -%include "x86_64/op_iget.S" { "helper":"artGetBooleanInstanceFromMterp" } +%include "x86_64/op_iget.S" { "helper":"MterpIGetU8" } diff --git a/runtime/interpreter/mterp/x86_64/op_iget_byte.S b/runtime/interpreter/mterp/x86_64/op_iget_byte.S index 93047ec99c..bec0ad526c 100644 --- a/runtime/interpreter/mterp/x86_64/op_iget_byte.S +++ b/runtime/interpreter/mterp/x86_64/op_iget_byte.S @@ -1 +1 @@ -%include "x86_64/op_iget.S" { "helper":"artGetByteInstanceFromMterp" } +%include "x86_64/op_iget.S" { "helper":"MterpIGetI8" } diff --git a/runtime/interpreter/mterp/x86_64/op_iget_char.S b/runtime/interpreter/mterp/x86_64/op_iget_char.S index 239f0d0bd7..5e22b88129 100644 --- a/runtime/interpreter/mterp/x86_64/op_iget_char.S +++ b/runtime/interpreter/mterp/x86_64/op_iget_char.S @@ -1 +1 @@ -%include "x86_64/op_iget.S" { "helper":"artGetCharInstanceFromMterp" } +%include "x86_64/op_iget.S" { "helper":"MterpIGetU16" } diff --git a/runtime/interpreter/mterp/x86_64/op_iget_object.S b/runtime/interpreter/mterp/x86_64/op_iget_object.S index 2104d2c744..bcef1d2c25 100644 --- a/runtime/interpreter/mterp/x86_64/op_iget_object.S +++ b/runtime/interpreter/mterp/x86_64/op_iget_object.S @@ -1 +1 @@ -%include "x86_64/op_iget.S" { "is_object":"1", "helper":"artGetObjInstanceFromMterp" } +%include "x86_64/op_iget.S" { "is_object":"1", "helper":"MterpIGetObj" } diff --git a/runtime/interpreter/mterp/x86_64/op_iget_short.S b/runtime/interpreter/mterp/x86_64/op_iget_short.S index 3525effe75..14c49f7711 100644 --- a/runtime/interpreter/mterp/x86_64/op_iget_short.S +++ b/runtime/interpreter/mterp/x86_64/op_iget_short.S @@ -1 +1 @@ -%include "x86_64/op_iget.S" { "helper":"artGetShortInstanceFromMterp" } +%include "x86_64/op_iget.S" { "helper":"MterpIGetI16" } diff --git a/runtime/interpreter/mterp/x86_64/op_iget_wide.S b/runtime/interpreter/mterp/x86_64/op_iget_wide.S index 706c44121e..d9d174400c 100644 --- a/runtime/interpreter/mterp/x86_64/op_iget_wide.S +++ b/runtime/interpreter/mterp/x86_64/op_iget_wide.S @@ -1 +1 @@ -%include "x86_64/op_iget.S" { "helper":"artGet64InstanceFromMterp", "wide":"1" } +%include "x86_64/op_iget.S" { "helper":"MterpIGetU64", "wide":"1" } diff --git a/runtime/interpreter/mterp/x86_64/op_iput.S b/runtime/interpreter/mterp/x86_64/op_iput.S index 6b7cb1cc84..12affdbe84 100644 --- a/runtime/interpreter/mterp/x86_64/op_iput.S +++ b/runtime/interpreter/mterp/x86_64/op_iput.S @@ -1,11 +1,11 @@ -%default { "handler":"artSet32InstanceFromMterp"} +%default { "helper":"MterpIPutU32"} /* * General 32-bit instance field put. * * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-short */ /* op vA, vB, field@CCCC */ - .extern $handler + .extern $helper EXPORT_PC movzwl 2(rPC), OUT_32_ARG0 # field ref <- 0000CCCC movzbq rINSTbl, %rcx # rcx<- BA @@ -14,7 +14,7 @@ andb $$0xf, rINSTbl # rINST<- A GET_VREG OUT_32_ARG2, rINSTq # fp[A] movq OFF_FP_METHOD(rFP), OUT_ARG3 # referrer - call SYMBOL($handler) + call SYMBOL($helper) testb %al, %al jnz MterpPossibleException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 diff --git a/runtime/interpreter/mterp/x86_64/op_iput_boolean.S b/runtime/interpreter/mterp/x86_64/op_iput_boolean.S index cb4b1cde45..06bbd704d7 100644 --- a/runtime/interpreter/mterp/x86_64/op_iput_boolean.S +++ b/runtime/interpreter/mterp/x86_64/op_iput_boolean.S @@ -1 +1 @@ -%include "x86_64/op_iput.S" { "handler":"artSet8InstanceFromMterp" } +%include "x86_64/op_iput.S" { "helper":"MterpIPutU8" } diff --git a/runtime/interpreter/mterp/x86_64/op_iput_byte.S b/runtime/interpreter/mterp/x86_64/op_iput_byte.S index cb4b1cde45..53f9008eb5 100644 --- a/runtime/interpreter/mterp/x86_64/op_iput_byte.S +++ b/runtime/interpreter/mterp/x86_64/op_iput_byte.S @@ -1 +1 @@ -%include "x86_64/op_iput.S" { "handler":"artSet8InstanceFromMterp" } +%include "x86_64/op_iput.S" { "helper":"MterpIPutI8" } diff --git a/runtime/interpreter/mterp/x86_64/op_iput_char.S b/runtime/interpreter/mterp/x86_64/op_iput_char.S index b4e147cf5e..4736f5e9d4 100644 --- a/runtime/interpreter/mterp/x86_64/op_iput_char.S +++ b/runtime/interpreter/mterp/x86_64/op_iput_char.S @@ -1 +1 @@ -%include "x86_64/op_iput.S" { "handler":"artSet16InstanceFromMterp" } +%include "x86_64/op_iput.S" { "helper":"MterpIPutU16" } diff --git a/runtime/interpreter/mterp/x86_64/op_iput_object.S b/runtime/interpreter/mterp/x86_64/op_iput_object.S index 828712d8ba..22648cdde7 100644 --- a/runtime/interpreter/mterp/x86_64/op_iput_object.S +++ b/runtime/interpreter/mterp/x86_64/op_iput_object.S @@ -4,7 +4,7 @@ REFRESH_INST ${opnum} movl rINST, OUT_32_ARG2 movq rSELF, OUT_ARG3 - call SYMBOL(MterpIputObject) + call SYMBOL(MterpIPutObj) testb %al, %al jz MterpException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 diff --git a/runtime/interpreter/mterp/x86_64/op_iput_short.S b/runtime/interpreter/mterp/x86_64/op_iput_short.S index b4e147cf5e..dca5735963 100644 --- a/runtime/interpreter/mterp/x86_64/op_iput_short.S +++ b/runtime/interpreter/mterp/x86_64/op_iput_short.S @@ -1 +1 @@ -%include "x86_64/op_iput.S" { "handler":"artSet16InstanceFromMterp" } +%include "x86_64/op_iput.S" { "helper":"MterpIPutI16" } diff --git a/runtime/interpreter/mterp/x86_64/op_iput_wide.S b/runtime/interpreter/mterp/x86_64/op_iput_wide.S index e59717b846..4f8c47c1e6 100644 --- a/runtime/interpreter/mterp/x86_64/op_iput_wide.S +++ b/runtime/interpreter/mterp/x86_64/op_iput_wide.S @@ -1,5 +1,5 @@ /* iput-wide vA, vB, field@CCCC */ - .extern artSet64InstanceFromMterp + .extern MterpIPutU64 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref CCCC movzbq rINSTbl, %rcx # rcx <- BA @@ -8,7 +8,7 @@ andb $$0xf, rINSTbl # rINST <- A leaq VREG_ADDRESS(rINSTq), OUT_ARG2 # &fp[A] movq OFF_FP_METHOD(rFP), OUT_ARG3 # referrer - call SYMBOL(artSet64InstanceFromMterp) + call SYMBOL(MterpIPutU64) testb %al, %al jnz MterpPossibleException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 diff --git a/runtime/interpreter/mterp/x86_64/op_sget.S b/runtime/interpreter/mterp/x86_64/op_sget.S index e996c77801..c15ac1e280 100644 --- a/runtime/interpreter/mterp/x86_64/op_sget.S +++ b/runtime/interpreter/mterp/x86_64/op_sget.S @@ -1,4 +1,4 @@ -%default { "is_object":"0", "helper":"MterpGet32Static", "wide":"0" } +%default { "is_object":"0", "helper":"MterpSGetU32", "wide":"0" } /* * General SGET handler wrapper. * diff --git a/runtime/interpreter/mterp/x86_64/op_sget_boolean.S b/runtime/interpreter/mterp/x86_64/op_sget_boolean.S index ee772ad4e1..e5a4e41995 100644 --- a/runtime/interpreter/mterp/x86_64/op_sget_boolean.S +++ b/runtime/interpreter/mterp/x86_64/op_sget_boolean.S @@ -1 +1 @@ -%include "x86_64/op_sget.S" {"helper":"MterpGetBooleanStatic"} +%include "x86_64/op_sget.S" {"helper":"MterpSGetU8"} diff --git a/runtime/interpreter/mterp/x86_64/op_sget_byte.S b/runtime/interpreter/mterp/x86_64/op_sget_byte.S index f65ea4951e..4602f7da53 100644 --- a/runtime/interpreter/mterp/x86_64/op_sget_byte.S +++ b/runtime/interpreter/mterp/x86_64/op_sget_byte.S @@ -1 +1 @@ -%include "x86_64/op_sget.S" {"helper":"MterpGetByteStatic"} +%include "x86_64/op_sget.S" {"helper":"MterpSGetI8"} diff --git a/runtime/interpreter/mterp/x86_64/op_sget_char.S b/runtime/interpreter/mterp/x86_64/op_sget_char.S index 3972551bec..a094a542de 100644 --- a/runtime/interpreter/mterp/x86_64/op_sget_char.S +++ b/runtime/interpreter/mterp/x86_64/op_sget_char.S @@ -1 +1 @@ -%include "x86_64/op_sget.S" {"helper":"MterpGetCharStatic"} +%include "x86_64/op_sget.S" {"helper":"MterpSGetU16"} diff --git a/runtime/interpreter/mterp/x86_64/op_sget_object.S b/runtime/interpreter/mterp/x86_64/op_sget_object.S index a0bbfd8d35..94597b187c 100644 --- a/runtime/interpreter/mterp/x86_64/op_sget_object.S +++ b/runtime/interpreter/mterp/x86_64/op_sget_object.S @@ -1 +1 @@ -%include "x86_64/op_sget.S" {"is_object":"1", "helper":"MterpGetObjStatic"} +%include "x86_64/op_sget.S" {"is_object":"1", "helper":"MterpSGetObj"} diff --git a/runtime/interpreter/mterp/x86_64/op_sget_short.S b/runtime/interpreter/mterp/x86_64/op_sget_short.S index df212dc5c9..dee5c247b9 100644 --- a/runtime/interpreter/mterp/x86_64/op_sget_short.S +++ b/runtime/interpreter/mterp/x86_64/op_sget_short.S @@ -1 +1 @@ -%include "x86_64/op_sget.S" {"helper":"MterpGetShortStatic"} +%include "x86_64/op_sget.S" {"helper":"MterpSGetI16"} diff --git a/runtime/interpreter/mterp/x86_64/op_sget_wide.S b/runtime/interpreter/mterp/x86_64/op_sget_wide.S index 1e98e28a92..65ddb8a09c 100644 --- a/runtime/interpreter/mterp/x86_64/op_sget_wide.S +++ b/runtime/interpreter/mterp/x86_64/op_sget_wide.S @@ -1 +1 @@ -%include "x86_64/op_sget.S" {"helper":"MterpGet64Static", "wide":"1"} +%include "x86_64/op_sget.S" {"helper":"MterpSGetU64", "wide":"1"} diff --git a/runtime/interpreter/mterp/x86_64/op_sput.S b/runtime/interpreter/mterp/x86_64/op_sput.S index 9705619900..9a33d521b9 100644 --- a/runtime/interpreter/mterp/x86_64/op_sput.S +++ b/runtime/interpreter/mterp/x86_64/op_sput.S @@ -1,4 +1,4 @@ -%default { "helper":"MterpSet32Static"} +%default { "helper":"MterpSPutU32"} /* * General SPUT handler wrapper. * diff --git a/runtime/interpreter/mterp/x86_64/op_sput_boolean.S b/runtime/interpreter/mterp/x86_64/op_sput_boolean.S index 8bf4a62328..ea9acbfdc7 100644 --- a/runtime/interpreter/mterp/x86_64/op_sput_boolean.S +++ b/runtime/interpreter/mterp/x86_64/op_sput_boolean.S @@ -1 +1 @@ -%include "x86_64/op_sput.S" {"helper":"MterpSetBooleanStatic"} +%include "x86_64/op_sput.S" {"helper":"MterpSPutU8"} diff --git a/runtime/interpreter/mterp/x86_64/op_sput_byte.S b/runtime/interpreter/mterp/x86_64/op_sput_byte.S index 5bb26ebed5..62c9e205a1 100644 --- a/runtime/interpreter/mterp/x86_64/op_sput_byte.S +++ b/runtime/interpreter/mterp/x86_64/op_sput_byte.S @@ -1 +1 @@ -%include "x86_64/op_sput.S" {"helper":"MterpSetByteStatic"} +%include "x86_64/op_sput.S" {"helper":"MterpSPutI8"} diff --git a/runtime/interpreter/mterp/x86_64/op_sput_char.S b/runtime/interpreter/mterp/x86_64/op_sput_char.S index 42b244e2bb..ab0196e027 100644 --- a/runtime/interpreter/mterp/x86_64/op_sput_char.S +++ b/runtime/interpreter/mterp/x86_64/op_sput_char.S @@ -1 +1 @@ -%include "x86_64/op_sput.S" {"helper":"MterpSetCharStatic"} +%include "x86_64/op_sput.S" {"helper":"MterpSPutU16"} diff --git a/runtime/interpreter/mterp/x86_64/op_sput_object.S b/runtime/interpreter/mterp/x86_64/op_sput_object.S index eb5a37673e..8a47074ec3 100644 --- a/runtime/interpreter/mterp/x86_64/op_sput_object.S +++ b/runtime/interpreter/mterp/x86_64/op_sput_object.S @@ -4,7 +4,7 @@ REFRESH_INST ${opnum} movq rINSTq, OUT_ARG2 movq rSELF, OUT_ARG3 - call SYMBOL(MterpSputObject) + call SYMBOL(MterpSPutObj) testb %al, %al jz MterpException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 diff --git a/runtime/interpreter/mterp/x86_64/op_sput_short.S b/runtime/interpreter/mterp/x86_64/op_sput_short.S index 9670092aaf..f73a3fc69e 100644 --- a/runtime/interpreter/mterp/x86_64/op_sput_short.S +++ b/runtime/interpreter/mterp/x86_64/op_sput_short.S @@ -1 +1 @@ -%include "x86_64/op_sput.S" {"helper":"MterpSetShortStatic"} +%include "x86_64/op_sput.S" {"helper":"MterpSPutI16"} diff --git a/runtime/interpreter/mterp/x86_64/op_sput_wide.S b/runtime/interpreter/mterp/x86_64/op_sput_wide.S index a21bcb5dd5..464d1697ac 100644 --- a/runtime/interpreter/mterp/x86_64/op_sput_wide.S +++ b/runtime/interpreter/mterp/x86_64/op_sput_wide.S @@ -3,13 +3,13 @@ * */ /* sput-wide vAA, field@BBBB */ - .extern MterpSet64Static + .extern MterpSPutU64 EXPORT_PC movzwq 2(rPC), OUT_ARG0 # field ref BBBB leaq VREG_ADDRESS(rINSTq), OUT_ARG1 # &fp[AA] movq OFF_FP_METHOD(rFP), OUT_ARG2 # referrer movq rSELF, OUT_ARG3 # self - call SYMBOL(MterpSet64Static) + call SYMBOL(MterpSPutU64) testb %al, %al jnz MterpException ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 -- GitLab From dee8169f20d96d00cd602c0ef590ebc3d0903936 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Thu, 23 Aug 2018 16:05:19 +0100 Subject: [PATCH 005/126] Fix the template parameter passed to some art::GetClassRoot uses. Test: art/test.py Change-Id: Icb6a1103e1f84a480bcb186a47bc282912ccc18a --- runtime/class_root.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/class_root.h b/runtime/class_root.h index 4aa9801ab4..19a78b1ffb 100644 --- a/runtime/class_root.h +++ b/runtime/class_root.h @@ -165,18 +165,19 @@ CLASS_ROOT_LIST(SPECIALIZE_CLASS_ROOT_SELECTOR) template inline ObjPtr GetClassRoot(ObjPtr> class_roots) REQUIRES_SHARED(Locks::mutator_lock_) { - return GetClassRoot(detail::ClassRootSelector::value, class_roots); + return GetClassRoot(detail::ClassRootSelector::value, + class_roots); } template inline ObjPtr GetClassRoot(ClassLinker* linker) REQUIRES_SHARED(Locks::mutator_lock_) { - return GetClassRoot(detail::ClassRootSelector::value, linker); + return GetClassRoot(detail::ClassRootSelector::value, linker); } template inline ObjPtr GetClassRoot() REQUIRES_SHARED(Locks::mutator_lock_) { - return GetClassRoot(detail::ClassRootSelector::value); + return GetClassRoot(detail::ClassRootSelector::value); } } // namespace art -- GitLab From cd2edfc99c07e958cd926ae61a74ee01a32666a2 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Sun, 19 Aug 2018 15:38:32 -0700 Subject: [PATCH 006/126] Add measurement of linkage pairs Print most commonly used linkage pairs to see if it efficient to add a table. Also some random cleanups. Bug: 77709234 Bug: 77808483 Test: test-art-host Change-Id: Ibb4edc06b2ae922a219e4edc057e3361ac357346 --- tools/dexanalyze/dexanalyze_bytecode.cc | 131 ++++++++++++++++++------ tools/dexanalyze/dexanalyze_bytecode.h | 16 ++- 2 files changed, 111 insertions(+), 36 deletions(-) diff --git a/tools/dexanalyze/dexanalyze_bytecode.cc b/tools/dexanalyze/dexanalyze_bytecode.cc index 0bb3f911a2..e6e58c0ecc 100644 --- a/tools/dexanalyze/dexanalyze_bytecode.cc +++ b/tools/dexanalyze/dexanalyze_bytecode.cc @@ -50,6 +50,53 @@ static inline SafeMap SortByOrder(const SafeMap& usage, Order order) return ret; } +template +std::ostream& operator <<(std::ostream& os, const std::pair& pair) { + return os << "{" << pair.first << ", " << pair.second << "}"; +} + +template class ArrayType> +SafeMap MakeUsageMap(const ArrayType& array) { + SafeMap ret; + for (size_t i = 0; i < array.size(); ++i) { + if (array[i] > 0) { + ret.Put(i, array[i]); + } + } + return ret; +} + +template class Map> +void PrintMostUsed(std::ostream& os, + const Map& usage, + size_t max_count, + std::function printer = + [](std::ostream& os, T v) { + os << v; + }) { + std::vector> sorted; + uint64_t total = 0u; + for (const auto& pair : usage) { + sorted.emplace_back(pair.second, pair.first); + total += pair.second; + } + std::sort(sorted.rbegin(), sorted.rend()); + uint64_t other = 0u; + for (auto&& pair : sorted) { + if (max_count > 0) { + os << Percent(pair.first, total) << " : "; + printer(os, pair.second); + os << "\n"; + --max_count; + } else { + other += pair.first; + } + } + if (other != 0u) { + os << "other: " << Percent(other, total) << "\n"; + } +} + static inline std::ostream& operator<<(std::ostream& os, const std::vector& bytes) { os << std::hex; for (const uint8_t& c : bytes) { @@ -125,32 +172,42 @@ void NewRegisterInstructions::Dump(std::ostream& os, uint64_t total_size) const std::vector>> pairs; for (auto&& pair : instruction_freq_) { if (pair.second > 0 && !pair.first.empty()) { - // Savings exclude one byte per occurrence and one occurence from having the macro + // Savings exclude one byte per occurrence and one occurrence from having the macro // dictionary. pairs.emplace_back((pair.second - 1) * (pair.first.size() - 1), pair.first); } } std::sort(pairs.rbegin(), pairs.rend()); static constexpr size_t kMaxMacros = 128; + static constexpr size_t kMaxPrintedMacros = 32; uint64_t top_instructions_savings = 0u; for (size_t i = 0; i < kMaxMacros && i < pairs.size(); ++i) { top_instructions_savings += pairs[i].first; } if (verbose_level_ >= VerboseLevel::kNormal) { + os << "Move result register distribution" << "\n"; + PrintMostUsed(os, MakeUsageMap(move_result_reg_), 16); + os << "First arg register usage\n"; + std::function printer = [&](std::ostream& os, size_t idx) { + os << Instruction::Name(static_cast(idx)); + }; + PrintMostUsed(os, MakeUsageMap(first_arg_reg_count_), 16, printer); + os << "Most used field linkage pairs\n"; + PrintMostUsed(os, field_linkage_counts_, 32); + os << "Current extended " << extended_field_ << "\n"; + os << "Most used method linkage pairs\n"; + PrintMostUsed(os, method_linkage_counts_, 32); + os << "Current extended " << extended_method_ << "\n"; os << "Top " << kMaxMacros << " instruction bytecode sizes and hex dump" << "\n"; for (size_t i = 0; i < kMaxMacros && i < pairs.size(); ++i) { auto bytes = pairs[i].second; // Remove opcode bytes. bytes.erase(bytes.begin()); - os << Percent(pairs[i].first, total_size) << " " - << Instruction::Name(static_cast(pairs[i].second[0])) - << "(" << bytes << ")\n"; - } - os << "Move result register distribution" << "\n"; - const size_t move_result_total = - std::accumulate(move_result_reg_.begin(), move_result_reg_.end(), 0u); - for (size_t i = 0; i < move_result_reg_.size(); ++i) { - os << i << ": " << Percent(move_result_reg_[i], move_result_total) << "\n"; + if (i < kMaxPrintedMacros) { + os << Percent(pairs[i].first, total_size) << " " + << Instruction::Name(static_cast(pairs[i].second[0])) + << "(" << bytes << ")\n"; + } } } os << "Top instructions 1b macro savings " @@ -164,10 +221,7 @@ void NewRegisterInstructions::ProcessCodeItem(const DexFile& dex_file, std::map& types) { TypeLinkage& current_type = types[current_class_type.index_]; bool skip_next = false; - for (auto inst = code_item.begin(); ; ++inst) { - if (inst == code_item.end()) { - break; - } + for (auto inst = code_item.begin(); inst != code_item.end(); ++inst) { if (verbose_level_ >= VerboseLevel::kEverything) { std::cout << std::endl; std::cout << inst->DumpString(nullptr); @@ -182,6 +236,7 @@ void NewRegisterInstructions::ProcessCodeItem(const DexFile& dex_file, bool is_iget = false; const Instruction::Code opcode = inst->Opcode(); Instruction::Code new_opcode = opcode; + ++opcode_count_[opcode]; switch (opcode) { case Instruction::IGET: case Instruction::IGET_WIDE: @@ -209,18 +264,18 @@ void NewRegisterInstructions::ProcessCodeItem(const DexFile& dex_file, uint32_t receiver = inst->VRegB_22c(); uint32_t first_arg_reg = code_item.RegistersSize() - code_item.InsSize(); uint32_t out_reg = inst->VRegA_22c(); - if (Enabled(kExperimentInstanceFieldSelf) && - first_arg_reg == receiver && - holder_type == current_class_type) { - if (count_types) { - ++current_type.fields_.FindOrAdd(dex_field_idx)->second; - } else { - uint32_t field_idx = types[holder_type.index_].fields_.Get(dex_field_idx); - ExtendPrefix(&out_reg, &field_idx); - CHECK(InstNibbles(new_opcode, {out_reg, field_idx})); - continue; - } - } else if (Enabled(kExperimentInstanceField)) { + if (Enabled(kExperimentInstanceFieldSelf) && + first_arg_reg == receiver && + holder_type == current_class_type) { + if (count_types) { + ++current_type.fields_.FindOrAdd(dex_field_idx)->second; + } else { + uint32_t field_idx = types[holder_type.index_].fields_.Get(dex_field_idx); + ExtendPrefix(&out_reg, &field_idx); + CHECK(InstNibbles(new_opcode, {out_reg, field_idx})); + continue; + } + } else if (Enabled(kExperimentInstanceField)) { if (count_types) { ++current_type.types_.FindOrAdd(holder_type.index_)->second; ++types[holder_type.index_].fields_.FindOrAdd(dex_field_idx)->second; @@ -288,7 +343,8 @@ void NewRegisterInstructions::ProcessCodeItem(const DexFile& dex_file, } else { uint32_t type_idx = current_type.types_.Get(holder_type.index_); uint32_t field_idx = types[holder_type.index_].fields_.Get(dex_field_idx); - ExtendPrefix(&type_idx, &field_idx); + ++field_linkage_counts_[std::make_pair(type_idx, field_idx)]; + extended_field_ += ExtendPrefix(&type_idx, &field_idx) ? 1u : 0u; if (InstNibbles(new_opcode, {out_reg >> 4, out_reg & 0xF, type_idx, field_idx})) { continue; } @@ -313,6 +369,7 @@ void NewRegisterInstructions::ProcessCodeItem(const DexFile& dex_file, } else { uint32_t args[6] = {}; uint32_t arg_count = inst->GetVarArgs(args); + const uint32_t first_arg_reg = code_item.RegistersSize() - code_item.InsSize(); bool next_move_result = false; uint32_t dest_reg = 0; @@ -330,6 +387,7 @@ void NewRegisterInstructions::ProcessCodeItem(const DexFile& dex_file, uint32_t type_idx = current_type.types_.Get(receiver_type.index_); uint32_t local_idx = types[receiver_type.index_].methods_.Get(method_idx); + ++method_linkage_counts_[std::make_pair(type_idx, local_idx)]; // If true, we always put the return value in r0. static constexpr bool kMoveToDestReg = true; @@ -338,15 +396,21 @@ void NewRegisterInstructions::ProcessCodeItem(const DexFile& dex_file, if (kMoveToDestReg && arg_count % 2 == 1) { // Use the extra nibble to sneak in part of the type index. new_args.push_back(local_idx >> 4); - local_idx ^= local_idx & 0xF0; + local_idx &= ~0xF0; } - ExtendPrefix(&type_idx, &local_idx); + extended_method_ += ExtendPrefix(&type_idx, &local_idx) ? 1u : 0u; new_args.push_back(type_idx); new_args.push_back(local_idx); if (!kMoveToDestReg) { ExtendPrefix(&dest_reg, &local_idx); new_args.push_back(dest_reg); } + for (size_t i = 0; i < arg_count; ++i) { + if (args[i] == first_arg_reg) { + ++first_arg_reg_count_[opcode]; + break; + } + } new_args.insert(new_args.end(), args, args + arg_count); if (InstNibbles(opcode, new_args)) { skip_next = next_move_result; @@ -467,18 +531,18 @@ void NewRegisterInstructions::Add(Instruction::Code opcode, const Instruction& i ++instruction_freq_[std::vector(buffer_.begin() + buffer_start, buffer_.end())]; } -void NewRegisterInstructions::ExtendPrefix(uint32_t* value1, uint32_t* value2) { +bool NewRegisterInstructions::ExtendPrefix(uint32_t* value1, uint32_t* value2) { if (*value1 < 16 && *value2 < 16) { - return; + return false; } if ((*value1 >> 4) == 1 && *value2 < 16) { InstNibbles(0xE5, {}); *value1 ^= 1u << 4; - return; + return true; } else if ((*value2 >> 4) == 1 && *value1 < 16) { InstNibbles(0xE6, {}); *value2 ^= 1u << 4; - return; + return true; } if (*value1 < 256 && *value2 < 256) { // Extend each value by 4 bits. @@ -495,6 +559,7 @@ void NewRegisterInstructions::ExtendPrefix(uint32_t* value1, uint32_t* value2) { } *value1 &= 0xF; *value2 &= 0XF; + return true; } bool NewRegisterInstructions::InstNibbles(uint8_t opcode, const std::vector& args) { diff --git a/tools/dexanalyze/dexanalyze_bytecode.h b/tools/dexanalyze/dexanalyze_bytecode.h index db009b03b8..015801f516 100644 --- a/tools/dexanalyze/dexanalyze_bytecode.h +++ b/tools/dexanalyze/dexanalyze_bytecode.h @@ -54,7 +54,11 @@ struct TypeLinkage { class NewRegisterInstructions : public Experiment { public: - explicit NewRegisterInstructions(uint64_t experiments) : experiments_(experiments) {} + explicit NewRegisterInstructions(uint64_t experiments) + : experiments_(experiments), + move_result_reg_(256), + first_arg_reg_count_(256), + opcode_count_(256) {} void ProcessDexFiles(const std::vector>& dex_files); void Dump(std::ostream& os, uint64_t total_size) const; @@ -65,7 +69,7 @@ class NewRegisterInstructions : public Experiment { std::map& types); void Add(Instruction::Code opcode, const Instruction& inst); bool InstNibbles(uint8_t opcode, const std::vector& args); - void ExtendPrefix(uint32_t* value1, uint32_t* value2); + bool ExtendPrefix(uint32_t* value1, uint32_t* value2); bool Enabled(BytecodeExperiment experiment) const { return experiments_ & (1u << static_cast(experiment)); } @@ -76,7 +80,13 @@ class NewRegisterInstructions : public Experiment { uint64_t deduped_size_ = 0u; uint64_t dex_code_bytes_ = 0u; uint64_t experiments_ = std::numeric_limits::max(); - std::array move_result_reg_; + uint64_t extended_field_ = 0u; + uint64_t extended_method_ = 0u; + std::vector move_result_reg_; + std::vector first_arg_reg_count_; + std::vector opcode_count_; + std::map, size_t> method_linkage_counts_; + std::map, size_t> field_linkage_counts_; std::map, size_t> instruction_freq_; // Output instruction buffer. std::vector buffer_; -- GitLab From 0ddf62697f676027705cf785267b49ed1520c0ea Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 23 Aug 2018 17:37:46 -0700 Subject: [PATCH 007/126] Move string analysis to its own file Bug: 112311352 Bug: 77709234 Test: test-art-host Change-Id: I9ed6f5ae3534584ced594fe348ec52d91b52a98f --- tools/dexanalyze/Android.bp | 1 + tools/dexanalyze/dexanalyze.cc | 1 + tools/dexanalyze/dexanalyze_experiments.cc | 131 ----------------- tools/dexanalyze/dexanalyze_experiments.h | 19 --- tools/dexanalyze/dexanalyze_strings.cc | 162 +++++++++++++++++++++ tools/dexanalyze/dexanalyze_strings.h | 54 +++++++ 6 files changed, 218 insertions(+), 150 deletions(-) create mode 100644 tools/dexanalyze/dexanalyze_strings.cc create mode 100644 tools/dexanalyze/dexanalyze_strings.h diff --git a/tools/dexanalyze/Android.bp b/tools/dexanalyze/Android.bp index 9515ca5c50..a85bf562af 100644 --- a/tools/dexanalyze/Android.bp +++ b/tools/dexanalyze/Android.bp @@ -22,6 +22,7 @@ cc_defaults { "dexanalyze.cc", "dexanalyze_bytecode.cc", "dexanalyze_experiments.cc", + "dexanalyze_strings.cc", ], target: { android: { diff --git a/tools/dexanalyze/dexanalyze.cc b/tools/dexanalyze/dexanalyze.cc index 841719b821..040f41ba5d 100644 --- a/tools/dexanalyze/dexanalyze.cc +++ b/tools/dexanalyze/dexanalyze.cc @@ -23,6 +23,7 @@ #include "dexanalyze_bytecode.h" #include "dexanalyze_experiments.h" +#include "dexanalyze_strings.h" #include "dex/code_item_accessors-inl.h" #include "dex/dex_file.h" #include "dex/dex_file_loader.h" diff --git a/tools/dexanalyze/dexanalyze_experiments.cc b/tools/dexanalyze/dexanalyze_experiments.cc index 1f6fe4694e..b124f433b3 100644 --- a/tools/dexanalyze/dexanalyze_experiments.cc +++ b/tools/dexanalyze/dexanalyze_experiments.cc @@ -208,137 +208,6 @@ void AnalyzeDebugInfo::Dump(std::ostream& os, uint64_t total_size) const { << Percent(total_unique_non_header_bytes_, total_size) << "\n"; } -void AnalyzeStrings::ProcessDexFiles(const std::vector>& dex_files) { - std::set unique_strings; - for (const std::unique_ptr& dex_file : dex_files) { - for (size_t i = 0; i < dex_file->NumStringIds(); ++i) { - uint32_t length = 0; - const char* data = dex_file->StringDataAndUtf16LengthByIdx(dex::StringIndex(i), &length); - // Analyze if the string has any UTF16 chars. - bool have_wide_char = false; - const char* ptr = data; - for (size_t j = 0; j < length; ++j) { - have_wide_char = have_wide_char || GetUtf16FromUtf8(&ptr) >= 0x100; - } - if (have_wide_char) { - wide_string_bytes_ += 2 * length; - } else { - ascii_string_bytes_ += length; - } - string_data_bytes_ += ptr - data; - unique_strings.insert(data); - } - } - // Unique strings only since we want to exclude savings from multidex duplication. - std::vector strings(unique_strings.begin(), unique_strings.end()); - unique_strings.clear(); - - // Tunable parameters. - static const size_t kMinPrefixLen = 1; - static const size_t kMaxPrefixLen = 255; - static const size_t kPrefixConstantCost = 4; - static const size_t kPrefixIndexCost = 2; - - // Calculate total shared prefix. - std::vector shared_len; - prefixes_.clear(); - for (size_t i = 0; i < strings.size(); ++i) { - size_t best_len = 0; - if (i > 0) { - best_len = std::max(best_len, PrefixLen(strings[i], strings[i - 1])); - } - if (i < strings.size() - 1) { - best_len = std::max(best_len, PrefixLen(strings[i], strings[i + 1])); - } - best_len = std::min(best_len, kMaxPrefixLen); - std::string prefix; - if (best_len >= kMinPrefixLen) { - prefix = strings[i].substr(0, best_len); - ++prefixes_[prefix]; - } - total_prefix_index_cost_ += kPrefixIndexCost; - } - // Optimize the result by moving long prefixes to shorter ones if it causes savings. - while (true) { - bool have_savings = false; - auto it = prefixes_.begin(); - std::vector longest; - for (const auto& pair : prefixes_) { - longest.push_back(pair.first); - } - std::sort(longest.begin(), longest.end(), [](const std::string& a, const std::string& b) { - return a.length() > b.length(); - }); - // Do longest first since this provides the best results. - for (const std::string& s : longest) { - it = prefixes_.find(s); - CHECK(it != prefixes_.end()); - const std::string& prefix = it->first; - int64_t best_savings = 0u; - int64_t best_len = -1; - for (int64_t len = prefix.length() - 1; len >= 0; --len) { - auto found = prefixes_.find(prefix.substr(0, len)); - if (len != 0 && found == prefixes_.end()) { - continue; - } - // Calculate savings from downgrading the prefix. - int64_t savings = kPrefixConstantCost + prefix.length() - - (prefix.length() - len) * it->second; - if (savings > best_savings) { - best_savings = savings; - best_len = len; - break; - } - } - if (best_len != -1) { - prefixes_[prefix.substr(0, best_len)] += it->second; - it = prefixes_.erase(it); - optimization_savings_ += best_savings; - have_savings = true; - } else { - ++it; - } - } - if (!have_savings) { - break; - } - } - total_num_prefixes_ += prefixes_.size(); - for (const auto& pair : prefixes_) { - // 4 bytes for an offset, one for length. - total_prefix_dict_ += pair.first.length(); - total_prefix_table_ += kPrefixConstantCost; - total_prefix_savings_ += pair.first.length() * pair.second; - } -} - -void AnalyzeStrings::Dump(std::ostream& os, uint64_t total_size) const { - os << "Total string data bytes " << Percent(string_data_bytes_, total_size) << "\n"; - os << "UTF-16 string data bytes " << Percent(wide_string_bytes_, total_size) << "\n"; - os << "ASCII string data bytes " << Percent(ascii_string_bytes_, total_size) << "\n"; - - // Prefix based strings. - os << "Total shared prefix bytes " << Percent(total_prefix_savings_, total_size) << "\n"; - os << "Prefix dictionary cost " << Percent(total_prefix_dict_, total_size) << "\n"; - os << "Prefix table cost " << Percent(total_prefix_table_, total_size) << "\n"; - os << "Prefix index cost " << Percent(total_prefix_index_cost_, total_size) << "\n"; - int64_t net_savings = total_prefix_savings_; - net_savings -= total_prefix_dict_; - net_savings -= total_prefix_table_; - net_savings -= total_prefix_index_cost_; - os << "Prefix dictionary elements " << total_num_prefixes_ << "\n"; - os << "Optimization savings " << Percent(optimization_savings_, total_size) << "\n"; - os << "Prefix net savings " << Percent(net_savings, total_size) << "\n"; - if (verbose_level_ >= VerboseLevel::kEverything) { - std::vector> pairs(prefixes_.begin(), prefixes_.end()); - // Sort lexicographically. - std::sort(pairs.begin(), pairs.end()); - for (const auto& pair : pairs) { - os << pair.first << " : " << pair.second << "\n"; - } - } -} - void CountDexIndices::ProcessDexFiles( const std::vector>& dex_files) { std::set unique_field_names; diff --git a/tools/dexanalyze/dexanalyze_experiments.h b/tools/dexanalyze/dexanalyze_experiments.h index 4e66b3cf3b..3542d959ba 100644 --- a/tools/dexanalyze/dexanalyze_experiments.h +++ b/tools/dexanalyze/dexanalyze_experiments.h @@ -62,25 +62,6 @@ class Experiment { VerboseLevel verbose_level_ = VerboseLevel::kNormal; }; -// Analyze string data and strings accessed from code. -class AnalyzeStrings : public Experiment { - public: - void ProcessDexFiles(const std::vector>& dex_files) OVERRIDE; - void Dump(std::ostream& os, uint64_t total_size) const OVERRIDE; - - private: - int64_t wide_string_bytes_ = 0u; - int64_t ascii_string_bytes_ = 0u; - int64_t string_data_bytes_ = 0u; - int64_t total_prefix_savings_ = 0u; - int64_t total_prefix_dict_ = 0u; - int64_t total_prefix_table_ = 0u; - int64_t total_prefix_index_cost_ = 0u; - int64_t total_num_prefixes_ = 0u; - int64_t optimization_savings_ = 0u; - std::unordered_map prefixes_; -}; - // Analyze debug info sizes. class AnalyzeDebugInfo : public Experiment { public: diff --git a/tools/dexanalyze/dexanalyze_strings.cc b/tools/dexanalyze/dexanalyze_strings.cc new file mode 100644 index 0000000000..9f67ff431a --- /dev/null +++ b/tools/dexanalyze/dexanalyze_strings.cc @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "dexanalyze_strings.h" + +#include +#include +#include + +#include "dex/class_accessor-inl.h" +#include "dex/code_item_accessors-inl.h" +#include "dex/dex_instruction-inl.h" + +namespace art { +namespace dexanalyze { + +void AnalyzeStrings::ProcessDexFiles(const std::vector>& dex_files) { + std::set unique_strings; + for (const std::unique_ptr& dex_file : dex_files) { + for (size_t i = 0; i < dex_file->NumStringIds(); ++i) { + uint32_t length = 0; + const char* data = dex_file->StringDataAndUtf16LengthByIdx(dex::StringIndex(i), &length); + // Analyze if the string has any UTF16 chars. + bool have_wide_char = false; + const char* ptr = data; + for (size_t j = 0; j < length; ++j) { + have_wide_char = have_wide_char || GetUtf16FromUtf8(&ptr) >= 0x100; + } + if (have_wide_char) { + wide_string_bytes_ += 2 * length; + } else { + ascii_string_bytes_ += length; + } + string_data_bytes_ += ptr - data; + unique_strings.insert(data); + } + } + // Unique strings only since we want to exclude savings from multidex duplication. + std::vector strings(unique_strings.begin(), unique_strings.end()); + unique_strings.clear(); + + // Tunable parameters. + static const size_t kMinPrefixLen = 1; + static const size_t kMaxPrefixLen = 255; + static const size_t kPrefixConstantCost = 4; + static const size_t kPrefixIndexCost = 2; + + // Calculate total shared prefix. + std::vector shared_len; + prefixes_.clear(); + for (size_t i = 0; i < strings.size(); ++i) { + size_t best_len = 0; + if (i > 0) { + best_len = std::max(best_len, PrefixLen(strings[i], strings[i - 1])); + } + if (i < strings.size() - 1) { + best_len = std::max(best_len, PrefixLen(strings[i], strings[i + 1])); + } + best_len = std::min(best_len, kMaxPrefixLen); + std::string prefix; + if (best_len >= kMinPrefixLen) { + prefix = strings[i].substr(0, best_len); + ++prefixes_[prefix]; + } + total_prefix_index_cost_ += kPrefixIndexCost; + } + // Optimize the result by moving long prefixes to shorter ones if it causes savings. + while (true) { + bool have_savings = false; + auto it = prefixes_.begin(); + std::vector longest; + for (const auto& pair : prefixes_) { + longest.push_back(pair.first); + } + std::sort(longest.begin(), longest.end(), [](const std::string& a, const std::string& b) { + return a.length() > b.length(); + }); + // Do longest first since this provides the best results. + for (const std::string& s : longest) { + it = prefixes_.find(s); + CHECK(it != prefixes_.end()); + const std::string& prefix = it->first; + int64_t best_savings = 0u; + int64_t best_len = -1; + for (int64_t len = prefix.length() - 1; len >= 0; --len) { + auto found = prefixes_.find(prefix.substr(0, len)); + if (len != 0 && found == prefixes_.end()) { + continue; + } + // Calculate savings from downgrading the prefix. + int64_t savings = kPrefixConstantCost + prefix.length() - + (prefix.length() - len) * it->second; + if (savings > best_savings) { + best_savings = savings; + best_len = len; + break; + } + } + if (best_len != -1) { + prefixes_[prefix.substr(0, best_len)] += it->second; + it = prefixes_.erase(it); + optimization_savings_ += best_savings; + have_savings = true; + } else { + ++it; + } + } + if (!have_savings) { + break; + } + } + total_num_prefixes_ += prefixes_.size(); + for (const auto& pair : prefixes_) { + // 4 bytes for an offset, one for length. + total_prefix_dict_ += pair.first.length(); + total_prefix_table_ += kPrefixConstantCost; + total_prefix_savings_ += pair.first.length() * pair.second; + } +} + +void AnalyzeStrings::Dump(std::ostream& os, uint64_t total_size) const { + os << "Total string data bytes " << Percent(string_data_bytes_, total_size) << "\n"; + os << "UTF-16 string data bytes " << Percent(wide_string_bytes_, total_size) << "\n"; + os << "ASCII string data bytes " << Percent(ascii_string_bytes_, total_size) << "\n"; + + // Prefix based strings. + os << "Total shared prefix bytes " << Percent(total_prefix_savings_, total_size) << "\n"; + os << "Prefix dictionary cost " << Percent(total_prefix_dict_, total_size) << "\n"; + os << "Prefix table cost " << Percent(total_prefix_table_, total_size) << "\n"; + os << "Prefix index cost " << Percent(total_prefix_index_cost_, total_size) << "\n"; + int64_t net_savings = total_prefix_savings_; + net_savings -= total_prefix_dict_; + net_savings -= total_prefix_table_; + net_savings -= total_prefix_index_cost_; + os << "Prefix dictionary elements " << total_num_prefixes_ << "\n"; + os << "Optimization savings " << Percent(optimization_savings_, total_size) << "\n"; + os << "Prefix net savings " << Percent(net_savings, total_size) << "\n"; + if (verbose_level_ >= VerboseLevel::kEverything) { + std::vector> pairs(prefixes_.begin(), prefixes_.end()); + // Sort lexicographically. + std::sort(pairs.begin(), pairs.end()); + for (const auto& pair : pairs) { + os << pair.first << " : " << pair.second << "\n"; + } + } +} + +} // namespace dexanalyze +} // namespace art diff --git a/tools/dexanalyze/dexanalyze_strings.h b/tools/dexanalyze/dexanalyze_strings.h new file mode 100644 index 0000000000..a5c202e31f --- /dev/null +++ b/tools/dexanalyze/dexanalyze_strings.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ART_TOOLS_DEXANALYZE_DEXANALYZE_STRINGS_H_ +#define ART_TOOLS_DEXANALYZE_DEXANALYZE_STRINGS_H_ + +#include +#include +#include + +#include "base/safe_map.h" +#include "dexanalyze_experiments.h" +#include "dex/code_item_accessors.h" +#include "dex/utf-inl.h" + +namespace art { +namespace dexanalyze { + +// Analyze string data and strings accessed from code. +class AnalyzeStrings : public Experiment { + public: + void ProcessDexFiles(const std::vector>& dex_files) OVERRIDE; + void Dump(std::ostream& os, uint64_t total_size) const OVERRIDE; + + private: + int64_t wide_string_bytes_ = 0u; + int64_t ascii_string_bytes_ = 0u; + int64_t string_data_bytes_ = 0u; + int64_t total_prefix_savings_ = 0u; + int64_t total_prefix_dict_ = 0u; + int64_t total_prefix_table_ = 0u; + int64_t total_prefix_index_cost_ = 0u; + int64_t total_num_prefixes_ = 0u; + int64_t optimization_savings_ = 0u; + std::unordered_map prefixes_; +}; + +} // namespace dexanalyze +} // namespace art + +#endif // ART_TOOLS_DEXANALYZE_DEXANALYZE_STRINGS_H_ -- GitLab From f6985bd84b27b25e2c2ae1b865a4f28a0ccd578b Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Fri, 24 Aug 2018 09:02:28 +0100 Subject: [PATCH 008/126] Add an overload for MemMap::MapAnonymous(). Add an overload that does not take `reuse` or `use_ashmem` parameters but uses default values (`reuse = false` and `use_ashmem = true`) to simplify callers. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Iaa44f770dee7e043c3a1d6867dfb0416dec83b25 --- compiler/common_compiler_test.cc | 1 - dex2oat/linker/image_writer.cc | 1 - libartbase/base/mem_map.h | 8 +++++++ libartbase/base/mem_map_test.cc | 27 ---------------------- libartbase/base/zip_archive.cc | 1 - openjdkjvmti/ti_class_definition.cc | 2 -- openjdkjvmti/ti_redefine.cc | 1 - runtime/base/mem_map_arena_pool.cc | 1 - runtime/dexopt_test.cc | 1 - runtime/elf_file.cc | 1 - runtime/gc/accounting/atomic_stack.h | 1 - runtime/gc/accounting/bitmap.cc | 1 - runtime/gc/accounting/card_table.cc | 1 - runtime/gc/accounting/read_barrier_table.h | 1 - runtime/gc/accounting/space_bitmap.cc | 1 - runtime/gc/allocator/rosalloc.cc | 1 - runtime/gc/collector/concurrent_copying.cc | 1 - runtime/gc/collector/immune_spaces_test.cc | 3 --- runtime/gc/collector/mark_sweep.cc | 1 - runtime/gc/heap.cc | 2 -- runtime/gc/heap_test.cc | 1 - runtime/gc/space/bump_pointer_space.cc | 1 - runtime/gc/space/image_space.cc | 1 - runtime/gc/space/large_object_space.cc | 3 --- runtime/gc/space/malloc_space.cc | 1 - runtime/gc/space/region_space.cc | 1 - runtime/indirect_reference_table.cc | 2 -- runtime/native/dalvik_system_DexFile.cc | 1 - runtime/runtime.cc | 1 - runtime/runtime_callbacks_test.cc | 3 +-- runtime/thread_pool.cc | 1 - 31 files changed, 9 insertions(+), 64 deletions(-) diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc index 2f017662e2..d603d9673c 100644 --- a/compiler/common_compiler_test.cc +++ b/compiler/common_compiler_test.cc @@ -328,7 +328,6 @@ void CommonCompilerTest::ReserveImageSpace() { (size_t)120 * 1024 * 1024, // 120MB PROT_NONE, false /* no need for 4gb flag with fixed mmap */, - false /* not reusing existing reservation */, &error_msg); CHECK(image_reservation_.IsValid()) << error_msg; } diff --git a/dex2oat/linker/image_writer.cc b/dex2oat/linker/image_writer.cc index 27e797446e..67ded3278e 100644 --- a/dex2oat/linker/image_writer.cc +++ b/dex2oat/linker/image_writer.cc @@ -735,7 +735,6 @@ bool ImageWriter::AllocMemory() { length, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); if (UNLIKELY(!image_info.image_.IsValid())) { LOG(ERROR) << "Failed to allocate memory for image file generation: " << error_msg; diff --git a/libartbase/base/mem_map.h b/libartbase/base/mem_map.h index 525fade9c1..cd7d502796 100644 --- a/libartbase/base/mem_map.h +++ b/libartbase/base/mem_map.h @@ -131,6 +131,14 @@ class MemMap { bool reuse, std::string* error_msg, bool use_ashmem = true); + static MemMap MapAnonymous(const char* name, + uint8_t* addr, + size_t byte_count, + int prot, + bool low_4gb, + std::string* error_msg) { + return MapAnonymous(name, addr, byte_count, prot, low_4gb, /* reuse */ false, error_msg); + } // Create placeholder for a region allocated by direct call to mmap. // This is useful when we do not have control over the code calling mmap, diff --git a/libartbase/base/mem_map_test.cc b/libartbase/base/mem_map_test.cc index b2f5c728e4..396f12b421 100644 --- a/libartbase/base/mem_map_test.cc +++ b/libartbase/base/mem_map_test.cc @@ -57,7 +57,6 @@ class MemMapTest : public CommonArtTest { size, PROT_READ, low_4gb, - /* reuse */ false, &error_msg); CHECK(map.IsValid()); return map.Begin(); @@ -73,7 +72,6 @@ class MemMapTest : public CommonArtTest { 2 * page_size, PROT_READ | PROT_WRITE, low_4gb, - /* reuse */ false, &error_msg); // Check its state and write to it. ASSERT_TRUE(m0.IsValid()); @@ -171,7 +169,6 @@ TEST_F(MemMapTest, ReplaceMapping_SameSize) { kPageSize, PROT_READ, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(dest.IsValid()); MemMap source = MemMap::MapAnonymous("MapAnonymous-atomic-replace-source", @@ -179,7 +176,6 @@ TEST_F(MemMapTest, ReplaceMapping_SameSize) { kPageSize, PROT_WRITE | PROT_READ, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(source.IsValid()); void* source_addr = source.Begin(); @@ -212,7 +208,6 @@ TEST_F(MemMapTest, ReplaceMapping_MakeLarger) { // source. PROT_READ, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(dest.IsValid()); MemMap source = MemMap::MapAnonymous("MapAnonymous-atomic-replace-source", @@ -220,7 +215,6 @@ TEST_F(MemMapTest, ReplaceMapping_MakeLarger) { 3 * kPageSize, PROT_WRITE | PROT_READ, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(source.IsValid()); uint8_t* source_addr = source.Begin(); @@ -256,7 +250,6 @@ TEST_F(MemMapTest, ReplaceMapping_MakeSmaller) { 3 * kPageSize, PROT_READ, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(dest.IsValid()); MemMap source = MemMap::MapAnonymous("MapAnonymous-atomic-replace-source", @@ -264,7 +257,6 @@ TEST_F(MemMapTest, ReplaceMapping_MakeSmaller) { kPageSize, PROT_WRITE | PROT_READ, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(source.IsValid()); uint8_t* source_addr = source.Begin(); @@ -298,7 +290,6 @@ TEST_F(MemMapTest, ReplaceMapping_FailureOverlap) { // the way we we move source. PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(dest.IsValid()); // Resize down to 1 page so we can remap the rest. @@ -309,7 +300,6 @@ TEST_F(MemMapTest, ReplaceMapping_FailureOverlap) { 2 * kPageSize, PROT_WRITE | PROT_READ, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(source.IsValid()); ASSERT_EQ(dest.Begin() + kPageSize, source.Begin()); @@ -346,7 +336,6 @@ TEST_F(MemMapTest, MapAnonymousEmpty) { 0, PROT_READ, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_FALSE(map.IsValid()) << error_msg; ASSERT_FALSE(error_msg.empty()); @@ -357,7 +346,6 @@ TEST_F(MemMapTest, MapAnonymousEmpty) { kPageSize, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(map.IsValid()) << error_msg; ASSERT_TRUE(error_msg.empty()); @@ -371,7 +359,6 @@ TEST_F(MemMapTest, MapAnonymousFailNullError) { 0x20000, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, nullptr); ASSERT_FALSE(map.IsValid()); } @@ -385,7 +372,6 @@ TEST_F(MemMapTest, MapAnonymousEmpty32bit) { 0, PROT_READ, /* low_4gb */ true, - /* reuse */ false, &error_msg); ASSERT_FALSE(map.IsValid()) << error_msg; ASSERT_FALSE(error_msg.empty()); @@ -396,7 +382,6 @@ TEST_F(MemMapTest, MapAnonymousEmpty32bit) { kPageSize, PROT_READ | PROT_WRITE, /* low_4gb */ true, - /* reuse */ false, &error_msg); ASSERT_TRUE(map.IsValid()) << error_msg; ASSERT_TRUE(error_msg.empty()); @@ -435,7 +420,6 @@ TEST_F(MemMapTest, MapAnonymousExactAddr) { kPageSize, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(map0.IsValid()) << error_msg; ASSERT_TRUE(error_msg.empty()); @@ -446,7 +430,6 @@ TEST_F(MemMapTest, MapAnonymousExactAddr) { kPageSize, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(map1.IsValid()) << error_msg; ASSERT_TRUE(error_msg.empty()); @@ -457,7 +440,6 @@ TEST_F(MemMapTest, MapAnonymousExactAddr) { kPageSize, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_FALSE(map2.IsValid()) << error_msg; ASSERT_TRUE(!error_msg.empty()); @@ -494,7 +476,6 @@ TEST_F(MemMapTest, MapAnonymousExactAddr32bitHighAddr) { size, PROT_READ | PROT_WRITE, /*low_4gb*/ true, - /* reuse */ false, &error_msg); if (map.IsValid()) { break; @@ -516,7 +497,6 @@ TEST_F(MemMapTest, MapAnonymousOverflow) { 2 * kPageSize, // brings it over the top. PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_FALSE(map.IsValid()); ASSERT_FALSE(error_msg.empty()); @@ -532,7 +512,6 @@ TEST_F(MemMapTest, MapAnonymousLow4GBExpectedTooHigh) { kPageSize, PROT_READ | PROT_WRITE, /* low_4gb */ true, - /* reuse */ false, &error_msg); ASSERT_FALSE(map.IsValid()); ASSERT_FALSE(error_msg.empty()); @@ -546,7 +525,6 @@ TEST_F(MemMapTest, MapAnonymousLow4GBRangeTooHigh) { 0x20000000, PROT_READ | PROT_WRITE, /* low_4gb */ true, - /* reuse */ false, &error_msg); ASSERT_FALSE(map.IsValid()); ASSERT_FALSE(error_msg.empty()); @@ -586,7 +564,6 @@ TEST_F(MemMapTest, CheckNoGaps) { kPageSize * kNumPages, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(map.IsValid()) << error_msg; ASSERT_TRUE(error_msg.empty()); @@ -602,7 +579,6 @@ TEST_F(MemMapTest, CheckNoGaps) { kPageSize, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(map0.IsValid()) << error_msg; ASSERT_TRUE(error_msg.empty()); @@ -611,7 +587,6 @@ TEST_F(MemMapTest, CheckNoGaps) { kPageSize, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(map1.IsValid()) << error_msg; ASSERT_TRUE(error_msg.empty()); @@ -620,7 +595,6 @@ TEST_F(MemMapTest, CheckNoGaps) { kPageSize, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(map2.IsValid()) << error_msg; ASSERT_TRUE(error_msg.empty()); @@ -653,7 +627,6 @@ TEST_F(MemMapTest, AlignBy) { 14 * page_size, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); ASSERT_TRUE(m0.IsValid()); uint8_t* base0 = m0.Begin(); diff --git a/libartbase/base/zip_archive.cc b/libartbase/base/zip_archive.cc index 3c68ca1de8..a841bae8ea 100644 --- a/libartbase/base/zip_archive.cc +++ b/libartbase/base/zip_archive.cc @@ -79,7 +79,6 @@ MemMap ZipEntry::ExtractToMemMap(const char* zip_filename, GetUncompressedLength(), PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, error_msg); if (!map.IsValid()) { DCHECK(!error_msg->empty()); diff --git a/openjdkjvmti/ti_class_definition.cc b/openjdkjvmti/ti_class_definition.cc index 030ad98d02..895e73450e 100644 --- a/openjdkjvmti/ti_class_definition.cc +++ b/openjdkjvmti/ti_class_definition.cc @@ -250,7 +250,6 @@ void ArtClassDefinition::InitWithDex(GetOriginalDexFile get_original, dequick_size, PROT_NONE, /*low_4gb*/ false, - /*reuse*/ false, &error); mmap_name += "-TEMP"; temp_mmap_ = art::MemMap::MapAnonymous(mmap_name.c_str(), @@ -258,7 +257,6 @@ void ArtClassDefinition::InitWithDex(GetOriginalDexFile get_original, dequick_size, PROT_READ | PROT_WRITE, /*low_4gb*/ false, - /*reuse*/ false, &error); if (UNLIKELY(dex_data_mmap_.IsValid() && temp_mmap_.IsValid())) { // Need to save the initial dexfile so we don't need to search for it in the fault-handler. diff --git a/openjdkjvmti/ti_redefine.cc b/openjdkjvmti/ti_redefine.cc index 6cba48a0c6..8707e272c6 100644 --- a/openjdkjvmti/ti_redefine.cc +++ b/openjdkjvmti/ti_redefine.cc @@ -309,7 +309,6 @@ art::MemMap Redefiner::MoveDataToMemMap(const std::string& original_location, data.size(), PROT_READ|PROT_WRITE, /*low_4gb*/ false, - /*reuse*/ false, error_msg); if (LIKELY(map.IsValid())) { memcpy(map.Begin(), data.data(), data.size()); diff --git a/runtime/base/mem_map_arena_pool.cc b/runtime/base/mem_map_arena_pool.cc index 0f472e2604..a9fbafe7ab 100644 --- a/runtime/base/mem_map_arena_pool.cc +++ b/runtime/base/mem_map_arena_pool.cc @@ -62,7 +62,6 @@ MemMap MemMapArena::Allocate(size_t size, bool low_4gb, const char* name) { size, PROT_READ | PROT_WRITE, low_4gb, - /* reuse */ false, &error_msg); CHECK(map.IsValid()) << error_msg; return map; diff --git a/runtime/dexopt_test.cc b/runtime/dexopt_test.cc index b0eef00551..9e3159d5e7 100644 --- a/runtime/dexopt_test.cc +++ b/runtime/dexopt_test.cc @@ -254,7 +254,6 @@ void DexoptTest::ReserveImageSpaceChunk(uintptr_t start, uintptr_t end) { end - start, PROT_NONE, /* low_4gb*/ false, - /* reuse */ false, &error_msg)); ASSERT_TRUE(image_reservation_.back().IsValid()) << error_msg; LOG(INFO) << "Reserved space for image " << diff --git a/runtime/elf_file.cc b/runtime/elf_file.cc index 4ae736299b..d45a689fd6 100644 --- a/runtime/elf_file.cc +++ b/runtime/elf_file.cc @@ -1168,7 +1168,6 @@ bool ElfFileImpl::Load(File* file, loaded_size, PROT_NONE, low_4gb, - /* reuse */ false, error_msg); if (!reserve.IsValid()) { *error_msg = StringPrintf("Failed to allocate %s: %s", diff --git a/runtime/gc/accounting/atomic_stack.h b/runtime/gc/accounting/atomic_stack.h index 2a71dec4d5..10af10d1a6 100644 --- a/runtime/gc/accounting/atomic_stack.h +++ b/runtime/gc/accounting/atomic_stack.h @@ -257,7 +257,6 @@ class AtomicStack { capacity_ * sizeof(begin_[0]), PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); CHECK(mem_map_.IsValid()) << "couldn't allocate mark stack.\n" << error_msg; uint8_t* addr = mem_map_.Begin(); diff --git a/runtime/gc/accounting/bitmap.cc b/runtime/gc/accounting/bitmap.cc index e157e5e8c4..bb2beaa94c 100644 --- a/runtime/gc/accounting/bitmap.cc +++ b/runtime/gc/accounting/bitmap.cc @@ -53,7 +53,6 @@ MemMap Bitmap::AllocateMemMap(const std::string& name, size_t num_bits) { bitmap_size, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); if (UNLIKELY(!mem_map.IsValid())) { LOG(ERROR) << "Failed to allocate bitmap " << name << ": " << error_msg; diff --git a/runtime/gc/accounting/card_table.cc b/runtime/gc/accounting/card_table.cc index 89645e0083..7cddec6242 100644 --- a/runtime/gc/accounting/card_table.cc +++ b/runtime/gc/accounting/card_table.cc @@ -69,7 +69,6 @@ CardTable* CardTable::Create(const uint8_t* heap_begin, size_t heap_capacity) { capacity + 256, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); CHECK(mem_map.IsValid()) << "couldn't allocate card table: " << error_msg; // All zeros is the correct initial value; all clean. Anonymous mmaps are initialized to zero, we diff --git a/runtime/gc/accounting/read_barrier_table.h b/runtime/gc/accounting/read_barrier_table.h index d8b1bb2d88..8bdf6da6fe 100644 --- a/runtime/gc/accounting/read_barrier_table.h +++ b/runtime/gc/accounting/read_barrier_table.h @@ -44,7 +44,6 @@ class ReadBarrierTable { capacity, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); CHECK(mem_map_.IsValid() && mem_map_.Begin() != nullptr) << "couldn't allocate read barrier table: " << error_msg; diff --git a/runtime/gc/accounting/space_bitmap.cc b/runtime/gc/accounting/space_bitmap.cc index f87a67e0de..2946486dfb 100644 --- a/runtime/gc/accounting/space_bitmap.cc +++ b/runtime/gc/accounting/space_bitmap.cc @@ -89,7 +89,6 @@ SpaceBitmap* SpaceBitmap::Create( bitmap_size, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); if (UNLIKELY(!mem_map.IsValid())) { LOG(ERROR) << "Failed to allocate bitmap " << name << ": " << error_msg; diff --git a/runtime/gc/allocator/rosalloc.cc b/runtime/gc/allocator/rosalloc.cc index 1639a82718..0dbafde2a5 100644 --- a/runtime/gc/allocator/rosalloc.cc +++ b/runtime/gc/allocator/rosalloc.cc @@ -96,7 +96,6 @@ RosAlloc::RosAlloc(void* base, size_t capacity, size_t max_capacity, RoundUp(max_num_of_pages, kPageSize), PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); CHECK(page_map_mem_map_.IsValid()) << "Couldn't allocate the page map : " << error_msg; page_map_ = page_map_mem_map_.Begin(); diff --git a/runtime/gc/collector/concurrent_copying.cc b/runtime/gc/collector/concurrent_copying.cc index 53fd1f42cf..fdd0b62d3e 100644 --- a/runtime/gc/collector/concurrent_copying.cc +++ b/runtime/gc/collector/concurrent_copying.cc @@ -139,7 +139,6 @@ ConcurrentCopying::ConcurrentCopying(Heap* heap, RoundUp(kSweepArrayChunkFreeSize * sizeof(mirror::Object*), kPageSize), PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); CHECK(sweep_array_free_buffer_mem_map_.IsValid()) << "Couldn't allocate sweep array free buffer: " << error_msg; diff --git a/runtime/gc/collector/immune_spaces_test.cc b/runtime/gc/collector/immune_spaces_test.cc index 558a4a7fd0..145bd0208d 100644 --- a/runtime/gc/collector/immune_spaces_test.cc +++ b/runtime/gc/collector/immune_spaces_test.cc @@ -88,7 +88,6 @@ class ImmuneSpacesTest : public CommonRuntimeTest { image_size, PROT_READ | PROT_WRITE, /*low_4gb*/true, - /*reuse*/false, &error_str); if (!map.IsValid()) { LOG(ERROR) << error_str; @@ -102,7 +101,6 @@ class ImmuneSpacesTest : public CommonRuntimeTest { oat_size, PROT_READ | PROT_WRITE, /*low_4gb*/true, - /*reuse*/false, &error_str); if (!oat_map.IsValid()) { LOG(ERROR) << error_str; @@ -146,7 +144,6 @@ class ImmuneSpacesTest : public CommonRuntimeTest { size, PROT_READ | PROT_WRITE, /*low_4gb*/ true, - /*reuse*/ false, &error_str); if (!map.IsValid()) { LOG(ERROR) << "Failed to allocate memory region " << error_str; diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc index 334c7a02e0..997d3b6f87 100644 --- a/runtime/gc/collector/mark_sweep.cc +++ b/runtime/gc/collector/mark_sweep.cc @@ -109,7 +109,6 @@ MarkSweep::MarkSweep(Heap* heap, bool is_concurrent, const std::string& name_pre RoundUp(kSweepArrayChunkFreeSize * sizeof(mirror::Object*), kPageSize), PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); CHECK(sweep_array_free_buffer_mem_map_.IsValid()) << "Couldn't allocate sweep array free buffer: " << error_msg; diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 1578db5613..7913354433 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -409,7 +409,6 @@ Heap::Heap(size_t initial_size, capacity_, PROT_READ | PROT_WRITE, /* low_4gb */ true, - /* reuse */ false, &error_str); } CHECK(main_mem_map_1.IsValid()) << error_str; @@ -669,7 +668,6 @@ MemMap Heap::MapAnonymousPreferredAddress(const char* name, capacity, PROT_READ | PROT_WRITE, /* low_4gb*/ true, - /* reuse */ false, out_error_str); if (map.IsValid() || request_begin == nullptr) { return map; diff --git a/runtime/gc/heap_test.cc b/runtime/gc/heap_test.cc index d35ae38f34..8720a3e014 100644 --- a/runtime/gc/heap_test.cc +++ b/runtime/gc/heap_test.cc @@ -38,7 +38,6 @@ class HeapTest : public CommonRuntimeTest { 16 * KB, PROT_READ, /*low_4gb*/ true, - /*reuse*/ false, &error_msg); ASSERT_TRUE(reserved_.IsValid()) << error_msg; CommonRuntimeTest::SetUp(); diff --git a/runtime/gc/space/bump_pointer_space.cc b/runtime/gc/space/bump_pointer_space.cc index 2712ec2a35..42453f581a 100644 --- a/runtime/gc/space/bump_pointer_space.cc +++ b/runtime/gc/space/bump_pointer_space.cc @@ -33,7 +33,6 @@ BumpPointerSpace* BumpPointerSpace::Create(const std::string& name, size_t capac capacity, PROT_READ | PROT_WRITE, /* low_4gb */ true, - /* reuse */ false, &error_msg); if (!mem_map.IsValid()) { LOG(ERROR) << "Failed to allocate pages for alloc space (" << name << ") of size " diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc index 2a4803ab14..71786279e2 100644 --- a/runtime/gc/space/image_space.cc +++ b/runtime/gc/space/image_space.cc @@ -818,7 +818,6 @@ class ImageSpace::Loader { image_header.GetImageSize(), PROT_READ | PROT_WRITE, /*low_4gb*/ true, - /*reuse*/ false, error_msg); if (map.IsValid()) { const size_t stored_size = image_header.GetDataSize(); diff --git a/runtime/gc/space/large_object_space.cc b/runtime/gc/space/large_object_space.cc index ada59b30f4..76ea9fda29 100644 --- a/runtime/gc/space/large_object_space.cc +++ b/runtime/gc/space/large_object_space.cc @@ -140,7 +140,6 @@ mirror::Object* LargeObjectMapSpace::Alloc(Thread* self, size_t num_bytes, num_bytes, PROT_READ | PROT_WRITE, /* low_4gb */ true, - /* reuse */ false, &error_msg); if (UNLIKELY(!mem_map.IsValid())) { LOG(WARNING) << "Large object allocation failed: " << error_msg; @@ -354,7 +353,6 @@ FreeListSpace* FreeListSpace::Create(const std::string& name, uint8_t* requested size, PROT_READ | PROT_WRITE, /* low_4gb */ true, - /* reuse */ false, &error_msg); CHECK(mem_map.IsValid()) << "Failed to allocate large object space mem map: " << error_msg; return new FreeListSpace(name, std::move(mem_map), mem_map.Begin(), mem_map.End()); @@ -378,7 +376,6 @@ FreeListSpace::FreeListSpace(const std::string& name, alloc_info_size, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); CHECK(allocation_info_map_.IsValid()) << "Failed to allocate allocation info map" << error_msg; allocation_info_ = reinterpret_cast(allocation_info_map_.Begin()); diff --git a/runtime/gc/space/malloc_space.cc b/runtime/gc/space/malloc_space.cc index 91e0ce8102..445560ad8d 100644 --- a/runtime/gc/space/malloc_space.cc +++ b/runtime/gc/space/malloc_space.cc @@ -110,7 +110,6 @@ MemMap MallocSpace::CreateMemMap(const std::string& name, *capacity, PROT_READ | PROT_WRITE, /* low_4gb */ true, - /* reuse */ false, &error_msg); if (!mem_map.IsValid()) { LOG(ERROR) << "Failed to allocate pages for alloc space (" << name << ") of size " diff --git a/runtime/gc/space/region_space.cc b/runtime/gc/space/region_space.cc index a2e2e95540..f74fa86467 100644 --- a/runtime/gc/space/region_space.cc +++ b/runtime/gc/space/region_space.cc @@ -59,7 +59,6 @@ MemMap RegionSpace::CreateMemMap(const std::string& name, capacity + kRegionSize, PROT_READ | PROT_WRITE, /* low_4gb */ true, - /* reuse */ false, &error_msg); if (mem_map.IsValid() || requested_begin == nullptr) { break; diff --git a/runtime/indirect_reference_table.cc b/runtime/indirect_reference_table.cc index 098db9f743..8ab4a9b47e 100644 --- a/runtime/indirect_reference_table.cc +++ b/runtime/indirect_reference_table.cc @@ -83,7 +83,6 @@ IndirectReferenceTable::IndirectReferenceTable(size_t max_count, table_bytes, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, error_msg); if (!table_mem_map_.IsValid() && error_msg->empty()) { *error_msg = "Unable to map memory for indirect ref table"; @@ -227,7 +226,6 @@ bool IndirectReferenceTable::Resize(size_t new_size, std::string* error_msg) { table_bytes, PROT_READ | PROT_WRITE, /* is_low_4gb */ false, - /* reuse */ false, error_msg); if (!new_map.IsValid()) { return false; diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc index d49ebd1e80..71fabd0250 100644 --- a/runtime/native/dalvik_system_DexFile.cc +++ b/runtime/native/dalvik_system_DexFile.cc @@ -177,7 +177,6 @@ static MemMap AllocateDexMemoryMap(JNIEnv* env, jint start, jint end) { length, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_message); if (!dex_mem_map.IsValid()) { ScopedObjectAccess soa(env); diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 9248bb928c..30d45871ff 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -1167,7 +1167,6 @@ bool Runtime::Init(RuntimeArgumentMap&& runtime_options_in) { kPageSize, PROT_NONE, /* low_4g */ true, - /* reuse */ false, /* error_msg */ nullptr); if (!protected_fault_page_.IsValid()) { LOG(WARNING) << "Could not reserve sentinel fault page"; diff --git a/runtime/runtime_callbacks_test.cc b/runtime/runtime_callbacks_test.cc index 4c4dcd893c..ed0472f414 100644 --- a/runtime/runtime_callbacks_test.cc +++ b/runtime/runtime_callbacks_test.cc @@ -194,8 +194,7 @@ TEST_F(ThreadLifecycleCallbackRuntimeCallbacksTest, ThreadLifecycleCallbackAttac /* addr */ nullptr, 128 * kPageSize, // Just some small stack. PROT_READ | PROT_WRITE, - false, - false, + /* low_4gb */ false, &error_msg); ASSERT_TRUE(stack.IsValid()) << error_msg; diff --git a/runtime/thread_pool.cc b/runtime/thread_pool.cc index 2a69bc6c10..28fc59c814 100644 --- a/runtime/thread_pool.cc +++ b/runtime/thread_pool.cc @@ -51,7 +51,6 @@ ThreadPoolWorker::ThreadPoolWorker(ThreadPool* thread_pool, const std::string& n stack_size, PROT_READ | PROT_WRITE, /* low_4gb */ false, - /* reuse */ false, &error_msg); CHECK(stack_.IsValid()) << error_msg; CHECK_ALIGNED(stack_.Begin(), kPageSize); -- GitLab From 4ba9246366cfd5ab287ee09a48af82fc73577a37 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Wed, 15 Aug 2018 19:16:24 +0100 Subject: [PATCH 009/126] Document why the LOS space is not scanned during Sticky-Bit CC collections. Add a comment explaining why the large-object (LOS) space is not scanned during sticky-bit (young-generation) CC collections at the beginning of ConcurrentCopying::MarkingPhase, whereas non-immune continuous spaces (region space and non-moving space) are. Test: n/a Bug: 67628039 Bug: 12687968 Change-Id: If560e8e66a25b50052d25e7e791a53b09508c024 --- runtime/gc/collector/concurrent_copying.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/runtime/gc/collector/concurrent_copying.cc b/runtime/gc/collector/concurrent_copying.cc index fdd0b62d3e..f574be8ae3 100644 --- a/runtime/gc/collector/concurrent_copying.cc +++ b/runtime/gc/collector/concurrent_copying.cc @@ -890,6 +890,21 @@ void ConcurrentCopying::MarkingPhase() { } // Scan all of the objects on dirty cards in unevac from space, and non moving space. These // are from previous GCs and may reference things in the from space. + // + // Note that we do not need to process the large-object space (the only discontinuous space) + // as it contains only large string objects and large primitive array objects, that have no + // reference to other objects, except their class. There is no need to scan these large + // objects, as the String class and the primitive array classes are expected to never move + // during a minor (young-generation) collection: + // - In the case where we run with a boot image, these classes are part of the image space, + // which is an immune space. + // - In the case where we run without a boot image, these classes are allocated in the region + // space (main space), but they are not expected to move during a minor collection (this + // would only happen if those classes were allocated between a major and a minor + // collections, which is unlikely -- we don't expect any GC to happen before these + // fundamental classes are initialized). Note that these classes could move during a major + // collection though, but this is fine: in that case, the whole heap is traced and the card + // table logic below is not used. Runtime::Current()->GetHeap()->GetCardTable()->Scan( space->GetMarkBitmap(), space->Begin(), -- GitLab From 680e099c3a279a7ce92dfec0d9529dad06add401 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Fri, 24 Aug 2018 15:41:26 +0100 Subject: [PATCH 010/126] Make literal arguments passed to art::MemMap::DumpMaps' more explicit. Test: mmma art Change-Id: I417f4fd8a0783c11acf5e17aefc419975ad223ea --- runtime/gc/collector/concurrent_copying.cc | 4 ++-- runtime/gc/collector/mark_sweep.cc | 2 +- runtime/gc/heap.cc | 2 +- runtime/gc/verification.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/gc/collector/concurrent_copying.cc b/runtime/gc/collector/concurrent_copying.cc index fdd0b62d3e..c7a5f79cb2 100644 --- a/runtime/gc/collector/concurrent_copying.cc +++ b/runtime/gc/collector/concurrent_copying.cc @@ -2152,7 +2152,7 @@ void ConcurrentCopying::AssertToSpaceInvariant(mirror::Object* obj, LOG(FATAL_WITHOUT_ABORT) << "Non-free regions:"; region_space_->DumpNonFreeRegions(LOG_STREAM(FATAL_WITHOUT_ABORT)); PrintFileToLog("/proc/self/maps", LogSeverity::FATAL_WITHOUT_ABORT); - MemMap::DumpMaps(LOG_STREAM(FATAL_WITHOUT_ABORT), true); + MemMap::DumpMaps(LOG_STREAM(FATAL_WITHOUT_ABORT), /* terse */ true); LOG(FATAL) << "Invalid reference " << ref << " referenced from object " << obj << " at offset " << offset; } @@ -2245,7 +2245,7 @@ void ConcurrentCopying::AssertToSpaceInvariant(GcRootSource* gc_root_source, LOG(FATAL_WITHOUT_ABORT) << "Non-free regions:"; region_space_->DumpNonFreeRegions(LOG_STREAM(FATAL_WITHOUT_ABORT)); PrintFileToLog("/proc/self/maps", LogSeverity::FATAL_WITHOUT_ABORT); - MemMap::DumpMaps(LOG_STREAM(FATAL_WITHOUT_ABORT), true); + MemMap::DumpMaps(LOG_STREAM(FATAL_WITHOUT_ABORT), /* terse */ true); LOG(FATAL) << "Invalid reference " << ref; } } else { diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc index 997d3b6f87..58a75ee189 100644 --- a/runtime/gc/collector/mark_sweep.cc +++ b/runtime/gc/collector/mark_sweep.cc @@ -446,7 +446,7 @@ class MarkSweep::MarkObjectSlowPath { !large_object_space->Contains(obj)))) { // Lowest priority logging first: PrintFileToLog("/proc/self/maps", LogSeverity::FATAL_WITHOUT_ABORT); - MemMap::DumpMaps(LOG_STREAM(FATAL_WITHOUT_ABORT), true); + MemMap::DumpMaps(LOG_STREAM(FATAL_WITHOUT_ABORT), /* terse */ true); // Buffer the output in the string stream since it is more important than the stack traces // and we want it to have log priority. The stack traces are printed from Runtime::Abort // which is called from LOG(FATAL) but before the abort message. diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 7913354433..bf06cf9758 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -642,7 +642,7 @@ Heap::Heap(size_t initial_size, bool no_gap = MemMap::CheckNoGaps(*first_space->GetMemMap(), *non_moving_space_->GetMemMap()); if (!no_gap) { PrintFileToLog("/proc/self/maps", LogSeverity::ERROR); - MemMap::DumpMaps(LOG_STREAM(ERROR), true); + MemMap::DumpMaps(LOG_STREAM(ERROR), /* terse */ true); LOG(FATAL) << "There's a gap between the image space and the non-moving space"; } } diff --git a/runtime/gc/verification.cc b/runtime/gc/verification.cc index fb5db1147f..d6a2fa0cb5 100644 --- a/runtime/gc/verification.cc +++ b/runtime/gc/verification.cc @@ -87,7 +87,7 @@ void Verification::LogHeapCorruption(ObjPtr holder, bool fatal) const { // Lowest priority logging first: PrintFileToLog("/proc/self/maps", android::base::LogSeverity::FATAL_WITHOUT_ABORT); - MemMap::DumpMaps(LOG_STREAM(FATAL_WITHOUT_ABORT), true); + MemMap::DumpMaps(LOG_STREAM(FATAL_WITHOUT_ABORT), /* terse */ true); // Buffer the output in the string stream since it is more important than the stack traces // and we want it to have log priority. The stack traces are printed from Runtime::Abort // which is called from LOG(FATAL) but before the abort message. -- GitLab From fe42d218cf8a3dcaa832651ea62e49ce7384c867 Mon Sep 17 00:00:00 2001 From: Orion Hodson Date: Fri, 24 Aug 2018 14:01:14 +0100 Subject: [PATCH 011/126] dexdump2: Remove conversion from dollar sign to dot This was presumably added to render nested classes similar to how they are referred to in source, but since a dollar sign ('$') is a valid character in a class name and its use is growing thanks to annotation processors and D8/R8 it only resulted in very wrong names. If you are at the level where you can understand dexdump's output, you can handle dollar signs being present in nested class names. Before: [000234] -..Lambda.Lambda.fcyZxanqBZSHC_nf-noKh-e3bnY.:()V 0000: new-instance v0, L-$$Lambda$Lambda$fcyZxanqBZSHC_nf-noKh-e3bnY; // type@0000 0002: invoke-direct {v0}, L-$$Lambda$Lambda$fcyZxanqBZSHC_nf-noKh-e3bnY;.:()V // method@0001 0005: sput-object v0, L-$$Lambda$Lambda$fcyZxanqBZSHC_nf-noKh-e3bnY;.INSTANCE:L-$$Lambda$Lambda$fcyZxanqBZSHC_nf-noKh-e3bnY; // field@0000 0007: return-void After: [000234] -$$Lambda$Lambda$fcyZxanqBZSHC_nf-noKh-e3bnY.:()V 0000: new-instance v0, L-$$Lambda$Lambda$fcyZxanqBZSHC_nf-noKh-e3bnY; // type@0000 0002: invoke-direct {v0}, L-$$Lambda$Lambda$fcyZxanqBZSHC_nf-noKh-e3bnY;.:()V // method@0001 0005: sput-object v0, L-$$Lambda$Lambda$fcyZxanqBZSHC_nf-noKh-e3bnY;.INSTANCE:L-$$Lambda$Lambda$fcyZxanqBZSHC_nf-noKh-e3bnY; // field@0000 0007: return-void Bug: 113152880 Test: art/test/dexdump/run-all-tests Test: dalvik/dx/tests/run-all-tests Change-Id: I22a1d3db5b7e0fe6b6c77b5cf8f37e7254bd40f4 --- dexdump/dexdump.cc | 17 ++++++-------- dexlayout/dexlayout.cc | 43 ++++++++-------------------------- test/dexdump/bytecodes.txt | 4 ++-- test/dexdump/bytecodes.xml | 12 +++++----- test/dexdump/checkers.xml | 2 +- test/dexdump/invoke-custom.txt | 10 ++++---- 6 files changed, 31 insertions(+), 57 deletions(-) diff --git a/dexdump/dexdump.cc b/dexdump/dexdump.cc index f8274e2f9a..e9b64028de 100644 --- a/dexdump/dexdump.cc +++ b/dexdump/dexdump.cc @@ -123,8 +123,7 @@ static const char* primitiveTypeLabel(char typeChar) { /* * Converts a type descriptor to human-readable "dotted" form. For * example, "Ljava/lang/String;" becomes "java.lang.String", and - * "[I" becomes "int[]". Also converts '$' to '.', which means this - * form can't be converted back to a descriptor. + * "[I" becomes "int[]". */ static std::unique_ptr descriptorToDot(const char* str) { int targetLen = strlen(str); @@ -157,7 +156,7 @@ static std::unique_ptr descriptorToDot(const char* str) { int i = 0; for (; i < targetLen; i++) { const char ch = str[offset + i]; - newStr[i] = (ch == '/' || ch == '$') ? '.' : ch; + newStr[i] = (ch == '/') ? '.' : ch; } // for // Add the appropriate number of brackets for arrays. @@ -171,10 +170,9 @@ static std::unique_ptr descriptorToDot(const char* str) { } /* - * Converts the class name portion of a type descriptor to human-readable - * "dotted" form. For example, "Ljava/lang/String;" becomes "String". + * Retrieves the class name portion of a type descriptor. */ -static std::unique_ptr descriptorClassToDot(const char* str) { +static std::unique_ptr descriptorClassToName(const char* str) { // Reduce to just the class name prefix. const char* lastSlash = strrchr(str, '/'); if (lastSlash == nullptr) { @@ -187,8 +185,7 @@ static std::unique_ptr descriptorClassToDot(const char* str) { const int targetLen = strlen(lastSlash); std::unique_ptr newStr(new char[targetLen]); for (int i = 0; i < targetLen - 1; i++) { - const char ch = lastSlash[i]; - newStr[i] = ch == '$' ? '.' : ch; + newStr[i] = lastSlash[i]; } // for newStr[targetLen - 1] = '\0'; return newStr; @@ -1250,7 +1247,7 @@ static void dumpMethod(const ClassAccessor::Method& method, int i) { // Method name and prototype. if (constructor) { - std::unique_ptr dot(descriptorClassToDot(backDescriptor)); + std::unique_ptr dot(descriptorClassToName(backDescriptor)); fprintf(gOutFile, " dot(descriptorClassToDot(classDescriptor)); + std::unique_ptr dot(descriptorClassToName(classDescriptor)); fprintf(gOutFile, "\n\n", dot.c_str()); } } @@ -1044,7 +1021,7 @@ void DexLayout::DumpBytecodes(uint32_t idx, const dex_ir::CodeItem* code, uint32 const char* back_descriptor = method_id->Class()->GetStringId()->Data(); // Generate header. - std::string dot(DescriptorToDotWrapper(back_descriptor)); + std::string dot(DescriptorToDot(back_descriptor)); fprintf(out_file_, "%06x: |[%06x] %s.%s:%s\n", code_offset, code_offset, dot.c_str(), name, type_descriptor.c_str()); @@ -1212,9 +1189,9 @@ void DexLayout::DumpMethod(uint32_t idx, uint32_t flags, const dex_ir::CodeItem* // Method name and prototype. if (constructor) { - std::string dot(DescriptorClassToDot(back_descriptor)); + std::string dot(DescriptorClassToName(back_descriptor)); fprintf(out_file_, "\n" "\n", arg_num++, dot.c_str()); } // while @@ -1309,7 +1286,7 @@ void DexLayout::DumpSField(uint32_t idx, uint32_t flags, int i, dex_ir::EncodedV } } else if (options_.output_format_ == kOutputXml) { fprintf(out_file_, ":()V +0009a8: |[0009a8] com.google.android.test.R$attr.:()V 0009b8: 7010 1900 0000 |0000: invoke-direct {v0}, Ljava/lang/Object;.:()V // method@0019 0009be: 0e00 |0003: return-void catches : (none) @@ -228,7 +228,7 @@ Class #4 - ins : 1 outs : 1 insns size : 4 16-bit code units -0009c0: |[0009c0] com.google.android.test.R.drawable.:()V +0009c0: |[0009c0] com.google.android.test.R$drawable.:()V 0009d0: 7010 1900 0000 |0000: invoke-direct {v0}, Ljava/lang/Object;.:()V // method@0019 0009d6: 0e00 |0003: return-void catches : (none) diff --git a/test/dexdump/bytecodes.xml b/test/dexdump/bytecodes.xml index d08c2e929c..d4ee3a7eee 100755 --- a/test/dexdump/bytecodes.xml +++ b/test/dexdump/bytecodes.xml @@ -71,7 +71,7 @@ > - - - - - + :(Ljava/lang/invoke/MethodHandle;)V +001b18: |[001b18] TestBadBootstrapArguments$TestersConstantCallSite.:(Ljava/lang/invoke/MethodHandle;)V 001b28: 7020 d200 1000 |0000: invoke-direct {v0, v1}, Ljava/lang/invoke/ConstantCallSite;.:(Ljava/lang/invoke/MethodHandle;)V // method@00d2 001b2e: 0e00 |0003: return-void catches : (none) @@ -537,7 +537,7 @@ Class #2 - ins : 2 outs : 1 insns size : 4 16-bit code units -002abc: |[002abc] TestInvocationKinds.Widget.:(I)V +002abc: |[002abc] TestInvocationKinds$Widget.:(I)V 002acc: 7010 bf00 0000 |0000: invoke-direct {v0}, Ljava/lang/Object;.:()V // method@00bf 002ad2: 0e00 |0003: return-void catches : (none) @@ -586,7 +586,7 @@ Class #3 - ins : 1 outs : 1 insns size : 4 16-bit code units -002ee8: |[002ee8] TestInvokeCustomWithConcurrentThreads.1.:()V +002ee8: |[002ee8] TestInvokeCustomWithConcurrentThreads$1.:()V 002ef8: 7010 cf00 0000 |0000: invoke-direct {v0}, Ljava/lang/ThreadLocal;.:()V // method@00cf 002efe: 0e00 |0003: return-void catches : (none) @@ -605,7 +605,7 @@ Class #3 - ins : 1 outs : 1 insns size : 13 16-bit code units -002ea0: |[002ea0] TestInvokeCustomWithConcurrentThreads.1.initialValue:()Ljava/lang/Integer; +002ea0: |[002ea0] TestInvokeCustomWithConcurrentThreads$1.initialValue:()Ljava/lang/Integer; 002eb0: 7100 6500 0000 |0000: invoke-static {}, LTestInvokeCustomWithConcurrentThreads;.access$000:()Ljava/util/concurrent/atomic/AtomicInteger; // method@0065 002eb6: 0c00 |0003: move-result-object v0 002eb8: 6e10 f100 0000 |0004: invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;.getAndIncrement:()I // method@00f1 @@ -628,7 +628,7 @@ Class #3 - ins : 1 outs : 1 insns size : 5 16-bit code units -002ecc: |[002ecc] TestInvokeCustomWithConcurrentThreads.1.initialValue:()Ljava/lang/Object; +002ecc: |[002ecc] TestInvokeCustomWithConcurrentThreads$1.initialValue:()Ljava/lang/Object; 002edc: 6e10 6100 0100 |0000: invoke-virtual {v1}, LTestInvokeCustomWithConcurrentThreads$1;.initialValue:()Ljava/lang/Integer; // method@0061 002ee2: 0c00 |0003: move-result-object v0 002ee4: 1100 |0004: return-object v0 -- GitLab From e477412d3531cb2aa6e285bc8a96621838b4a808 Mon Sep 17 00:00:00 2001 From: Orion Hodson Date: Fri, 24 Aug 2018 17:02:08 +0100 Subject: [PATCH 012/126] Avoid position sensitive argument errors with tar Running art/tools/golem/build-target.sh with a more recent GNU tar yields errors relating to --exclude being position sensitive arguments. Move to latterly expected positions. Test: art/tools/golem/build-target --machine-type=linux-armv7 --golem=art-opt-cc --tarball Change-Id: I6d4d4bb3f52a8b76960813679be200e8337d3b21 --- tools/golem/build-target.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/golem/build-target.sh b/tools/golem/build-target.sh index 921a8cbe36..45c9125930 100755 --- a/tools/golem/build-target.sh +++ b/tools/golem/build-target.sh @@ -367,7 +367,7 @@ if [[ "$make_tarball" == "make_tarball" ]]; then dirs_rooted+=("$root_dir/$tar_dir") done - execute tar -czf "${tarball}" "${dirs_rooted[@]}" --exclude .git --exclude .gitignore + execute tar -czf "${tarball}" --exclude ".git" --exclude ".gitignore" "${dirs_rooted[@]}" tar_result=$? if [[ $tar_result -ne 0 ]]; then [[ -f $tarball ]] && rm $tarball -- GitLab From 6cc23acba91d26d7afd6bc681004ac5865a8a163 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Fri, 24 Aug 2018 15:22:43 -0700 Subject: [PATCH 013/126] ART: Add API level to verifier Pass API level to verifier. In preparation for API-level dependent checks. Bug: 111969862 Test: m test-art-host Change-Id: I700ef52e28436a7fda8b9d9ef29841110ed6d3bb --- compiler/driver/compiler_driver.cc | 6 +++++- compiler/verifier_deps_test.cc | 3 ++- oatdump/oatdump.cc | 2 +- openjdkjvmti/ti_redefine.cc | 1 + runtime/class_linker.cc | 1 + runtime/monitor.cc | 5 ++++- runtime/verifier/method_verifier.cc | 26 +++++++++++++++++------- runtime/verifier/method_verifier.h | 19 +++++++++++++---- runtime/verifier/method_verifier_test.cc | 2 +- tools/art_verifier/art_verifier.cc | 7 +++++++ 10 files changed, 56 insertions(+), 16 deletions(-) diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 6eca304223..3f28aa7c68 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -1886,7 +1886,9 @@ void CompilerDriver::Verify(jobject jclass_loader, class VerifyClassVisitor : public CompilationVisitor { public: VerifyClassVisitor(const ParallelCompilationManager* manager, verifier::HardFailLogMode log_level) - : manager_(manager), log_level_(log_level) {} + : manager_(manager), + log_level_(log_level), + sdk_version_(Runtime::Current()->GetTargetSdkVersion()) {} virtual void Visit(size_t class_def_index) REQUIRES(!Locks::mutator_lock_) OVERRIDE { ScopedTrace trace(__FUNCTION__); @@ -1923,6 +1925,7 @@ class VerifyClassVisitor : public CompilationVisitor { Runtime::Current()->GetCompilerCallbacks(), true /* allow soft failures */, log_level_, + sdk_version_, &error_msg); if (failure_kind == verifier::FailureKind::kHardFailure) { LOG(ERROR) << "Verification failed on class " << PrettyDescriptor(descriptor) @@ -1995,6 +1998,7 @@ class VerifyClassVisitor : public CompilationVisitor { private: const ParallelCompilationManager* const manager_; const verifier::HardFailLogMode log_level_; + const uint32_t sdk_version_; }; void CompilerDriver::VerifyDexFile(jobject class_loader, diff --git a/compiler/verifier_deps_test.cc b/compiler/verifier_deps_test.cc index c223549710..5d76329ee8 100644 --- a/compiler/verifier_deps_test.cc +++ b/compiler/verifier_deps_test.cc @@ -178,7 +178,8 @@ class VerifierDepsTest : public CommonCompilerTest { true /* allow_soft_failures */, true /* need_precise_constants */, false /* verify to dump */, - true /* allow_thread_suspension */); + true /* allow_thread_suspension */, + 0 /* api_level */); verifier.Verify(); soa.Self()->SetVerifierDeps(nullptr); has_failures = verifier.HasFailures(); diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc index a5cc38b866..b6bfec6c56 100644 --- a/oatdump/oatdump.cc +++ b/oatdump/oatdump.cc @@ -1474,7 +1474,7 @@ class OatDumper { } return verifier::MethodVerifier::VerifyMethodAndDump( soa.Self(), vios, dex_method_idx, dex_file, dex_cache, *options_.class_loader_, - class_def, code_item, method, method_access_flags); + class_def, code_item, method, method_access_flags, /* api_level */ 0); } return nullptr; diff --git a/openjdkjvmti/ti_redefine.cc b/openjdkjvmti/ti_redefine.cc index 8707e272c6..f8c1172073 100644 --- a/openjdkjvmti/ti_redefine.cc +++ b/openjdkjvmti/ti_redefine.cc @@ -1122,6 +1122,7 @@ bool Redefiner::ClassRedefinition::CheckVerification(const RedefinitionDataIter& true, /*allow_soft_failures*/ /*log_level*/ art::verifier::HardFailLogMode::kLogWarning, + art::Runtime::Current()->GetTargetSdkVersion(), &error); switch (failure) { case art::verifier::FailureKind::kNoFailure: diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index f80d34ca2f..bc28a66c87 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -4169,6 +4169,7 @@ verifier::FailureKind ClassLinker::PerformClassVerification(Thread* self, runtime->GetCompilerCallbacks(), runtime->IsAotCompiler(), log_level, + Runtime::Current()->GetTargetSdkVersion(), error_msg); } diff --git a/runtime/monitor.cc b/runtime/monitor.cc index d47bc0d12e..7eabe1d7b2 100644 --- a/runtime/monitor.cc +++ b/runtime/monitor.cc @@ -1401,7 +1401,10 @@ void Monitor::VisitLocks(StackVisitor* stack_visitor, void (*callback)(mirror::O // Ask the verifier for the dex pcs of all the monitor-enter instructions corresponding to // the locks held in this stack frame. std::vector monitor_enter_dex_pcs; - verifier::MethodVerifier::FindLocksAtDexPc(m, dex_pc, &monitor_enter_dex_pcs); + verifier::MethodVerifier::FindLocksAtDexPc(m, + dex_pc, + &monitor_enter_dex_pcs, + Runtime::Current()->GetTargetSdkVersion()); for (verifier::MethodVerifier::DexLockInfo& dex_lock_info : monitor_enter_dex_pcs) { // As a debug check, check that dex PC corresponds to a monitor-enter. if (kIsDebugBuild) { diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc index a1b8938eaa..2064fc427e 100644 --- a/runtime/verifier/method_verifier.cc +++ b/runtime/verifier/method_verifier.cc @@ -149,6 +149,7 @@ FailureKind MethodVerifier::VerifyClass(Thread* self, CompilerCallbacks* callbacks, bool allow_soft_failures, HardFailLogMode log_level, + uint32_t api_level, std::string* error) { if (klass->IsVerified()) { return FailureKind::kNoFailure; @@ -188,6 +189,7 @@ FailureKind MethodVerifier::VerifyClass(Thread* self, callbacks, allow_soft_failures, log_level, + api_level, error); } @@ -211,6 +213,7 @@ FailureKind MethodVerifier::VerifyClass(Thread* self, CompilerCallbacks* callbacks, bool allow_soft_failures, HardFailLogMode log_level, + uint32_t api_level, std::string* error) { // A class must not be abstract and final. if ((class_def.access_flags_ & (kAccAbstract | kAccFinal)) == (kAccAbstract | kAccFinal)) { @@ -261,6 +264,7 @@ FailureKind MethodVerifier::VerifyClass(Thread* self, allow_soft_failures, log_level, /*need_precise_constants*/ false, + api_level, &hard_failure_msg); if (result.kind == FailureKind::kHardFailure) { if (failure_data.kind == FailureKind::kHardFailure) { @@ -322,6 +326,7 @@ MethodVerifier::FailureData MethodVerifier::VerifyMethod(Thread* self, bool allow_soft_failures, HardFailLogMode log_level, bool need_precise_constants, + uint32_t api_level, std::string* hard_failure_msg) { MethodVerifier::FailureData result; uint64_t start_ns = kTimeVerifyMethod ? NanoTime() : 0; @@ -339,7 +344,8 @@ MethodVerifier::FailureData MethodVerifier::VerifyMethod(Thread* self, allow_soft_failures, need_precise_constants, false /* verify to dump */, - true /* allow_thread_suspension */); + true /* allow_thread_suspension */, + api_level); if (verifier.Verify()) { // Verification completed, however failures may be pending that didn't cause the verification // to hard fail. @@ -458,7 +464,8 @@ MethodVerifier* MethodVerifier::VerifyMethodAndDump(Thread* self, const DexFile::ClassDef& class_def, const DexFile::CodeItem* code_item, ArtMethod* method, - uint32_t method_access_flags) { + uint32_t method_access_flags, + uint32_t api_level) { MethodVerifier* verifier = new MethodVerifier(self, dex_file, dex_cache, @@ -472,7 +479,8 @@ MethodVerifier* MethodVerifier::VerifyMethodAndDump(Thread* self, true /* allow_soft_failures */, true /* need_precise_constants */, true /* verify_to_dump */, - true /* allow_thread_suspension */); + true /* allow_thread_suspension */, + api_level); verifier->Verify(); verifier->DumpFailures(vios->Stream()); vios->Stream() << verifier->info_messages_.str(); @@ -500,7 +508,8 @@ MethodVerifier::MethodVerifier(Thread* self, bool allow_soft_failures, bool need_precise_constants, bool verify_to_dump, - bool allow_thread_suspension) + bool allow_thread_suspension, + uint32_t api_level) : self_(self), arena_stack_(Runtime::Current()->GetArenaPool()), allocator_(&arena_stack_), @@ -534,7 +543,8 @@ MethodVerifier::MethodVerifier(Thread* self, verify_to_dump_(verify_to_dump), allow_thread_suspension_(allow_thread_suspension), is_constructor_(false), - link_(nullptr) { + link_(nullptr), + api_level_(api_level == 0 ? std::numeric_limits::max() : api_level) { self->PushVerifier(this); } @@ -546,7 +556,8 @@ MethodVerifier::~MethodVerifier() { void MethodVerifier::FindLocksAtDexPc( ArtMethod* m, uint32_t dex_pc, - std::vector* monitor_enter_dex_pcs) { + std::vector* monitor_enter_dex_pcs, + uint32_t api_level) { StackHandleScope<2> hs(Thread::Current()); Handle dex_cache(hs.NewHandle(m->GetDexCache())); Handle class_loader(hs.NewHandle(m->GetClassLoader())); @@ -563,7 +574,8 @@ void MethodVerifier::FindLocksAtDexPc( true /* allow_soft_failures */, false /* need_precise_constants */, false /* verify_to_dump */, - false /* allow_thread_suspension */); + false /* allow_thread_suspension */, + api_level); verifier.interesting_dex_pc_ = dex_pc; verifier.monitor_enter_dex_pcs_ = monitor_enter_dex_pcs; verifier.FindLocksAtDexPc(); diff --git a/runtime/verifier/method_verifier.h b/runtime/verifier/method_verifier.h index 9890af9d95..eef22807ec 100644 --- a/runtime/verifier/method_verifier.h +++ b/runtime/verifier/method_verifier.h @@ -100,6 +100,7 @@ class MethodVerifier { CompilerCallbacks* callbacks, bool allow_soft_failures, HardFailLogMode log_level, + uint32_t api_level, std::string* error) REQUIRES_SHARED(Locks::mutator_lock_); static FailureKind VerifyClass(Thread* self, @@ -110,6 +111,7 @@ class MethodVerifier { CompilerCallbacks* callbacks, bool allow_soft_failures, HardFailLogMode log_level, + uint32_t api_level, std::string* error) REQUIRES_SHARED(Locks::mutator_lock_); @@ -121,7 +123,8 @@ class MethodVerifier { Handle class_loader, const DexFile::ClassDef& class_def, const DexFile::CodeItem* code_item, ArtMethod* method, - uint32_t method_access_flags) + uint32_t method_access_flags, + uint32_t api_level) REQUIRES_SHARED(Locks::mutator_lock_); uint8_t EncodePcToReferenceMapData() const; @@ -163,8 +166,10 @@ class MethodVerifier { // Fills 'monitor_enter_dex_pcs' with the dex pcs of the monitor-enter instructions corresponding // to the locks held at 'dex_pc' in method 'm'. // Note: this is the only situation where the verifier will visit quickened instructions. - static void FindLocksAtDexPc(ArtMethod* m, uint32_t dex_pc, - std::vector* monitor_enter_dex_pcs) + static void FindLocksAtDexPc(ArtMethod* m, + uint32_t dex_pc, + std::vector* monitor_enter_dex_pcs, + uint32_t api_level) REQUIRES_SHARED(Locks::mutator_lock_); static void Init() REQUIRES_SHARED(Locks::mutator_lock_); @@ -242,7 +247,8 @@ class MethodVerifier { bool allow_soft_failures, bool need_precise_constants, bool verify_to_dump, - bool allow_thread_suspension) + bool allow_thread_suspension, + uint32_t api_level) REQUIRES_SHARED(Locks::mutator_lock_); void UninstantiableError(const char* descriptor); @@ -299,6 +305,7 @@ class MethodVerifier { bool allow_soft_failures, HardFailLogMode log_level, bool need_precise_constants, + uint32_t api_level, std::string* hard_failure_msg) REQUIRES_SHARED(Locks::mutator_lock_); @@ -790,6 +797,10 @@ class MethodVerifier { // Link, for the method verifier root linked list. MethodVerifier* link_; + // API level, for dependent checks. Note: we do not use '0' for unset here, to simplify checks. + // Instead, unset level should correspond to max(). + const uint32_t api_level_; + friend class art::Thread; friend class VerifierDepsTest; diff --git a/runtime/verifier/method_verifier_test.cc b/runtime/verifier/method_verifier_test.cc index d1be9fa6f8..cedc583986 100644 --- a/runtime/verifier/method_verifier_test.cc +++ b/runtime/verifier/method_verifier_test.cc @@ -42,7 +42,7 @@ class MethodVerifierTest : public CommonRuntimeTest { // Verify the class std::string error_msg; FailureKind failure = MethodVerifier::VerifyClass( - self, klass, nullptr, true, HardFailLogMode::kLogWarning, &error_msg); + self, klass, nullptr, true, HardFailLogMode::kLogWarning, /* api_level */ 0u, &error_msg); if (android::base::StartsWith(descriptor, "Ljava/lang/invoke")) { ASSERT_TRUE(failure == FailureKind::kSoftFailure || diff --git a/tools/art_verifier/art_verifier.cc b/tools/art_verifier/art_verifier.cc index fc62410889..1a76a867f6 100644 --- a/tools/art_verifier/art_verifier.cc +++ b/tools/art_verifier/art_verifier.cc @@ -112,6 +112,9 @@ struct MethodVerifierArgs : public CmdlineArgs { } else if (option.starts_with("--repetitions=")) { char* end; repetitions_ = strtoul(option.substr(strlen("--repetitions=")).data(), &end, 10); + } else if (option.starts_with("--api-level=")) { + char* end; + api_level_ = strtoul(option.substr(strlen("--api-level=")).data(), &end, 10); } else { return kParseUnknownArgument; } @@ -147,6 +150,7 @@ struct MethodVerifierArgs : public CmdlineArgs { " --verbose: use verbose verifier mode.\n" " --verbose-debug: use verbose verifier debug mode.\n" " --repetitions=: repeat the verification count times.\n" + " --api-level=: use API level for verification.\n" "\n"; usage += Base::GetUsage(); @@ -163,6 +167,8 @@ struct MethodVerifierArgs : public CmdlineArgs { bool method_verifier_verbose_debug_ = false; size_t repetitions_ = 0u; + + uint32_t api_level_ = 0u; }; struct MethodVerifierMain : public CmdlineMain { @@ -242,6 +248,7 @@ struct MethodVerifierMain : public CmdlineMain { runtime->GetCompilerCallbacks(), true, verifier::HardFailLogMode::kLogWarning, + args_->api_level_, &error_msg); if (args_->repetitions_ == 0) { LOG(INFO) << descriptor << ": " << res << " " << error_msg; -- GitLab From 90fdc4846b87817863c9b6888e86a14dfa38890e Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Sat, 25 Aug 2018 00:12:36 +0100 Subject: [PATCH 014/126] Fix checker expectations around environment uses. X86 and X86_64 make ArrayLength "mark at use site", meaning its environment uses move to its user. ARM and ARM64 do not have this optimization. bug: 111545159 Test: 565-checker-condition-liveness Change-Id: Id903d83205fdf6a3d916efecbd14eff025f89422 --- .../src/Main.java | 70 +++++++++++++++++-- 1 file changed, 64 insertions(+), 6 deletions(-) diff --git a/test/565-checker-condition-liveness/src/Main.java b/test/565-checker-condition-liveness/src/Main.java index 374e136885..25ec3f53b1 100644 --- a/test/565-checker-condition-liveness/src/Main.java +++ b/test/565-checker-condition-liveness/src/Main.java @@ -30,26 +30,52 @@ public class Main { public static int p(float arg) { return (arg > 5.0f) ? 0 : -1; } + + /// CHECK-START-{ARM,ARM64}: void Main.testThrowIntoCatchBlock(int, java.lang.Object, int[]) liveness (after) + /// CHECK-DAG: <> ParameterValue env_uses:[23,25] + /// CHECK-DAG: <> ParameterValue env_uses:[11,23,25] + /// CHECK-DAG: <> ParameterValue env_uses:[11,23,25] + /// CHECK-DAG: <> IntConstant 1 env_uses:[23,25] + /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:10 + /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:20 + /// CHECK-DAG: ArrayLength liveness:22 + /// CHECK-DAG: BoundsCheck env:[[<>,<>,<>,<>]] liveness:24 + /// CHECK-DAG: TryBoundary + + /// CHECK-START-{ARM,ARM64}-DEBUGGABLE: void Main.testThrowIntoCatchBlock(int, java.lang.Object, int[]) liveness (after) + /// CHECK-DAG: <> ParameterValue env_uses:[11,23,25] + /// CHECK-DAG: <> ParameterValue env_uses:[11,23,25] + /// CHECK-DAG: <> ParameterValue env_uses:[11,23,25] + /// CHECK-DAG: <> IntConstant 1 env_uses:[23,25] + /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:10 + /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:20 + /// CHECK-DAG: ArrayLength liveness:22 + /// CHECK-DAG: BoundsCheck env:[[<>,<>,<>,<>]] liveness:24 + /// CHECK-DAG: TryBoundary - /// CHECK-START: void Main.testThrowIntoCatchBlock(int, java.lang.Object, int[]) liveness (after) + // X86 and X86_64 generate at use site the ArrayLength, meaning only the BoundsCheck will have environment uses. + /// CHECK-START-{X86,X86_64}: void Main.testThrowIntoCatchBlock(int, java.lang.Object, int[]) liveness (after) /// CHECK-DAG: <> ParameterValue env_uses:[25] /// CHECK-DAG: <> ParameterValue env_uses:[11,25] /// CHECK-DAG: <> ParameterValue env_uses:[11,25] /// CHECK-DAG: <> IntConstant 1 env_uses:[25] /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:10 /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:20 + /// CHECK-DAG: ArrayLength liveness:22 /// CHECK-DAG: BoundsCheck env:[[<>,<>,<>,<>]] liveness:24 /// CHECK-DAG: TryBoundary - /// CHECK-START-DEBUGGABLE: void Main.testThrowIntoCatchBlock(int, java.lang.Object, int[]) liveness (after) + /// CHECK-START-{X86,X86_64}-DEBUGGABLE: void Main.testThrowIntoCatchBlock(int, java.lang.Object, int[]) liveness (after) /// CHECK-DAG: <> ParameterValue env_uses:[11,25] /// CHECK-DAG: <> ParameterValue env_uses:[11,25] /// CHECK-DAG: <> ParameterValue env_uses:[11,25] /// CHECK-DAG: <> IntConstant 1 env_uses:[25] /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:10 /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:20 + /// CHECK-DAG: ArrayLength liveness:22 /// CHECK-DAG: BoundsCheck env:[[<>,<>,<>,<>]] liveness:24 /// CHECK-DAG: TryBoundary + // // A value live at a throwing instruction in a try block may be copied by // the exception handler to its location at the top of the catch block. @@ -60,22 +86,44 @@ public class Main { } } - /// CHECK-START: void Main.testBoundsCheck(int, java.lang.Object, int[]) liveness (after) + /// CHECK-START-{ARM,ARM64}: void Main.testBoundsCheck(int, java.lang.Object, int[]) liveness (after) + /// CHECK-DAG: <> ParameterValue env_uses:[] + /// CHECK-DAG: <> ParameterValue env_uses:[11,19,21] + /// CHECK-DAG: <> ParameterValue env_uses:[11,19,21] + /// CHECK-DAG: <> IntConstant 1 env_uses:[] + /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:10 + /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:16 + /// CHECK-DAG: ArrayLength liveness:18 + /// CHECK-DAG: BoundsCheck env:[[<>,<>,<>,<>]] liveness:20 + + /// CHECK-START-{ARM,ARM64}-DEBUGGABLE: void Main.testBoundsCheck(int, java.lang.Object, int[]) liveness (after) + /// CHECK-DAG: <> ParameterValue env_uses:[11,19,21] + /// CHECK-DAG: <> ParameterValue env_uses:[11,19,21] + /// CHECK-DAG: <> ParameterValue env_uses:[11,19,21] + /// CHECK-DAG: <> IntConstant 1 env_uses:[19,21] + /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:10 + /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:16 + /// CHECK-DAG: ArrayLength liveness:18 + /// CHECK-DAG: BoundsCheck env:[[<>,<>,<>,<>]] liveness:20 + + /// CHECK-START-{X86,X86_64}: void Main.testBoundsCheck(int, java.lang.Object, int[]) liveness (after) /// CHECK-DAG: <> ParameterValue env_uses:[] /// CHECK-DAG: <> ParameterValue env_uses:[11,21] /// CHECK-DAG: <> ParameterValue env_uses:[11,21] /// CHECK-DAG: <> IntConstant 1 env_uses:[] /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:10 /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:16 + /// CHECK-DAG: ArrayLength liveness:18 /// CHECK-DAG: BoundsCheck env:[[<>,<>,<>,<>]] liveness:20 - /// CHECK-START-DEBUGGABLE: void Main.testBoundsCheck(int, java.lang.Object, int[]) liveness (after) + /// CHECK-START-{X86,X86_64}-DEBUGGABLE: void Main.testBoundsCheck(int, java.lang.Object, int[]) liveness (after) /// CHECK-DAG: <> ParameterValue env_uses:[11,21] /// CHECK-DAG: <> ParameterValue env_uses:[11,21] /// CHECK-DAG: <> ParameterValue env_uses:[11,21] /// CHECK-DAG: <> IntConstant 1 env_uses:[21] /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:10 /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:16 + /// CHECK-DAG: ArrayLength liveness:18 /// CHECK-DAG: BoundsCheck env:[[<>,<>,<>,<>]] liveness:20 public static void testBoundsCheck(int x, Object y, int[] a) { a[1] = x; @@ -90,12 +138,22 @@ public class Main { /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:18 /// CHECK-DAG: ArrayLength liveness:20 /// CHECK-DAG: Deoptimize env:[[<>,<>,<>,<>]] liveness:24 + + /// CHECK-START-{ARM,ARM64}-DEBUGGABLE: void Main.testDeoptimize(int, java.lang.Object, int[]) liveness (after) + /// CHECK-DAG: <> ParameterValue env_uses:[13,21,25] + /// CHECK-DAG: <> ParameterValue env_uses:[13,21,25] + /// CHECK-DAG: <> ParameterValue env_uses:[13,21,25] + /// CHECK-DAG: <> IntConstant 0 env_uses:[21,25] + /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:12 + /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:18 + /// CHECK-DAG: ArrayLength liveness:20 + /// CHECK-DAG: Deoptimize env:[[<>,<>,<>,<>]] liveness:24 - /// CHECK-START-DEBUGGABLE: void Main.testDeoptimize(int, java.lang.Object, int[]) liveness (after) + /// CHECK-START-{X86,X86_64}-DEBUGGABLE: void Main.testDeoptimize(int, java.lang.Object, int[]) liveness (after) /// CHECK-DAG: <> ParameterValue env_uses:[13,21,25] /// CHECK-DAG: <> ParameterValue env_uses:[13,21,25] /// CHECK-DAG: <> ParameterValue env_uses:[13,21,25] - /// CHECK-DAG: <> IntConstant 0 env_uses:[19,25] + /// CHECK-DAG: <> IntConstant 0 env_uses:[21,25] /// CHECK-DAG: SuspendCheck env:[[_,<>,<>,<>]] liveness:12 /// CHECK-DAG: NullCheck env:[[<>,<>,<>,<>]] liveness:18 /// CHECK-DAG: ArrayLength liveness:20 -- GitLab From 2337d53846d9d2e7f82f8cf64ff25585ad010339 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Fri, 24 Aug 2018 18:58:25 -0700 Subject: [PATCH 015/126] ART: Restrict some checks in the verifier to P+ Reinstate old behavior for apps targeting earlier releases. Bug: 111969862 Test: m test-art-host Test: cts-tradefed run commandAndExit cts --m vm-tests-tf Change-Id: I207718d65f906817d20d5b32b53011530b616fab --- runtime/verifier/method_verifier.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc index 2064fc427e..e22afaa72a 100644 --- a/runtime/verifier/method_verifier.cc +++ b/runtime/verifier/method_verifier.cc @@ -3675,9 +3675,11 @@ const RegType& MethodVerifier::ResolveClass(dex::TypeIndex class_idx) { // the access-checks interpreter. If result is primitive, skip the access check. // // Note: we do this for unresolved classes to trigger re-verification at runtime. - if (C == CheckAccess::kYes && result->IsNonZeroReferenceTypes()) { + if (C == CheckAccess::kYes && + result->IsNonZeroReferenceTypes() && + (api_level_ >= 28u || !result->IsUnresolvedTypes())) { const RegType& referrer = GetDeclaringClass(); - if (!referrer.CanAccess(*result)) { + if ((api_level_ >= 28u || !referrer.IsUnresolvedTypes()) && !referrer.CanAccess(*result)) { Fail(VERIFY_ERROR_ACCESS_CLASS) << "(possibly) illegal class access: '" << referrer << "' -> '" << *result << "'"; } @@ -4737,7 +4739,7 @@ void MethodVerifier::VerifyISFieldAccess(const Instruction* inst, const RegType& DCHECK(!can_load_classes_ || self_->IsExceptionPending()); self_->ClearException(); } - } else { + } else if (api_level_ >= 28u) { // If we don't have the field (it seems we failed resolution) and this is a PUT, we need to // redo verification at runtime as the field may be final, unless the field id shows it's in // the same class. -- GitLab From a5ca8ebef24e38348213cef31417a4ccc7c3dd1a Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 24 Aug 2018 13:39:13 +0100 Subject: [PATCH 016/126] Default to usejit:true. Manually verified places that could be affected (go/lem, buildbots, CTS). Also adjust two tests expecting JIT. bug: 64164063 Test: m and tests Change-Id: I6dc441f0f58203546480a0f7220ad4d9cd593fd3 --- runtime/parsed_options.cc | 9 ++++++--- runtime/runtime_options.def | 2 +- test/638-checker-inline-cache-intrinsic/run | 2 ++ test/916-obsolete-jit/run | 10 +--------- test/etc/run-test-jar | 6 ++++-- test/knownfailures.json | 7 ++++++- 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc index a44e5a4b54..0d98d90f1e 100644 --- a/runtime/parsed_options.cc +++ b/runtime/parsed_options.cc @@ -518,9 +518,12 @@ bool ParsedOptions::DoParse(const RuntimeOptions& options, LOG(INFO) << "setting boot class path to " << *args.Get(M::BootClassPath); } - if (args.GetOrDefault(M::UseJitCompilation) && args.GetOrDefault(M::Interpret)) { - Usage("-Xusejit:true and -Xint cannot be specified together"); - Exit(0); + if (args.GetOrDefault(M::Interpret)) { + if (args.Exists(M::UseJitCompilation) && *args.Get(M::UseJitCompilation)) { + Usage("-Xusejit:true and -Xint cannot be specified together\n"); + Exit(0); + } + args.Set(M::UseJitCompilation, false); } // Set a default boot class path if we didn't get an explicit one via command line. diff --git a/runtime/runtime_options.def b/runtime/runtime_options.def index ef21f9f9e0..5e12bbce05 100644 --- a/runtime/runtime_options.def +++ b/runtime/runtime_options.def @@ -69,7 +69,7 @@ RUNTIME_OPTIONS_KEY (Unit, IgnoreMaxFootprint) RUNTIME_OPTIONS_KEY (Unit, LowMemoryMode) RUNTIME_OPTIONS_KEY (bool, UseTLAB, (kUseTlab || kUseReadBarrier)) RUNTIME_OPTIONS_KEY (bool, EnableHSpaceCompactForOOM, true) -RUNTIME_OPTIONS_KEY (bool, UseJitCompilation, false) +RUNTIME_OPTIONS_KEY (bool, UseJitCompilation, true) RUNTIME_OPTIONS_KEY (bool, DumpNativeStackOnSigQuit, true) RUNTIME_OPTIONS_KEY (bool, MadviseRandomAccess, false) RUNTIME_OPTIONS_KEY (unsigned int, JITCompileThreshold) diff --git a/test/638-checker-inline-cache-intrinsic/run b/test/638-checker-inline-cache-intrinsic/run index f43681dd56..15403100f5 100644 --- a/test/638-checker-inline-cache-intrinsic/run +++ b/test/638-checker-inline-cache-intrinsic/run @@ -14,4 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Set threshold to 100 to math the iterations done in the test. +# Pass --verbose-methods to only generate the CFG of these methods. exec ${RUN} --jit --runtime-option -Xjitthreshold:100 -Xcompiler-option --verbose-methods=inlineMonomorphic,knownReceiverType,stringEquals $@ diff --git a/test/916-obsolete-jit/run b/test/916-obsolete-jit/run index b6d406fd99..c6e62ae6cd 100755 --- a/test/916-obsolete-jit/run +++ b/test/916-obsolete-jit/run @@ -14,12 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -# We are testing the redefinition of compiled code but with jvmti we only allow -# jitted compiled code so always add the --jit argument. -if [[ "$@" == *"--jit"* ]]; then - other_args="" -else - other_args="--jit" -fi -./default-run "$@" ${other_args} \ - --jvmti +./default-run "$@" --jvmti diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index 713fd35523..5c4ad21bd6 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -588,7 +588,7 @@ if [ "$USE_GDB" = "y" ]; then fi if [ "$INTERPRETER" = "y" ]; then - INT_OPTS="-Xint" + INT_OPTS="${INT_OPTS} -Xint" if [ "$VERIFY" = "y" ] ; then INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=quicken" COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=quicken" @@ -604,7 +604,7 @@ if [ "$INTERPRETER" = "y" ]; then fi if [ "$JIT" = "y" ]; then - INT_OPTS="-Xusejit:true" + INT_OPTS="${INT_OPTS} -Xusejit:true" if [ "$VERIFY" = "y" ] ; then INT_OPTS="${INT_OPTS} -Xcompiler-option --compiler-filter=quicken" COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=quicken" @@ -613,6 +613,8 @@ if [ "$JIT" = "y" ]; then COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=assume-verified" DEX_VERIFY="${DEX_VERIFY} -Xverify:none" fi +else + INT_OPTS="${INT_OPTS} -Xusejit:false" fi JNI_OPTS="-Xjnigreflimit:512 -Xcheck:jni" diff --git a/test/knownfailures.json b/test/knownfailures.json index a280f8522b..f71e9363cb 100644 --- a/test/knownfailures.json +++ b/test/knownfailures.json @@ -246,7 +246,7 @@ "613-inlining-dex-cache", "626-set-resolved-string", "638-checker-inline-cache-intrinsic"], - "variant": "trace | stream", + "variant": "trace | stream", "description": ["These tests expect JIT compilation, which is", "suppressed when tracing."] }, @@ -256,6 +256,11 @@ "description": ["This test expects JIT compilation, which is", "suppressed when tracing."] }, + { + "tests": "638-checker-inline-cache-intrinsic", + "variant": "interpreter | interp-ac", + "description": ["Test expects JIT compilation"] + }, { "tests": "597-deopt-invoke-stub", "variant": "speed-profile | interp-ac | interpreter | optimizing | trace | stream", -- GitLab From 335c4ce2d954ffbadd7ef5e6ac1e87c427095948 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 24 Aug 2018 18:27:31 +0100 Subject: [PATCH 017/126] Invoke dex2at before invoking art. Make sure we always have an oat file before starting dalvikvm. Checked go/lem and other 'art' users that this CL works for them. bug: 111174995 bug: 111342996 Test: test.py Change-Id: Id60760f4185f077ab50df87ce63420dae7bf8aa6 --- tools/art | 210 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 145 insertions(+), 65 deletions(-) diff --git a/tools/art b/tools/art index aebf5a6778..23eb23b29f 100644 --- a/tools/art +++ b/tools/art @@ -16,28 +16,9 @@ # shell dialect that should work on the host (e.g. bash), and # Android (e.g. mksh). -# Globals -ART_BINARY=dalvikvm -DELETE_ANDROID_DATA="no" -LAUNCH_WRAPPER= -LIBART=libart.so -JIT_PROFILE="no" -ALLOW_DEFAULT_JDWP="no" -VERBOSE="no" -CLEAN_OAT_FILES="yes" -EXTRA_OPTIONS=() - -# Follow all sym links to get the program name. -if [ z"$BASH_SOURCE" != z ]; then - PROG_NAME="$BASH_SOURCE" -else - PROG_NAME="$0" -fi -while [ -h "$PROG_NAME" ]; do - # On Mac OS, readlink -f doesn't work. - PROG_NAME="$(readlink "$PROG_NAME")" -done - +###################################### +# Functions +###################################### function find_libdir() { # Get the actual file, $1 is the ART_BINARY_PATH and may be a symbolic link. # Use realpath instead of readlink because Android does not have a readlink. @@ -48,29 +29,6 @@ function find_libdir() { fi } -function replace_compiler_filter_with_quicken() { - ARGS_WITH_QUICKEN=("$@") - - found="false" - ((index=0)) - while ((index <= $#)); do - what="${ARGS_WITH_QUICKEN[$index]}" - - case "$what" in - --compiler-filter=*) - ARGS_WITH_QUICKEN[$index]="--compiler-filter=quicken" - found="true" - ;; - esac - - ((index++)) - shift - done - if [ "$found" != "true" ]; then - ARGS_WITH_QUICKEN=(-Xcompiler-option --compiler-filter=quicken "${ARGS_WITH_QUICKEN[@]}") - fi -} - function usage() { cat 1>&2 <&2 < "$ANDROID_DATA/profile_gen.log" EXIT_STATUS=$? @@ -400,13 +473,20 @@ if [ "$JIT_PROFILE" = "yes" ]; then rm -rf "$ANDROID_DATA/dalvik-cache" # Append arguments so next invocation of run_art uses the profile. - EXTRA_OPTIONS+=(-Xcompiler-option --profile-file="$PROFILE_PATH") + DEX2OAT_FLAGS+=(--profile-file="$PROFILE_PATH") fi -# Protect additional arguments in quotes to preserve whitespaces (used by -# run-jdwp-test.sh when running on device), '$' (may be used as part of -# classpath) and other special characters when evaluated. -EXTRA_OPTIONS+=("$@") +if [ -x "$DEX2OAT_BINARY_PATH" ]; then + # Run dex2oat before launching ART to generate the oat files for the classpath. + run_dex2oat +fi + +# Do not continue if the dex2oat failed. +EXIT_STATUS=$? +if [ $EXIT_STATUS != 0 ]; then + echo "Failed dex2oat invocation" >&2 + exit $EXIT_STATUS +fi run_art "${EXTRA_OPTIONS[@]}" EXIT_STATUS=$? -- GitLab From f0b33e50ce99b46e746d5f5a0d569b9a6e583bfd Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Sat, 25 Aug 2018 13:31:52 -0700 Subject: [PATCH 018/126] Fix an incorrect && with kTraceCountAllocs flag. The latest Clang warns on this particular use of a constant flag with logical operators. It looks like this: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand] Test: Build art Change-Id: If1635e8f02ac6ef438dbef201053973e5012b04c --- runtime/trace.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/trace.cc b/runtime/trace.cc index 1986eec353..50a179c59d 100644 --- a/runtime/trace.cc +++ b/runtime/trace.cc @@ -420,7 +420,7 @@ void Trace::Start(std::unique_ptr&& trace_file_in, if (the_trace_ != nullptr) { LOG(ERROR) << "Trace already in progress, ignoring this request"; } else { - enable_stats = (flags && kTraceCountAllocs) != 0; + enable_stats = (flags & kTraceCountAllocs) != 0; the_trace_ = new Trace(trace_file.release(), buffer_size, flags, output_mode, trace_mode); if (trace_mode == TraceMode::kSampling) { CHECK_PTHREAD_CALL(pthread_create, (&sampling_pthread_, nullptr, &RunSamplingThread, @@ -608,7 +608,7 @@ void Trace::Resume() { Runtime* runtime = Runtime::Current(); // Enable count of allocs if specified in the flags. - bool enable_stats = (the_trace->flags_ && kTraceCountAllocs) != 0; + bool enable_stats = (the_trace->flags_ & kTraceCountAllocs) != 0; { gc::ScopedGCCriticalSection gcs(self, -- GitLab From 686801f5f51881d82abdfd16aa850f95a53e38fd Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Sun, 26 Aug 2018 16:00:53 +0100 Subject: [PATCH 019/126] Fix two mistakes in art script rewrite. Fix typo and mimic ART behavior for having just one -cp. Test: art Change-Id: Ic7c566f3dd29d1cad4c130e81cb7e7f609b5b1d1 --- tools/art | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/art b/tools/art index 23eb23b29f..7bd4c54a22 100644 --- a/tools/art +++ b/tools/art @@ -229,11 +229,14 @@ function extract_dex2oat_flags() { shift ;; -Ximage:*) - DEX2OAT_BOOTIMAGE=$1 + DEX2OAT_BOOT_IMAGE=$1 # Remove '-Ximage:' from the argument. DEX2OAT_BOOT_IMAGE=${DEX2OAT_BOOT_IMAGE##-Ximage:} ;; -cp) + # Reset any previously parsed classpath, just like dalvikvm + # only supports one -cp argument. + DEX2OAT_CLASSPATH=() # TODO: support -classpath and CLASSPATH local oifs=$IFS IFS=':' -- GitLab From 1fc309a2a78795ac68d264b6cfafc2f1154e551c Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 27 Aug 2018 10:03:50 +0100 Subject: [PATCH 020/126] Always set compiler filter to 'quicken' for jdwp tests. Now that the 'art' script runs dex2oat before invoking dalvikvm, the default compiler filter is 'speed'. To avoid timeouts when running unneeded AOT compilation (jdwp tests run debuggable), just set the compiler filter to quicken. Test: run-jdwp-tests.sh Change-Id: I7bef19d5424b85ea19d96c1f443a46a2208c773c --- tools/run-jdwp-tests.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/run-jdwp-tests.sh b/tools/run-jdwp-tests.sh index a435f2e03e..b0b5810dcc 100755 --- a/tools/run-jdwp-tests.sh +++ b/tools/run-jdwp-tests.sh @@ -311,10 +311,10 @@ if [[ "$plugin" != "" ]]; then vm_args="$vm_args --vm-arg $plugin" fi -if $use_jit; then - vm_args="$vm_args --vm-arg -Xcompiler-option --vm-arg --compiler-filter=quicken" - debuggee_args="$debuggee_args -Xcompiler-option --compiler-filter=quicken" -fi +# Because we're running debuggable, we discard any AOT code. +# Therefore we run de2oat with 'quicken' to avoid spending time compiling. +vm_args="$vm_args --vm-arg -Xcompiler-option --vm-arg --compiler-filter=quicken" +debuggee_args="$debuggee_args -Xcompiler-option --compiler-filter=quicken" if $instant_jit; then debuggee_args="$debuggee_args -Xjitthreshold:0" -- GitLab From 7e91d1fe9b7cb41308ce381a108ff689f3cabed2 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Fri, 24 Aug 2018 14:04:43 -0700 Subject: [PATCH 021/126] Blacklist libcore fdsan tests on the host. Bug: http://b/113177877 Test: treehugger Change-Id: I12d5563b3321d58f00db15f3716d80276ac78c51 --- tools/libcore_failures.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/libcore_failures.txt b/tools/libcore_failures.txt index 264217ead6..3ef78d5718 100644 --- a/tools/libcore_failures.txt +++ b/tools/libcore_failures.txt @@ -224,5 +224,15 @@ "libcore.javax.crypto.CipherInputStreamTest#testCloseTwice", "libcore.libcore.io.BlockGuardOsTest#test_android_getaddrinfo_networkPolicy", "libcore.libcore.io.BlockGuardOsTest#test_checkNewMethodsInPosix"] +}, +{ + description: "fdsan doesn't exist on the host", + result: EXEC_FAILED, + modes: [host], + bug: 113177877, + names: ["libcore.libcore.io.FdsanTest#testFileInputStream", + "libcore.libcore.io.FdsanTest#testFileOutputStream", + "libcore.libcore.io.FdsanTest#testRandomAccessFile", + "libcore.libcore.io.FdsanTest#testParcelFileDescriptor"] } ] -- GitLab From 09bb51019d432dd8b31cf3ae928a3c723342da27 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 27 Aug 2018 10:26:26 +0100 Subject: [PATCH 022/126] Test for ZipFile.finalize. Test that ZipFile.finalize doesn't throw exceptions in the presence of a not fully constructed instance. Test: 718-zipfile-finalizer bug: 113311831 Change-Id: Ib922d1ee85db2834a1dba516720aee925db179ea --- test/718-zipfile-finalizer/expected.txt | 0 test/718-zipfile-finalizer/info.txt | 2 ++ test/718-zipfile-finalizer/src/Main.java | 40 ++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 test/718-zipfile-finalizer/expected.txt create mode 100644 test/718-zipfile-finalizer/info.txt create mode 100644 test/718-zipfile-finalizer/src/Main.java diff --git a/test/718-zipfile-finalizer/expected.txt b/test/718-zipfile-finalizer/expected.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/718-zipfile-finalizer/info.txt b/test/718-zipfile-finalizer/info.txt new file mode 100644 index 0000000000..c8b827e63c --- /dev/null +++ b/test/718-zipfile-finalizer/info.txt @@ -0,0 +1,2 @@ +Test that ZipFile.finalize doesn't throw exceptions +in the presence of a not fully constructed instance. diff --git a/test/718-zipfile-finalizer/src/Main.java b/test/718-zipfile-finalizer/src/Main.java new file mode 100644 index 0000000000..3eb439b7a6 --- /dev/null +++ b/test/718-zipfile-finalizer/src/Main.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.util.zip.ZipFile; + +public class Main { + public static void main(String[] args) throws Exception { + // By throwing an exception when setting up arguments of + // the constructor, we end up with a not fully constructed + // ZipFile. + try { + new ZipFile(null, throwException(), null); + throw new Error("Expected Exception"); + } catch (Exception e) { + // expected + } + + // Run finalizers. The golden file of this test checks + // that no exception is thrown from finalizers. + System.gc(); + System.runFinalization(); + } + + public static int throwException() throws Exception { + throw new Exception(); + } +} -- GitLab From bbc6e7edb5fca4a61ac53dd9bce79cb4f0bb3403 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Fri, 24 Aug 2018 16:58:47 +0100 Subject: [PATCH 023/126] Use 'final' and 'override' specifiers directly in ART. Remove all uses of macros 'FINAL' and 'OVERRIDE' and replace them with 'final' and 'override' specifiers. Remove all definitions of these macros as well, which were located in these files: - libartbase/base/macros.h - test/913-heaps/heaps.cc - test/ti-agent/ti_macros.h ART is now using C++14; the 'final' and 'override' specifiers have been introduced in C++11. Test: mmma art Change-Id: I256c7758155a71a2940ef2574925a44076feeebf --- adbconnection/adbconnection.h | 6 +- compiler/common_compiler_test.h | 6 +- compiler/compiled_method.h | 2 +- compiler/debug/dwarf/debug_abbrev_writer.h | 2 +- .../debug/dwarf/debug_info_entry_writer.h | 2 +- .../debug/dwarf/debug_line_opcode_writer.h | 2 +- compiler/dex/quick_compiler_callbacks.h | 20 +- compiler/driver/compiler_driver.cc | 22 +- compiler/driver/compiler_driver_test.cc | 6 +- compiler/driver/compiler_options.h | 2 +- compiler/jni/jni_compiler_test.cc | 4 +- .../jni/quick/arm/calling_convention_arm.h | 56 +- .../quick/arm64/calling_convention_arm64.h | 54 +- .../jni/quick/mips/calling_convention_mips.h | 56 +- .../quick/mips64/calling_convention_mips64.h | 54 +- .../jni/quick/x86/calling_convention_x86.h | 54 +- .../quick/x86_64/calling_convention_x86_64.h | 54 +- compiler/linker/buffered_output_stream.h | 10 +- compiler/linker/elf_builder.h | 18 +- .../linker/error_delaying_output_stream.h | 8 +- compiler/linker/file_output_stream.h | 10 +- compiler/linker/output_stream_test.cc | 8 +- compiler/linker/vector_output_stream.h | 10 +- .../optimizing/bounds_check_elimination.cc | 32 +- .../optimizing/bounds_check_elimination.h | 2 +- compiler/optimizing/cha_guard_optimization.cc | 4 +- compiler/optimizing/cha_guard_optimization.h | 2 +- compiler/optimizing/code_generator_arm64.cc | 52 +- compiler/optimizing/code_generator_arm64.h | 118 +-- .../optimizing/code_generator_arm_vixl.cc | 52 +- compiler/optimizing/code_generator_arm_vixl.h | 116 +-- compiler/optimizing/code_generator_mips.cc | 60 +- compiler/optimizing/code_generator_mips.h | 110 +-- compiler/optimizing/code_generator_mips64.cc | 60 +- compiler/optimizing/code_generator_mips64.h | 108 +-- compiler/optimizing/code_generator_x86.cc | 66 +- compiler/optimizing/code_generator_x86.h | 108 +-- compiler/optimizing/code_generator_x86_64.cc | 66 +- compiler/optimizing/code_generator_x86_64.h | 106 +-- compiler/optimizing/code_sinking.h | 2 +- compiler/optimizing/codegen_test_utils.h | 10 +- compiler/optimizing/constant_folding.cc | 46 +- compiler/optimizing/constant_folding.h | 2 +- ...onstructor_fence_redundancy_elimination.cc | 36 +- ...constructor_fence_redundancy_elimination.h | 2 +- compiler/optimizing/dead_code_elimination.h | 2 +- compiler/optimizing/emit_swap_mips_test.cc | 4 +- compiler/optimizing/graph_checker.h | 48 +- compiler/optimizing/graph_visualizer.cc | 84 +- compiler/optimizing/gvn.h | 2 +- compiler/optimizing/induction_var_analysis.h | 2 +- compiler/optimizing/inliner.h | 2 +- compiler/optimizing/instruction_simplifier.cc | 76 +- compiler/optimizing/instruction_simplifier.h | 2 +- .../optimizing/instruction_simplifier_arm.cc | 20 +- .../optimizing/instruction_simplifier_arm.h | 2 +- .../instruction_simplifier_arm64.cc | 26 +- .../optimizing/instruction_simplifier_arm64.h | 2 +- .../optimizing/instruction_simplifier_mips.cc | 4 +- .../optimizing/instruction_simplifier_mips.h | 2 +- compiler/optimizing/intrinsics.h | 2 +- compiler/optimizing/intrinsics_arm64.cc | 12 +- compiler/optimizing/intrinsics_arm64.h | 8 +- compiler/optimizing/intrinsics_arm_vixl.cc | 12 +- compiler/optimizing/intrinsics_arm_vixl.h | 8 +- compiler/optimizing/intrinsics_mips.cc | 4 +- compiler/optimizing/intrinsics_mips.h | 8 +- compiler/optimizing/intrinsics_mips64.cc | 4 +- compiler/optimizing/intrinsics_mips64.h | 8 +- compiler/optimizing/intrinsics_utils.h | 4 +- compiler/optimizing/intrinsics_x86.cc | 4 +- compiler/optimizing/intrinsics_x86.h | 8 +- compiler/optimizing/intrinsics_x86_64.cc | 4 +- compiler/optimizing/intrinsics_x86_64.h | 8 +- compiler/optimizing/licm.h | 2 +- compiler/optimizing/load_store_analysis.h | 22 +- compiler/optimizing/load_store_elimination.cc | 36 +- compiler/optimizing/load_store_elimination.h | 2 +- compiler/optimizing/loop_analysis.cc | 12 +- compiler/optimizing/loop_optimization.h | 2 +- compiler/optimizing/nodes.h | 900 +++++++++--------- compiler/optimizing/nodes_mips.h | 14 +- compiler/optimizing/nodes_shared.h | 36 +- compiler/optimizing/nodes_vector.h | 124 +-- compiler/optimizing/nodes_x86.h | 12 +- compiler/optimizing/optimizing_cfi_test.cc | 2 +- compiler/optimizing/optimizing_compiler.cc | 22 +- compiler/optimizing/parallel_move_resolver.h | 4 +- compiler/optimizing/parallel_move_test.cc | 18 +- .../optimizing/pc_relative_fixups_mips.cc | 8 +- compiler/optimizing/pc_relative_fixups_mips.h | 2 +- compiler/optimizing/pc_relative_fixups_x86.cc | 38 +- compiler/optimizing/pc_relative_fixups_x86.h | 2 +- .../prepare_for_register_allocation.h | 24 +- compiler/optimizing/pretty_printer.h | 14 +- .../optimizing/reference_type_propagation.cc | 40 +- .../optimizing/reference_type_propagation.h | 2 +- .../register_allocator_graph_color.h | 4 +- .../register_allocator_linear_scan.h | 6 +- .../optimizing/register_allocator_test.cc | 2 +- compiler/optimizing/scheduler.h | 10 +- compiler/optimizing/scheduler_arm.h | 6 +- compiler/optimizing/scheduler_arm64.h | 8 +- compiler/optimizing/select_generator.h | 2 +- compiler/optimizing/sharpening.h | 2 +- compiler/optimizing/ssa_liveness_analysis.h | 2 +- .../optimizing/ssa_liveness_analysis_test.cc | 2 +- compiler/optimizing/ssa_phi_elimination.h | 4 +- compiler/optimizing/ssa_test.cc | 8 +- compiler/optimizing/x86_memory_gen.cc | 2 +- compiler/optimizing/x86_memory_gen.h | 2 +- compiler/utils/arm/assembler_arm_vixl.h | 16 +- .../utils/arm/jni_macro_assembler_arm_vixl.h | 94 +- compiler/utils/arm64/assembler_arm64.h | 12 +- .../utils/arm64/jni_macro_assembler_arm64.h | 96 +- compiler/utils/assembler.h | 4 +- compiler/utils/assembler_test.h | 4 +- compiler/utils/jni_macro_assembler.h | 10 +- compiler/utils/jni_macro_assembler_test.h | 4 +- compiler/utils/mips/assembler_mips.h | 102 +- .../utils/mips/assembler_mips32r5_test.cc | 24 +- .../utils/mips/assembler_mips32r6_test.cc | 26 +- compiler/utils/mips/assembler_mips_test.cc | 18 +- compiler/utils/mips64/assembler_mips64.h | 100 +- .../utils/mips64/assembler_mips64_test.cc | 26 +- compiler/utils/x86/assembler_x86.h | 6 +- compiler/utils/x86/assembler_x86_test.cc | 18 +- compiler/utils/x86/jni_macro_assembler_x86.cc | 4 +- compiler/utils/x86/jni_macro_assembler_x86.h | 94 +- compiler/utils/x86_64/assembler_x86_64.h | 6 +- .../utils/x86_64/assembler_x86_64_test.cc | 24 +- .../x86_64/jni_macro_assembler_x86_64.cc | 4 +- .../utils/x86_64/jni_macro_assembler_x86_64.h | 92 +- compiler/verifier_deps_test.cc | 8 +- dex2oat/dex2oat.cc | 2 +- dex2oat/dex2oat_image_test.cc | 2 +- dex2oat/dex2oat_test.cc | 10 +- .../linker/arm/relative_patcher_arm_base.h | 8 +- dex2oat/linker/arm/relative_patcher_thumb2.h | 12 +- dex2oat/linker/arm64/relative_patcher_arm64.h | 18 +- dex2oat/linker/elf_writer_quick.cc | 36 +- dex2oat/linker/image_test.h | 4 +- dex2oat/linker/image_writer.cc | 16 +- dex2oat/linker/image_writer.h | 2 +- dex2oat/linker/mips/relative_patcher_mips.h | 16 +- .../linker/mips64/relative_patcher_mips64.h | 16 +- dex2oat/linker/multi_oat_relative_patcher.h | 6 +- .../linker/multi_oat_relative_patcher_test.cc | 10 +- dex2oat/linker/oat_writer.cc | 36 +- dex2oat/linker/relative_patcher.cc | 14 +- dex2oat/linker/relative_patcher_test.h | 10 +- dex2oat/linker/x86/relative_patcher_x86.h | 6 +- .../linker/x86/relative_patcher_x86_base.h | 10 +- .../linker/x86_64/relative_patcher_x86_64.h | 6 +- dexlayout/compact_dex_writer.h | 20 +- dexlayout/dex_container.h | 8 +- dexlayout/dex_ir.h | 38 +- dexlayout/dex_ir_builder.cc | 2 +- dexlayout/dex_writer.h | 6 +- dexoptanalyzer/dexoptanalyzer.cc | 2 +- disassembler/disassembler_arm.cc | 14 +- disassembler/disassembler_arm.h | 6 +- disassembler/disassembler_arm64.h | 14 +- disassembler/disassembler_mips.h | 6 +- disassembler/disassembler_x86.h | 6 +- imgdiag/imgdiag.cc | 12 +- imgdiag/imgdiag_test.cc | 2 +- libartbase/base/allocator.cc | 4 +- libartbase/base/arena_bit_vector.cc | 2 +- libartbase/base/bit_memory_region.h | 2 +- libartbase/base/common_art_test.h | 4 +- libartbase/base/dumpable.h | 2 +- libartbase/base/indenter.h | 4 +- libartbase/base/leb128.h | 2 +- libartbase/base/macros.h | 3 - libartbase/base/malloc_arena_pool.cc | 2 +- libartbase/base/malloc_arena_pool.h | 14 +- libartbase/base/memory_region.h | 2 +- libartbase/base/unix_file/fd_file.h | 12 +- libdexfile/dex/art_dex_file_loader.cc | 10 +- libdexfile/dex/art_dex_file_loader.h | 4 +- libdexfile/dex/art_dex_file_loader_test.cc | 2 +- libdexfile/dex/compact_dex_file.h | 12 +- libdexfile/dex/dex_file_loader.cc | 10 +- libdexfile/dex/dex_instruction.h | 12 +- libdexfile/dex/standard_dex_file.h | 10 +- .../profile/profile_compilation_info_test.cc | 2 +- oatdump/oatdump.cc | 12 +- openjdkjvmti/deopt_manager.h | 6 +- openjdkjvmti/events-inl.h | 2 +- openjdkjvmti/events.cc | 50 +- openjdkjvmti/object_tagging.h | 10 +- openjdkjvmti/ti_class.cc | 8 +- openjdkjvmti/ti_dump.cc | 2 +- openjdkjvmti/ti_heap.cc | 10 +- openjdkjvmti/ti_method.cc | 14 +- openjdkjvmti/ti_phase.cc | 2 +- openjdkjvmti/ti_redefine.cc | 4 +- openjdkjvmti/ti_search.cc | 2 +- openjdkjvmti/ti_stack.cc | 16 +- openjdkjvmti/ti_thread.cc | 4 +- openjdkjvmti/transform.cc | 4 +- patchoat/patchoat.cc | 8 +- profman/profile_assistant_test.cc | 2 +- profman/profman.cc | 2 +- runtime/aot_class_linker.h | 4 +- runtime/arch/arch_test.cc | 4 +- runtime/arch/arm/context_arm.h | 30 +- .../arch/arm/instruction_set_features_arm.h | 14 +- runtime/arch/arm64/context_arm64.h | 30 +- .../arm64/instruction_set_features_arm64.h | 12 +- runtime/arch/mips/context_mips.h | 28 +- .../arch/mips/instruction_set_features_mips.h | 12 +- runtime/arch/mips64/context_mips64.h | 28 +- .../mips64/instruction_set_features_mips64.h | 12 +- runtime/arch/stub_test.cc | 4 +- runtime/arch/x86/context_x86.h | 30 +- .../arch/x86/instruction_set_features_x86.h | 12 +- runtime/arch/x86_64/context_x86_64.h | 30 +- .../x86_64/instruction_set_features_x86_64.h | 6 +- runtime/art_field.h | 2 +- runtime/art_method.h | 2 +- runtime/base/mem_map_arena_pool.cc | 4 +- runtime/base/mem_map_arena_pool.h | 14 +- runtime/base/mutex.cc | 6 +- runtime/base/mutex.h | 4 +- runtime/cha.cc | 8 +- runtime/class_linker.cc | 24 +- runtime/class_linker_test.cc | 4 +- runtime/common_runtime_test.h | 4 +- runtime/compiler_filter.h | 2 +- runtime/debugger.cc | 34 +- runtime/debugger.h | 22 +- runtime/dex2oat_environment_test.h | 6 +- runtime/dexopt_test.h | 4 +- .../quick/quick_trampoline_entrypoints.cc | 36 +- .../quick_trampoline_entrypoints_test.cc | 4 +- runtime/fault_handler.h | 16 +- runtime/gc/accounting/mod_union_table-inl.h | 2 +- runtime/gc/accounting/mod_union_table.cc | 4 +- runtime/gc/accounting/mod_union_table.h | 32 +- runtime/gc/accounting/mod_union_table_test.cc | 6 +- runtime/gc/allocation_record.cc | 2 +- runtime/gc/collector/concurrent_copying.cc | 18 +- runtime/gc/collector/concurrent_copying.h | 26 +- runtime/gc/collector/immune_spaces_test.cc | 8 +- runtime/gc/collector/mark_sweep.cc | 12 +- runtime/gc/collector/mark_sweep.h | 20 +- runtime/gc/collector/partial_mark_sweep.h | 4 +- runtime/gc/collector/semi_space.h | 18 +- runtime/gc/collector/sticky_mark_sweep.h | 12 +- runtime/gc/heap.cc | 20 +- runtime/gc/heap_test.cc | 2 +- runtime/gc/space/bump_pointer_space.h | 28 +- runtime/gc/space/dlmalloc_space.h | 42 +- runtime/gc/space/image_space.h | 6 +- runtime/gc/space/image_space_test.cc | 6 +- runtime/gc/space/large_object_space.cc | 14 +- runtime/gc/space/large_object_space.h | 44 +- runtime/gc/space/malloc_space.h | 2 +- runtime/gc/space/memory_tool_malloc_space.h | 18 +- runtime/gc/space/region_space.h | 28 +- runtime/gc/space/rosalloc_space.h | 40 +- runtime/gc/space/space.h | 12 +- runtime/gc/space/zygote_space.h | 24 +- runtime/gc/system_weak.h | 6 +- runtime/gc/system_weak_test.cc | 8 +- runtime/gc/task_processor_test.cc | 6 +- runtime/gc/verification.cc | 2 +- runtime/gc_root.h | 4 +- runtime/handle_scope.h | 2 +- runtime/hidden_api_test.cc | 2 +- runtime/hprof/hprof.cc | 24 +- runtime/instrumentation.cc | 10 +- runtime/instrumentation_test.cc | 28 +- runtime/intern_table_test.cc | 2 +- runtime/java_frame_root_info.h | 4 +- runtime/jit/jit.cc | 8 +- runtime/jit/jit_code_cache.cc | 8 +- runtime/jit/profile_saver.cc | 2 +- runtime/jit/profiling_info_test.cc | 2 +- runtime/jni/java_vm_ext_test.cc | 4 +- runtime/jni/jni_internal_test.cc | 2 +- runtime/mirror/class.h | 2 +- runtime/mirror/dex_cache.h | 2 +- runtime/mirror/dex_cache_test.cc | 2 +- runtime/mirror/iftable.h | 2 +- runtime/mirror/proxy.h | 2 +- runtime/mirror/stack_trace_element.h | 2 +- runtime/mirror/string.h | 2 +- runtime/mirror/var_handle.cc | 26 +- runtime/monitor.cc | 12 +- runtime/monitor_objects_stack_visitor.h | 2 +- runtime/monitor_test.cc | 2 +- runtime/native/dalvik_system_VMDebug.cc | 2 +- runtime/native/dalvik_system_VMRuntime.cc | 2 +- runtime/native/dalvik_system_ZygoteHooks.cc | 4 +- runtime/noop_compiler_callbacks.h | 10 +- runtime/oat_file.cc | 22 +- runtime/oat_file.h | 6 +- runtime/proxy_test.cc | 2 +- runtime/quick_exception_handler.cc | 12 +- runtime/runtime.cc | 2 +- runtime/runtime_callbacks_test.cc | 40 +- runtime/stack.cc | 6 +- runtime/thread.cc | 34 +- runtime/thread_list.cc | 4 +- runtime/trace.h | 24 +- runtime/transaction.h | 2 +- runtime/verifier/instruction_flags.h | 2 +- runtime/verifier/reg_type.h | 280 +++--- runtime/verifier/reg_type_test.cc | 2 +- simulator/code_simulator_arm64.h | 8 +- test/167-visit-locks/visit_locks.cc | 2 +- test/1945-proxy-method-arguments/get_args.cc | 4 +- test/203-multi-checkpoint/multi_checkpoint.cc | 4 +- test/305-other-fault-handler/fault_handler.cc | 4 +- test/616-cha-unloading/cha_unload.cc | 2 +- test/906-iterate-heap/iterate_heap.cc | 6 +- test/913-heaps/heaps.cc | 12 +- test/common/stack_inspect.cc | 2 +- test/ti-agent/ti_macros.h | 2 - tools/art_verifier/art_verifier.cc | 10 +- tools/dexanalyze/dexanalyze_experiments.h | 12 +- tools/dexanalyze/dexanalyze_strings.h | 4 +- tools/hiddenapi/hiddenapi.cc | 8 +- tools/tracefast-plugin/tracefast.cc | 30 +- tools/veridex/flow_analysis.h | 8 +- 328 files changed, 3243 insertions(+), 3250 deletions(-) diff --git a/adbconnection/adbconnection.h b/adbconnection/adbconnection.h index 04e39bf4ff..c51f981f40 100644 --- a/adbconnection/adbconnection.h +++ b/adbconnection/adbconnection.h @@ -46,12 +46,12 @@ struct AdbConnectionDebuggerController : public art::DebuggerControlCallback { : connection_(connection) {} // Begin running the debugger. - void StartDebugger() OVERRIDE; + void StartDebugger() override; // The debugger should begin shutting down since the runtime is ending. - void StopDebugger() OVERRIDE; + void StopDebugger() override; - bool IsDebuggerConfigured() OVERRIDE; + bool IsDebuggerConfigured() override; private: AdbConnectionState* connection_; diff --git a/compiler/common_compiler_test.h b/compiler/common_compiler_test.h index 366489c58f..e6d1564621 100644 --- a/compiler/common_compiler_test.h +++ b/compiler/common_compiler_test.h @@ -57,9 +57,9 @@ class CommonCompilerTest : public CommonRuntimeTest { REQUIRES_SHARED(Locks::mutator_lock_); protected: - void SetUp() OVERRIDE; + void SetUp() override; - void SetUpRuntimeOptions(RuntimeOptions* options) OVERRIDE; + void SetUpRuntimeOptions(RuntimeOptions* options) override; Compiler::Kind GetCompilerKind() const; void SetCompilerKind(Compiler::Kind compiler_kind); @@ -73,7 +73,7 @@ class CommonCompilerTest : public CommonRuntimeTest { return CompilerFilter::kDefaultCompilerFilter; } - void TearDown() OVERRIDE; + void TearDown() override; void CompileClass(mirror::ClassLoader* class_loader, const char* class_name) REQUIRES_SHARED(Locks::mutator_lock_); diff --git a/compiler/compiled_method.h b/compiler/compiled_method.h index f88028034d..864ce585cf 100644 --- a/compiler/compiled_method.h +++ b/compiler/compiled_method.h @@ -104,7 +104,7 @@ class CompiledCode { uint32_t packed_fields_; }; -class CompiledMethod FINAL : public CompiledCode { +class CompiledMethod final : public CompiledCode { public: // Constructs a CompiledMethod. // Note: Consider using the static allocation methods below that will allocate the CompiledMethod diff --git a/compiler/debug/dwarf/debug_abbrev_writer.h b/compiler/debug/dwarf/debug_abbrev_writer.h index cccca255c1..63a049b2cc 100644 --- a/compiler/debug/dwarf/debug_abbrev_writer.h +++ b/compiler/debug/dwarf/debug_abbrev_writer.h @@ -37,7 +37,7 @@ namespace dwarf { // determines all the attributes and their format. // It is possible to think of them as type definitions. template > -class DebugAbbrevWriter FINAL : private Writer { +class DebugAbbrevWriter final : private Writer { static_assert(std::is_same::value, "Invalid value type"); public: diff --git a/compiler/debug/dwarf/debug_info_entry_writer.h b/compiler/debug/dwarf/debug_info_entry_writer.h index 89d16f2b2a..b198178d5d 100644 --- a/compiler/debug/dwarf/debug_info_entry_writer.h +++ b/compiler/debug/dwarf/debug_info_entry_writer.h @@ -42,7 +42,7 @@ namespace dwarf { * EndTag(); */ template > -class DebugInfoEntryWriter FINAL : private Writer { +class DebugInfoEntryWriter final : private Writer { static_assert(std::is_same::value, "Invalid value type"); public: diff --git a/compiler/debug/dwarf/debug_line_opcode_writer.h b/compiler/debug/dwarf/debug_line_opcode_writer.h index b4a4d63f01..bb4e87ff7e 100644 --- a/compiler/debug/dwarf/debug_line_opcode_writer.h +++ b/compiler/debug/dwarf/debug_line_opcode_writer.h @@ -31,7 +31,7 @@ namespace dwarf { // * Keep track of current state and convert absolute values to deltas. // * Divide by header-defined factors as appropriate. template> -class DebugLineOpCodeWriter FINAL : private Writer { +class DebugLineOpCodeWriter final : private Writer { static_assert(std::is_same::value, "Invalid value type"); public: diff --git a/compiler/dex/quick_compiler_callbacks.h b/compiler/dex/quick_compiler_callbacks.h index 8a07e9c12c..b7117bd223 100644 --- a/compiler/dex/quick_compiler_callbacks.h +++ b/compiler/dex/quick_compiler_callbacks.h @@ -26,7 +26,7 @@ class CompilerDriver; class DexFile; class VerificationResults; -class QuickCompilerCallbacks FINAL : public CompilerCallbacks { +class QuickCompilerCallbacks final : public CompilerCallbacks { public: explicit QuickCompilerCallbacks(CompilerCallbacks::CallbackMode mode) : CompilerCallbacks(mode), dex_files_(nullptr) {} @@ -34,20 +34,20 @@ class QuickCompilerCallbacks FINAL : public CompilerCallbacks { ~QuickCompilerCallbacks() { } void MethodVerified(verifier::MethodVerifier* verifier) - REQUIRES_SHARED(Locks::mutator_lock_) OVERRIDE; + REQUIRES_SHARED(Locks::mutator_lock_) override; - void ClassRejected(ClassReference ref) OVERRIDE; + void ClassRejected(ClassReference ref) override; // We are running in an environment where we can call patchoat safely so we should. - bool IsRelocationPossible() OVERRIDE { + bool IsRelocationPossible() override { return true; } - verifier::VerifierDeps* GetVerifierDeps() const OVERRIDE { + verifier::VerifierDeps* GetVerifierDeps() const override { return verifier_deps_.get(); } - void SetVerifierDeps(verifier::VerifierDeps* deps) OVERRIDE { + void SetVerifierDeps(verifier::VerifierDeps* deps) override { verifier_deps_.reset(deps); } @@ -55,18 +55,18 @@ class QuickCompilerCallbacks FINAL : public CompilerCallbacks { verification_results_ = verification_results; } - ClassStatus GetPreviousClassState(ClassReference ref) OVERRIDE; + ClassStatus GetPreviousClassState(ClassReference ref) override; void SetDoesClassUnloading(bool does_class_unloading, CompilerDriver* compiler_driver) - OVERRIDE { + override { does_class_unloading_ = does_class_unloading; compiler_driver_ = compiler_driver; DCHECK(!does_class_unloading || compiler_driver_ != nullptr); } - void UpdateClassState(ClassReference ref, ClassStatus state) OVERRIDE; + void UpdateClassState(ClassReference ref, ClassStatus state) override; - bool CanUseOatStatusForVerification(mirror::Class* klass) OVERRIDE + bool CanUseOatStatusForVerification(mirror::Class* klass) override REQUIRES_SHARED(Locks::mutator_lock_); void SetDexFiles(const std::vector* dex_files) { diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 6eca304223..fd7a35f16a 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -971,7 +971,7 @@ class ResolveCatchBlockExceptionsClassVisitor : public ClassVisitor { public: ResolveCatchBlockExceptionsClassVisitor() : classes_() {} - virtual bool operator()(ObjPtr c) OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_) { + virtual bool operator()(ObjPtr c) override REQUIRES_SHARED(Locks::mutator_lock_) { classes_.push_back(c); return true; } @@ -1034,7 +1034,7 @@ class RecordImageClassesVisitor : public ClassVisitor { explicit RecordImageClassesVisitor(HashSet* image_classes) : image_classes_(image_classes) {} - bool operator()(ObjPtr klass) OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_) { + bool operator()(ObjPtr klass) override REQUIRES_SHARED(Locks::mutator_lock_) { std::string temp; image_classes_->insert(klass->GetDescriptor(&temp)); return true; @@ -1210,7 +1210,7 @@ class ClinitImageUpdate { : data_(data), hs_(hs) {} - bool operator()(ObjPtr klass) OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_) { + bool operator()(ObjPtr klass) override REQUIRES_SHARED(Locks::mutator_lock_) { std::string temp; StringPiece name(klass->GetDescriptor(&temp)); if (data_->image_class_descriptors_->find(name) != data_->image_class_descriptors_->end()) { @@ -1475,7 +1475,7 @@ class ParallelCompilationManager { end_(end), fn_(fn) {} - void Run(Thread* self) OVERRIDE { + void Run(Thread* self) override { while (true) { const size_t index = manager_->NextIndex(); if (UNLIKELY(index >= end_)) { @@ -1486,7 +1486,7 @@ class ParallelCompilationManager { } } - void Finalize() OVERRIDE { + void Finalize() override { delete this; } @@ -1568,7 +1568,7 @@ class ResolveClassFieldsAndMethodsVisitor : public CompilationVisitor { explicit ResolveClassFieldsAndMethodsVisitor(const ParallelCompilationManager* manager) : manager_(manager) {} - void Visit(size_t class_def_index) OVERRIDE REQUIRES(!Locks::mutator_lock_) { + void Visit(size_t class_def_index) override REQUIRES(!Locks::mutator_lock_) { ScopedTrace trace(__FUNCTION__); Thread* const self = Thread::Current(); jobject jclass_loader = manager_->GetClassLoader(); @@ -1667,7 +1667,7 @@ class ResolveTypeVisitor : public CompilationVisitor { public: explicit ResolveTypeVisitor(const ParallelCompilationManager* manager) : manager_(manager) { } - void Visit(size_t type_idx) OVERRIDE REQUIRES(!Locks::mutator_lock_) { + void Visit(size_t type_idx) override REQUIRES(!Locks::mutator_lock_) { // Class derived values are more complicated, they require the linker and loader. ScopedObjectAccess soa(Thread::Current()); ClassLinker* class_linker = manager_->GetClassLinker(); @@ -1888,7 +1888,7 @@ class VerifyClassVisitor : public CompilationVisitor { VerifyClassVisitor(const ParallelCompilationManager* manager, verifier::HardFailLogMode log_level) : manager_(manager), log_level_(log_level) {} - virtual void Visit(size_t class_def_index) REQUIRES(!Locks::mutator_lock_) OVERRIDE { + virtual void Visit(size_t class_def_index) REQUIRES(!Locks::mutator_lock_) override { ScopedTrace trace(__FUNCTION__); ScopedObjectAccess soa(Thread::Current()); const DexFile& dex_file = *manager_->GetDexFile(); @@ -2020,7 +2020,7 @@ class SetVerifiedClassVisitor : public CompilationVisitor { public: explicit SetVerifiedClassVisitor(const ParallelCompilationManager* manager) : manager_(manager) {} - virtual void Visit(size_t class_def_index) REQUIRES(!Locks::mutator_lock_) OVERRIDE { + virtual void Visit(size_t class_def_index) REQUIRES(!Locks::mutator_lock_) override { ScopedTrace trace(__FUNCTION__); ScopedObjectAccess soa(Thread::Current()); const DexFile& dex_file = *manager_->GetDexFile(); @@ -2085,7 +2085,7 @@ class InitializeClassVisitor : public CompilationVisitor { public: explicit InitializeClassVisitor(const ParallelCompilationManager* manager) : manager_(manager) {} - void Visit(size_t class_def_index) OVERRIDE { + void Visit(size_t class_def_index) override { ScopedTrace trace(__FUNCTION__); jobject jclass_loader = manager_->GetClassLoader(); const DexFile& dex_file = *manager_->GetDexFile(); @@ -2470,7 +2470,7 @@ class InitializeArrayClassesAndCreateConflictTablesVisitor : public ClassVisitor explicit InitializeArrayClassesAndCreateConflictTablesVisitor(VariableSizedHandleScope& hs) : hs_(hs) {} - virtual bool operator()(ObjPtr klass) OVERRIDE + virtual bool operator()(ObjPtr klass) override REQUIRES_SHARED(Locks::mutator_lock_) { if (Runtime::Current()->GetHeap()->ObjectIsInBootImageSpace(klass)) { return true; diff --git a/compiler/driver/compiler_driver_test.cc b/compiler/driver/compiler_driver_test.cc index 2eeb4399db..fe1568da83 100644 --- a/compiler/driver/compiler_driver_test.cc +++ b/compiler/driver/compiler_driver_test.cc @@ -186,7 +186,7 @@ TEST_F(CompilerDriverTest, AbstractMethodErrorStub) { class CompilerDriverProfileTest : public CompilerDriverTest { protected: - ProfileCompilationInfo* GetProfileCompilationInfo() OVERRIDE { + ProfileCompilationInfo* GetProfileCompilationInfo() override { ScopedObjectAccess soa(Thread::Current()); std::vector> dex_files = OpenTestDexFiles("ProfileTestMultiDex"); @@ -200,7 +200,7 @@ class CompilerDriverProfileTest : public CompilerDriverTest { return &profile_info_; } - CompilerFilter::Filter GetCompilerFilter() const OVERRIDE { + CompilerFilter::Filter GetCompilerFilter() const override { // Use a profile based filter. return CompilerFilter::kSpeedProfile; } @@ -278,7 +278,7 @@ TEST_F(CompilerDriverProfileTest, ProfileGuidedCompilation) { // which will be used for OatClass. class CompilerDriverVerifyTest : public CompilerDriverTest { protected: - CompilerFilter::Filter GetCompilerFilter() const OVERRIDE { + CompilerFilter::Filter GetCompilerFilter() const override { return CompilerFilter::kVerify; } diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h index 601c9140dd..34aceba1c4 100644 --- a/compiler/driver/compiler_options.h +++ b/compiler/driver/compiler_options.h @@ -43,7 +43,7 @@ class DexFile; enum class InstructionSet; class InstructionSetFeatures; -class CompilerOptions FINAL { +class CompilerOptions final { public: // Guide heuristics to determine whether to compile method if profile data not available. static const size_t kDefaultHugeMethodThreshold = 10000; diff --git a/compiler/jni/jni_compiler_test.cc b/compiler/jni/jni_compiler_test.cc index 3cb4a652ad..92b9543c27 100644 --- a/compiler/jni/jni_compiler_test.cc +++ b/compiler/jni/jni_compiler_test.cc @@ -221,12 +221,12 @@ struct jni_remove_extra_parameters : public remove_extra_parameters_helper(PointerSize::k32); -class ArmManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingConvention { +class ArmManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention { public: ArmManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty) : ManagedRuntimeCallingConvention(is_static, is_synchronized, shorty, PointerSize::k32) {} - ~ArmManagedRuntimeCallingConvention() OVERRIDE {} + ~ArmManagedRuntimeCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // Managed runtime calling convention - ManagedRegister MethodRegister() OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; - const ManagedRegisterEntrySpills& EntrySpills() OVERRIDE; + ManagedRegister MethodRegister() override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; + const ManagedRegisterEntrySpills& EntrySpills() override; private: ManagedRegisterEntrySpills entry_spills_; @@ -50,37 +50,37 @@ class ArmManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingCon DISALLOW_COPY_AND_ASSIGN(ArmManagedRuntimeCallingConvention); }; -class ArmJniCallingConvention FINAL : public JniCallingConvention { +class ArmJniCallingConvention final : public JniCallingConvention { public: ArmJniCallingConvention(bool is_static, bool is_synchronized, bool is_critical_native, const char* shorty); - ~ArmJniCallingConvention() OVERRIDE {} + ~ArmJniCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister IntReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister IntReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // JNI calling convention - void Next() OVERRIDE; // Override default behavior for AAPCS - size_t FrameSize() OVERRIDE; - size_t OutArgSize() OVERRIDE; - ArrayRef CalleeSaveRegisters() const OVERRIDE; - ManagedRegister ReturnScratchRegister() const OVERRIDE; - uint32_t CoreSpillMask() const OVERRIDE; - uint32_t FpSpillMask() const OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; + void Next() override; // Override default behavior for AAPCS + size_t FrameSize() override; + size_t OutArgSize() override; + ArrayRef CalleeSaveRegisters() const override; + ManagedRegister ReturnScratchRegister() const override; + uint32_t CoreSpillMask() const override; + uint32_t FpSpillMask() const override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; // AAPCS mandates return values are extended. - bool RequiresSmallResultTypeExtension() const OVERRIDE { + bool RequiresSmallResultTypeExtension() const override { return false; } protected: - size_t NumberOfOutgoingStackArgs() OVERRIDE; + size_t NumberOfOutgoingStackArgs() override; private: // Padding to ensure longs and doubles are not split in AAPCS diff --git a/compiler/jni/quick/arm64/calling_convention_arm64.h b/compiler/jni/quick/arm64/calling_convention_arm64.h index 56189427b6..ed0ddeb1b2 100644 --- a/compiler/jni/quick/arm64/calling_convention_arm64.h +++ b/compiler/jni/quick/arm64/calling_convention_arm64.h @@ -25,24 +25,24 @@ namespace arm64 { constexpr size_t kFramePointerSize = static_cast(PointerSize::k64); -class Arm64ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingConvention { +class Arm64ManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention { public: Arm64ManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty) : ManagedRuntimeCallingConvention(is_static, is_synchronized, shorty, PointerSize::k64) {} - ~Arm64ManagedRuntimeCallingConvention() OVERRIDE {} + ~Arm64ManagedRuntimeCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // Managed runtime calling convention - ManagedRegister MethodRegister() OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; - const ManagedRegisterEntrySpills& EntrySpills() OVERRIDE; + ManagedRegister MethodRegister() override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; + const ManagedRegisterEntrySpills& EntrySpills() override; private: ManagedRegisterEntrySpills entry_spills_; @@ -50,36 +50,36 @@ class Arm64ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingC DISALLOW_COPY_AND_ASSIGN(Arm64ManagedRuntimeCallingConvention); }; -class Arm64JniCallingConvention FINAL : public JniCallingConvention { +class Arm64JniCallingConvention final : public JniCallingConvention { public: Arm64JniCallingConvention(bool is_static, bool is_synchronized, bool is_critical_native, const char* shorty); - ~Arm64JniCallingConvention() OVERRIDE {} + ~Arm64JniCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister IntReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister IntReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // JNI calling convention - size_t FrameSize() OVERRIDE; - size_t OutArgSize() OVERRIDE; - ArrayRef CalleeSaveRegisters() const OVERRIDE; - ManagedRegister ReturnScratchRegister() const OVERRIDE; - uint32_t CoreSpillMask() const OVERRIDE; - uint32_t FpSpillMask() const OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; + size_t FrameSize() override; + size_t OutArgSize() override; + ArrayRef CalleeSaveRegisters() const override; + ManagedRegister ReturnScratchRegister() const override; + uint32_t CoreSpillMask() const override; + uint32_t FpSpillMask() const override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; // aarch64 calling convention leaves upper bits undefined. - bool RequiresSmallResultTypeExtension() const OVERRIDE { + bool RequiresSmallResultTypeExtension() const override { return true; } protected: - size_t NumberOfOutgoingStackArgs() OVERRIDE; + size_t NumberOfOutgoingStackArgs() override; private: DISALLOW_COPY_AND_ASSIGN(Arm64JniCallingConvention); diff --git a/compiler/jni/quick/mips/calling_convention_mips.h b/compiler/jni/quick/mips/calling_convention_mips.h index ad3f118bad..165fc6056e 100644 --- a/compiler/jni/quick/mips/calling_convention_mips.h +++ b/compiler/jni/quick/mips/calling_convention_mips.h @@ -27,24 +27,24 @@ constexpr size_t kFramePointerSize = 4; static_assert(kFramePointerSize == static_cast(PointerSize::k32), "Invalid frame pointer size"); -class MipsManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingConvention { +class MipsManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention { public: MipsManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty) : ManagedRuntimeCallingConvention(is_static, is_synchronized, shorty, PointerSize::k32) {} - ~MipsManagedRuntimeCallingConvention() OVERRIDE {} + ~MipsManagedRuntimeCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // Managed runtime calling convention - ManagedRegister MethodRegister() OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; - const ManagedRegisterEntrySpills& EntrySpills() OVERRIDE; + ManagedRegister MethodRegister() override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; + const ManagedRegisterEntrySpills& EntrySpills() override; private: ManagedRegisterEntrySpills entry_spills_; @@ -52,37 +52,37 @@ class MipsManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingCo DISALLOW_COPY_AND_ASSIGN(MipsManagedRuntimeCallingConvention); }; -class MipsJniCallingConvention FINAL : public JniCallingConvention { +class MipsJniCallingConvention final : public JniCallingConvention { public: MipsJniCallingConvention(bool is_static, bool is_synchronized, bool is_critical_native, const char* shorty); - ~MipsJniCallingConvention() OVERRIDE {} + ~MipsJniCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister IntReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister IntReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // JNI calling convention - void Next() OVERRIDE; // Override default behavior for o32. - size_t FrameSize() OVERRIDE; - size_t OutArgSize() OVERRIDE; - ArrayRef CalleeSaveRegisters() const OVERRIDE; - ManagedRegister ReturnScratchRegister() const OVERRIDE; - uint32_t CoreSpillMask() const OVERRIDE; - uint32_t FpSpillMask() const OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; + void Next() override; // Override default behavior for o32. + size_t FrameSize() override; + size_t OutArgSize() override; + ArrayRef CalleeSaveRegisters() const override; + ManagedRegister ReturnScratchRegister() const override; + uint32_t CoreSpillMask() const override; + uint32_t FpSpillMask() const override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; // Mips does not need to extend small return types. - bool RequiresSmallResultTypeExtension() const OVERRIDE { + bool RequiresSmallResultTypeExtension() const override { return false; } protected: - size_t NumberOfOutgoingStackArgs() OVERRIDE; + size_t NumberOfOutgoingStackArgs() override; private: // Padding to ensure longs and doubles are not split in o32. diff --git a/compiler/jni/quick/mips64/calling_convention_mips64.h b/compiler/jni/quick/mips64/calling_convention_mips64.h index faedaeff6c..d87f73a1ea 100644 --- a/compiler/jni/quick/mips64/calling_convention_mips64.h +++ b/compiler/jni/quick/mips64/calling_convention_mips64.h @@ -27,24 +27,24 @@ constexpr size_t kFramePointerSize = 8; static_assert(kFramePointerSize == static_cast(PointerSize::k64), "Invalid frame pointer size"); -class Mips64ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingConvention { +class Mips64ManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention { public: Mips64ManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty) : ManagedRuntimeCallingConvention(is_static, is_synchronized, shorty, PointerSize::k64) {} - ~Mips64ManagedRuntimeCallingConvention() OVERRIDE {} + ~Mips64ManagedRuntimeCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // Managed runtime calling convention - ManagedRegister MethodRegister() OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; - const ManagedRegisterEntrySpills& EntrySpills() OVERRIDE; + ManagedRegister MethodRegister() override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; + const ManagedRegisterEntrySpills& EntrySpills() override; private: ManagedRegisterEntrySpills entry_spills_; @@ -52,36 +52,36 @@ class Mips64ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCalling DISALLOW_COPY_AND_ASSIGN(Mips64ManagedRuntimeCallingConvention); }; -class Mips64JniCallingConvention FINAL : public JniCallingConvention { +class Mips64JniCallingConvention final : public JniCallingConvention { public: Mips64JniCallingConvention(bool is_static, bool is_synchronized, bool is_critical_native, const char* shorty); - ~Mips64JniCallingConvention() OVERRIDE {} + ~Mips64JniCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister IntReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister IntReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // JNI calling convention - size_t FrameSize() OVERRIDE; - size_t OutArgSize() OVERRIDE; - ArrayRef CalleeSaveRegisters() const OVERRIDE; - ManagedRegister ReturnScratchRegister() const OVERRIDE; - uint32_t CoreSpillMask() const OVERRIDE; - uint32_t FpSpillMask() const OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; + size_t FrameSize() override; + size_t OutArgSize() override; + ArrayRef CalleeSaveRegisters() const override; + ManagedRegister ReturnScratchRegister() const override; + uint32_t CoreSpillMask() const override; + uint32_t FpSpillMask() const override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; // Mips64 does not need to extend small return types. - bool RequiresSmallResultTypeExtension() const OVERRIDE { + bool RequiresSmallResultTypeExtension() const override { return false; } protected: - size_t NumberOfOutgoingStackArgs() OVERRIDE; + size_t NumberOfOutgoingStackArgs() override; private: DISALLOW_COPY_AND_ASSIGN(Mips64JniCallingConvention); diff --git a/compiler/jni/quick/x86/calling_convention_x86.h b/compiler/jni/quick/x86/calling_convention_x86.h index be83cdaad0..d0c6198e77 100644 --- a/compiler/jni/quick/x86/calling_convention_x86.h +++ b/compiler/jni/quick/x86/calling_convention_x86.h @@ -25,7 +25,7 @@ namespace x86 { constexpr size_t kFramePointerSize = static_cast(PointerSize::k32); -class X86ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingConvention { +class X86ManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention { public: X86ManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty) : ManagedRuntimeCallingConvention(is_static, @@ -33,17 +33,17 @@ class X86ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingCon shorty, PointerSize::k32), gpr_arg_count_(0) {} - ~X86ManagedRuntimeCallingConvention() OVERRIDE {} + ~X86ManagedRuntimeCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // Managed runtime calling convention - ManagedRegister MethodRegister() OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; - const ManagedRegisterEntrySpills& EntrySpills() OVERRIDE; + ManagedRegister MethodRegister() override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; + const ManagedRegisterEntrySpills& EntrySpills() override; private: int gpr_arg_count_; @@ -53,36 +53,36 @@ class X86ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingCon }; // Implements the x86 cdecl calling convention. -class X86JniCallingConvention FINAL : public JniCallingConvention { +class X86JniCallingConvention final : public JniCallingConvention { public: X86JniCallingConvention(bool is_static, bool is_synchronized, bool is_critical_native, const char* shorty); - ~X86JniCallingConvention() OVERRIDE {} + ~X86JniCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister IntReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister IntReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // JNI calling convention - size_t FrameSize() OVERRIDE; - size_t OutArgSize() OVERRIDE; - ArrayRef CalleeSaveRegisters() const OVERRIDE; - ManagedRegister ReturnScratchRegister() const OVERRIDE; - uint32_t CoreSpillMask() const OVERRIDE; - uint32_t FpSpillMask() const OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; + size_t FrameSize() override; + size_t OutArgSize() override; + ArrayRef CalleeSaveRegisters() const override; + ManagedRegister ReturnScratchRegister() const override; + uint32_t CoreSpillMask() const override; + uint32_t FpSpillMask() const override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; // x86 needs to extend small return types. - bool RequiresSmallResultTypeExtension() const OVERRIDE { + bool RequiresSmallResultTypeExtension() const override { return true; } protected: - size_t NumberOfOutgoingStackArgs() OVERRIDE; + size_t NumberOfOutgoingStackArgs() override; private: DISALLOW_COPY_AND_ASSIGN(X86JniCallingConvention); diff --git a/compiler/jni/quick/x86_64/calling_convention_x86_64.h b/compiler/jni/quick/x86_64/calling_convention_x86_64.h index cdba334d81..dfab41b154 100644 --- a/compiler/jni/quick/x86_64/calling_convention_x86_64.h +++ b/compiler/jni/quick/x86_64/calling_convention_x86_64.h @@ -23,59 +23,59 @@ namespace art { namespace x86_64 { -class X86_64ManagedRuntimeCallingConvention FINAL : public ManagedRuntimeCallingConvention { +class X86_64ManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention { public: X86_64ManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty) : ManagedRuntimeCallingConvention(is_static, is_synchronized, shorty, PointerSize::k64) {} - ~X86_64ManagedRuntimeCallingConvention() OVERRIDE {} + ~X86_64ManagedRuntimeCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // Managed runtime calling convention - ManagedRegister MethodRegister() OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; - const ManagedRegisterEntrySpills& EntrySpills() OVERRIDE; + ManagedRegister MethodRegister() override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; + const ManagedRegisterEntrySpills& EntrySpills() override; private: ManagedRegisterEntrySpills entry_spills_; DISALLOW_COPY_AND_ASSIGN(X86_64ManagedRuntimeCallingConvention); }; -class X86_64JniCallingConvention FINAL : public JniCallingConvention { +class X86_64JniCallingConvention final : public JniCallingConvention { public: X86_64JniCallingConvention(bool is_static, bool is_synchronized, bool is_critical_native, const char* shorty); - ~X86_64JniCallingConvention() OVERRIDE {} + ~X86_64JniCallingConvention() override {} // Calling convention - ManagedRegister ReturnRegister() OVERRIDE; - ManagedRegister IntReturnRegister() OVERRIDE; - ManagedRegister InterproceduralScratchRegister() OVERRIDE; + ManagedRegister ReturnRegister() override; + ManagedRegister IntReturnRegister() override; + ManagedRegister InterproceduralScratchRegister() override; // JNI calling convention - size_t FrameSize() OVERRIDE; - size_t OutArgSize() OVERRIDE; - ArrayRef CalleeSaveRegisters() const OVERRIDE; - ManagedRegister ReturnScratchRegister() const OVERRIDE; - uint32_t CoreSpillMask() const OVERRIDE; - uint32_t FpSpillMask() const OVERRIDE; - bool IsCurrentParamInRegister() OVERRIDE; - bool IsCurrentParamOnStack() OVERRIDE; - ManagedRegister CurrentParamRegister() OVERRIDE; - FrameOffset CurrentParamStackOffset() OVERRIDE; + size_t FrameSize() override; + size_t OutArgSize() override; + ArrayRef CalleeSaveRegisters() const override; + ManagedRegister ReturnScratchRegister() const override; + uint32_t CoreSpillMask() const override; + uint32_t FpSpillMask() const override; + bool IsCurrentParamInRegister() override; + bool IsCurrentParamOnStack() override; + ManagedRegister CurrentParamRegister() override; + FrameOffset CurrentParamStackOffset() override; // x86-64 needs to extend small return types. - bool RequiresSmallResultTypeExtension() const OVERRIDE { + bool RequiresSmallResultTypeExtension() const override { return true; } protected: - size_t NumberOfOutgoingStackArgs() OVERRIDE; + size_t NumberOfOutgoingStackArgs() override; private: DISALLOW_COPY_AND_ASSIGN(X86_64JniCallingConvention); diff --git a/compiler/linker/buffered_output_stream.h b/compiler/linker/buffered_output_stream.h index 512409cb2f..cb1c44ba23 100644 --- a/compiler/linker/buffered_output_stream.h +++ b/compiler/linker/buffered_output_stream.h @@ -26,17 +26,17 @@ namespace art { namespace linker { -class BufferedOutputStream FINAL : public OutputStream { +class BufferedOutputStream final : public OutputStream { public: explicit BufferedOutputStream(std::unique_ptr out); - ~BufferedOutputStream() OVERRIDE; + ~BufferedOutputStream() override; - bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE; + bool WriteFully(const void* buffer, size_t byte_count) override; - off_t Seek(off_t offset, Whence whence) OVERRIDE; + off_t Seek(off_t offset, Whence whence) override; - bool Flush() OVERRIDE; + bool Flush() override; private: static const size_t kBufferSize = 8 * KB; diff --git a/compiler/linker/elf_builder.h b/compiler/linker/elf_builder.h index 974c590a65..81ecc175b5 100644 --- a/compiler/linker/elf_builder.h +++ b/compiler/linker/elf_builder.h @@ -75,7 +75,7 @@ namespace linker { // The debug sections are written last for easier stripping. // template -class ElfBuilder FINAL { +class ElfBuilder final { public: static constexpr size_t kMaxProgramHeaders = 16; // SHA-1 digest. Not using SHA_DIGEST_LENGTH from openssl/sha.h to avoid @@ -173,21 +173,21 @@ class ElfBuilder FINAL { // This function always succeeds to simplify code. // Use builder's Good() to check the actual status. - bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE { + bool WriteFully(const void* buffer, size_t byte_count) override { CHECK(owner_->current_section_ == this); return owner_->stream_.WriteFully(buffer, byte_count); } // This function always succeeds to simplify code. // Use builder's Good() to check the actual status. - off_t Seek(off_t offset, Whence whence) OVERRIDE { + off_t Seek(off_t offset, Whence whence) override { // Forward the seek as-is and trust the caller to use it reasonably. return owner_->stream_.Seek(offset, whence); } // This function flushes the output and returns whether it succeeded. // If there was a previous failure, this does nothing and returns false, i.e. failed. - bool Flush() OVERRIDE { + bool Flush() override { return owner_->stream_.Flush(); } @@ -271,7 +271,7 @@ class ElfBuilder FINAL { }; // Writer of .dynstr section. - class CachedStringSection FINAL : public CachedSection { + class CachedStringSection final : public CachedSection { public: CachedStringSection(ElfBuilder* owner, const std::string& name, @@ -295,7 +295,7 @@ class ElfBuilder FINAL { }; // Writer of .strtab and .shstrtab sections. - class StringSection FINAL : public Section { + class StringSection final : public Section { public: StringSection(ElfBuilder* owner, const std::string& name, @@ -338,7 +338,7 @@ class ElfBuilder FINAL { }; // Writer of .dynsym and .symtab sections. - class SymbolSection FINAL : public Section { + class SymbolSection final : public Section { public: SymbolSection(ElfBuilder* owner, const std::string& name, @@ -410,7 +410,7 @@ class ElfBuilder FINAL { std::vector syms_; // Buffered/cached content of the whole section. }; - class AbiflagsSection FINAL : public Section { + class AbiflagsSection final : public Section { public: // Section with Mips abiflag info. static constexpr uint8_t MIPS_AFL_REG_NONE = 0; // no registers @@ -480,7 +480,7 @@ class ElfBuilder FINAL { } abiflags_; }; - class BuildIdSection FINAL : public Section { + class BuildIdSection final : public Section { public: BuildIdSection(ElfBuilder* owner, const std::string& name, diff --git a/compiler/linker/error_delaying_output_stream.h b/compiler/linker/error_delaying_output_stream.h index 659f1dc093..cadd71c3f0 100644 --- a/compiler/linker/error_delaying_output_stream.h +++ b/compiler/linker/error_delaying_output_stream.h @@ -27,7 +27,7 @@ namespace art { namespace linker { // OutputStream wrapper that delays reporting an error until Flush(). -class ErrorDelayingOutputStream FINAL : public OutputStream { +class ErrorDelayingOutputStream final : public OutputStream { public: explicit ErrorDelayingOutputStream(OutputStream* output) : OutputStream(output->GetLocation()), @@ -37,7 +37,7 @@ class ErrorDelayingOutputStream FINAL : public OutputStream { // This function always succeeds to simplify code. // Use Good() to check the actual status of the output stream. - bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE { + bool WriteFully(const void* buffer, size_t byte_count) override { if (output_good_) { if (!output_->WriteFully(buffer, byte_count)) { PLOG(ERROR) << "Failed to write " << byte_count @@ -51,7 +51,7 @@ class ErrorDelayingOutputStream FINAL : public OutputStream { // This function always succeeds to simplify code. // Use Good() to check the actual status of the output stream. - off_t Seek(off_t offset, Whence whence) OVERRIDE { + off_t Seek(off_t offset, Whence whence) override { // We keep shadow copy of the offset so that we return // the expected value even if the output stream failed. off_t new_offset; @@ -81,7 +81,7 @@ class ErrorDelayingOutputStream FINAL : public OutputStream { // Flush the output and return whether all operations have succeeded. // Do nothing if we already have a pending error. - bool Flush() OVERRIDE { + bool Flush() override { if (output_good_) { output_good_ = output_->Flush(); } diff --git a/compiler/linker/file_output_stream.h b/compiler/linker/file_output_stream.h index deb051fca4..1417132981 100644 --- a/compiler/linker/file_output_stream.h +++ b/compiler/linker/file_output_stream.h @@ -24,17 +24,17 @@ namespace art { namespace linker { -class FileOutputStream FINAL : public OutputStream { +class FileOutputStream final : public OutputStream { public: explicit FileOutputStream(File* file); - ~FileOutputStream() OVERRIDE {} + ~FileOutputStream() override {} - bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE; + bool WriteFully(const void* buffer, size_t byte_count) override; - off_t Seek(off_t offset, Whence whence) OVERRIDE; + off_t Seek(off_t offset, Whence whence) override; - bool Flush() OVERRIDE; + bool Flush() override; private: File* const file_; diff --git a/compiler/linker/output_stream_test.cc b/compiler/linker/output_stream_test.cc index f93ea7a709..bcb129c2da 100644 --- a/compiler/linker/output_stream_test.cc +++ b/compiler/linker/output_stream_test.cc @@ -106,20 +106,20 @@ TEST_F(OutputStreamTest, BufferedFlush) { CheckingOutputStream() : OutputStream("dummy"), flush_called(false) { } - ~CheckingOutputStream() OVERRIDE {} + ~CheckingOutputStream() override {} bool WriteFully(const void* buffer ATTRIBUTE_UNUSED, - size_t byte_count ATTRIBUTE_UNUSED) OVERRIDE { + size_t byte_count ATTRIBUTE_UNUSED) override { LOG(FATAL) << "UNREACHABLE"; UNREACHABLE(); } - off_t Seek(off_t offset ATTRIBUTE_UNUSED, Whence whence ATTRIBUTE_UNUSED) OVERRIDE { + off_t Seek(off_t offset ATTRIBUTE_UNUSED, Whence whence ATTRIBUTE_UNUSED) override { LOG(FATAL) << "UNREACHABLE"; UNREACHABLE(); } - bool Flush() OVERRIDE { + bool Flush() override { flush_called = true; return true; } diff --git a/compiler/linker/vector_output_stream.h b/compiler/linker/vector_output_stream.h index 92caf596ab..0d34da6cba 100644 --- a/compiler/linker/vector_output_stream.h +++ b/compiler/linker/vector_output_stream.h @@ -26,13 +26,13 @@ namespace art { namespace linker { -class VectorOutputStream FINAL : public OutputStream { +class VectorOutputStream final : public OutputStream { public: VectorOutputStream(const std::string& location, std::vector* vector); - ~VectorOutputStream() OVERRIDE {} + ~VectorOutputStream() override {} - bool WriteFully(const void* buffer, size_t byte_count) OVERRIDE { + bool WriteFully(const void* buffer, size_t byte_count) override { if (static_cast(offset_) == vector_->size()) { const uint8_t* start = reinterpret_cast(buffer); vector_->insert(vector_->end(), &start[0], &start[byte_count]); @@ -46,9 +46,9 @@ class VectorOutputStream FINAL : public OutputStream { return true; } - off_t Seek(off_t offset, Whence whence) OVERRIDE; + off_t Seek(off_t offset, Whence whence) override; - bool Flush() OVERRIDE { + bool Flush() override { return true; } diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc index dfefa524bf..1c3660c0a7 100644 --- a/compiler/optimizing/bounds_check_elimination.cc +++ b/compiler/optimizing/bounds_check_elimination.cc @@ -388,10 +388,10 @@ class MonotonicValueRange : public ValueRange { return induction_variable_->GetBlock(); } - MonotonicValueRange* AsMonotonicValueRange() OVERRIDE { return this; } + MonotonicValueRange* AsMonotonicValueRange() override { return this; } // If it's certain that this value range fits in other_range. - bool FitsIn(ValueRange* other_range) const OVERRIDE { + bool FitsIn(ValueRange* other_range) const override { if (other_range == nullptr) { return true; } @@ -402,7 +402,7 @@ class MonotonicValueRange : public ValueRange { // Try to narrow this MonotonicValueRange given another range. // Ideally it will return a normal ValueRange. But due to // possible overflow/underflow, that may not be possible. - ValueRange* Narrow(ValueRange* range) OVERRIDE { + ValueRange* Narrow(ValueRange* range) override { if (range == nullptr) { return this; } @@ -530,7 +530,7 @@ class BCEVisitor : public HGraphVisitor { induction_range_(induction_analysis), next_(nullptr) {} - void VisitBasicBlock(HBasicBlock* block) OVERRIDE { + void VisitBasicBlock(HBasicBlock* block) override { DCHECK(!IsAddedBlock(block)); first_index_bounds_check_map_.clear(); // Visit phis and instructions using a safe iterator. The iteration protects @@ -820,7 +820,7 @@ class BCEVisitor : public HGraphVisitor { } } - void VisitBoundsCheck(HBoundsCheck* bounds_check) OVERRIDE { + void VisitBoundsCheck(HBoundsCheck* bounds_check) override { HBasicBlock* block = bounds_check->GetBlock(); HInstruction* index = bounds_check->InputAt(0); HInstruction* array_length = bounds_check->InputAt(1); @@ -945,7 +945,7 @@ class BCEVisitor : public HGraphVisitor { return true; } - void VisitPhi(HPhi* phi) OVERRIDE { + void VisitPhi(HPhi* phi) override { if (phi->IsLoopHeaderPhi() && (phi->GetType() == DataType::Type::kInt32) && HasSameInputAtBackEdges(phi)) { @@ -992,14 +992,14 @@ class BCEVisitor : public HGraphVisitor { } } - void VisitIf(HIf* instruction) OVERRIDE { + void VisitIf(HIf* instruction) override { if (instruction->InputAt(0)->IsCondition()) { HCondition* cond = instruction->InputAt(0)->AsCondition(); HandleIf(instruction, cond->GetLeft(), cond->GetRight(), cond->GetCondition()); } } - void VisitAdd(HAdd* add) OVERRIDE { + void VisitAdd(HAdd* add) override { HInstruction* right = add->GetRight(); if (right->IsIntConstant()) { ValueRange* left_range = LookupValueRange(add->GetLeft(), add->GetBlock()); @@ -1013,7 +1013,7 @@ class BCEVisitor : public HGraphVisitor { } } - void VisitSub(HSub* sub) OVERRIDE { + void VisitSub(HSub* sub) override { HInstruction* left = sub->GetLeft(); HInstruction* right = sub->GetRight(); if (right->IsIntConstant()) { @@ -1115,19 +1115,19 @@ class BCEVisitor : public HGraphVisitor { } } - void VisitDiv(HDiv* div) OVERRIDE { + void VisitDiv(HDiv* div) override { FindAndHandlePartialArrayLength(div); } - void VisitShr(HShr* shr) OVERRIDE { + void VisitShr(HShr* shr) override { FindAndHandlePartialArrayLength(shr); } - void VisitUShr(HUShr* ushr) OVERRIDE { + void VisitUShr(HUShr* ushr) override { FindAndHandlePartialArrayLength(ushr); } - void VisitAnd(HAnd* instruction) OVERRIDE { + void VisitAnd(HAnd* instruction) override { if (instruction->GetRight()->IsIntConstant()) { int32_t constant = instruction->GetRight()->AsIntConstant()->GetValue(); if (constant > 0) { @@ -1142,7 +1142,7 @@ class BCEVisitor : public HGraphVisitor { } } - void VisitRem(HRem* instruction) OVERRIDE { + void VisitRem(HRem* instruction) override { HInstruction* left = instruction->GetLeft(); HInstruction* right = instruction->GetRight(); @@ -1202,7 +1202,7 @@ class BCEVisitor : public HGraphVisitor { } } - void VisitNewArray(HNewArray* new_array) OVERRIDE { + void VisitNewArray(HNewArray* new_array) override { HInstruction* len = new_array->GetLength(); if (!len->IsIntConstant()) { HInstruction *left; @@ -1240,7 +1240,7 @@ class BCEVisitor : public HGraphVisitor { * has occurred (see AddCompareWithDeoptimization()), since in those cases it would be * unsafe to hoist array references across their deoptimization instruction inside a loop. */ - void VisitArrayGet(HArrayGet* array_get) OVERRIDE { + void VisitArrayGet(HArrayGet* array_get) override { if (!has_dom_based_dynamic_bce_ && array_get->IsInLoop()) { HLoopInformation* loop = array_get->GetBlock()->GetLoopInformation(); if (loop->IsDefinedOutOfTheLoop(array_get->InputAt(0)) && diff --git a/compiler/optimizing/bounds_check_elimination.h b/compiler/optimizing/bounds_check_elimination.h index 92ab7984c8..ef08877daa 100644 --- a/compiler/optimizing/bounds_check_elimination.h +++ b/compiler/optimizing/bounds_check_elimination.h @@ -34,7 +34,7 @@ class BoundsCheckElimination : public HOptimization { side_effects_(side_effects), induction_analysis_(induction_analysis) {} - bool Run() OVERRIDE; + bool Run() override; static constexpr const char* kBoundsCheckEliminationPassName = "BCE"; diff --git a/compiler/optimizing/cha_guard_optimization.cc b/compiler/optimizing/cha_guard_optimization.cc index bdc395b52d..c6232ef661 100644 --- a/compiler/optimizing/cha_guard_optimization.cc +++ b/compiler/optimizing/cha_guard_optimization.cc @@ -44,9 +44,9 @@ class CHAGuardVisitor : HGraphVisitor { GetGraph()->SetNumberOfCHAGuards(0); } - void VisitShouldDeoptimizeFlag(HShouldDeoptimizeFlag* flag) OVERRIDE; + void VisitShouldDeoptimizeFlag(HShouldDeoptimizeFlag* flag) override; - void VisitBasicBlock(HBasicBlock* block) OVERRIDE; + void VisitBasicBlock(HBasicBlock* block) override; private: void RemoveGuard(HShouldDeoptimizeFlag* flag); diff --git a/compiler/optimizing/cha_guard_optimization.h b/compiler/optimizing/cha_guard_optimization.h index d2c5a344b7..440d51a969 100644 --- a/compiler/optimizing/cha_guard_optimization.h +++ b/compiler/optimizing/cha_guard_optimization.h @@ -30,7 +30,7 @@ class CHAGuardOptimization : public HOptimization { const char* name = kCHAGuardOptimizationPassName) : HOptimization(graph, name) {} - bool Run() OVERRIDE; + bool Run() override; static constexpr const char* kCHAGuardOptimizationPassName = "cha_guard_optimization"; diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc index a460f77132..d56f7aaca1 100644 --- a/compiler/optimizing/code_generator_arm64.cc +++ b/compiler/optimizing/code_generator_arm64.cc @@ -247,7 +247,7 @@ class BoundsCheckSlowPathARM64 : public SlowPathCodeARM64 { public: explicit BoundsCheckSlowPathARM64(HBoundsCheck* instruction) : SlowPathCodeARM64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorARM64* arm64_codegen = down_cast(codegen); @@ -273,9 +273,9 @@ class BoundsCheckSlowPathARM64 : public SlowPathCodeARM64 { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathARM64"; } + const char* GetDescription() const override { return "BoundsCheckSlowPathARM64"; } private: DISALLOW_COPY_AND_ASSIGN(BoundsCheckSlowPathARM64); @@ -285,16 +285,16 @@ class DivZeroCheckSlowPathARM64 : public SlowPathCodeARM64 { public: explicit DivZeroCheckSlowPathARM64(HDivZeroCheck* instruction) : SlowPathCodeARM64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARM64* arm64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); arm64_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathARM64"; } + const char* GetDescription() const override { return "DivZeroCheckSlowPathARM64"; } private: DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathARM64); @@ -308,7 +308,7 @@ class LoadClassSlowPathARM64 : public SlowPathCodeARM64 { DCHECK_EQ(instruction_->IsLoadClass(), cls_ == instruction_); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); const uint32_t dex_pc = instruction_->GetDexPc(); @@ -349,7 +349,7 @@ class LoadClassSlowPathARM64 : public SlowPathCodeARM64 { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathARM64"; } + const char* GetDescription() const override { return "LoadClassSlowPathARM64"; } private: // The class this slow path will load. @@ -363,7 +363,7 @@ class LoadStringSlowPathARM64 : public SlowPathCodeARM64 { explicit LoadStringSlowPathARM64(HLoadString* instruction) : SlowPathCodeARM64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg())); CodeGeneratorARM64* arm64_codegen = down_cast(codegen); @@ -384,7 +384,7 @@ class LoadStringSlowPathARM64 : public SlowPathCodeARM64 { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathARM64"; } + const char* GetDescription() const override { return "LoadStringSlowPathARM64"; } private: DISALLOW_COPY_AND_ASSIGN(LoadStringSlowPathARM64); @@ -394,7 +394,7 @@ class NullCheckSlowPathARM64 : public SlowPathCodeARM64 { public: explicit NullCheckSlowPathARM64(HNullCheck* instr) : SlowPathCodeARM64(instr) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARM64* arm64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); if (instruction_->CanThrowIntoCatchBlock()) { @@ -408,9 +408,9 @@ class NullCheckSlowPathARM64 : public SlowPathCodeARM64 { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathARM64"; } + const char* GetDescription() const override { return "NullCheckSlowPathARM64"; } private: DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathARM64); @@ -421,7 +421,7 @@ class SuspendCheckSlowPathARM64 : public SlowPathCodeARM64 { SuspendCheckSlowPathARM64(HSuspendCheck* instruction, HBasicBlock* successor) : SlowPathCodeARM64(instruction), successor_(successor) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorARM64* arm64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -445,7 +445,7 @@ class SuspendCheckSlowPathARM64 : public SlowPathCodeARM64 { return successor_; } - const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathARM64"; } + const char* GetDescription() const override { return "SuspendCheckSlowPathARM64"; } private: // If not null, the block to branch to after the suspend check. @@ -462,7 +462,7 @@ class TypeCheckSlowPathARM64 : public SlowPathCodeARM64 { TypeCheckSlowPathARM64(HInstruction* instruction, bool is_fatal) : SlowPathCodeARM64(instruction), is_fatal_(is_fatal) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DCHECK(instruction_->IsCheckCast() @@ -503,8 +503,8 @@ class TypeCheckSlowPathARM64 : public SlowPathCodeARM64 { } } - const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathARM64"; } - bool IsFatal() const OVERRIDE { return is_fatal_; } + const char* GetDescription() const override { return "TypeCheckSlowPathARM64"; } + bool IsFatal() const override { return is_fatal_; } private: const bool is_fatal_; @@ -517,7 +517,7 @@ class DeoptimizationSlowPathARM64 : public SlowPathCodeARM64 { explicit DeoptimizationSlowPathARM64(HDeoptimize* instruction) : SlowPathCodeARM64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARM64* arm64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); LocationSummary* locations = instruction_->GetLocations(); @@ -529,7 +529,7 @@ class DeoptimizationSlowPathARM64 : public SlowPathCodeARM64 { CheckEntrypointTypes(); } - const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathARM64"; } + const char* GetDescription() const override { return "DeoptimizationSlowPathARM64"; } private: DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathARM64); @@ -539,7 +539,7 @@ class ArraySetSlowPathARM64 : public SlowPathCodeARM64 { public: explicit ArraySetSlowPathARM64(HInstruction* instruction) : SlowPathCodeARM64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); @@ -570,7 +570,7 @@ class ArraySetSlowPathARM64 : public SlowPathCodeARM64 { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ArraySetSlowPathARM64"; } + const char* GetDescription() const override { return "ArraySetSlowPathARM64"; } private: DISALLOW_COPY_AND_ASSIGN(ArraySetSlowPathARM64); @@ -628,7 +628,7 @@ class ReadBarrierForHeapReferenceSlowPathARM64 : public SlowPathCodeARM64 { DCHECK(!obj.Equals(ref)) << "obj=" << obj << " ref=" << ref; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARM64* arm64_codegen = down_cast(codegen); LocationSummary* locations = instruction_->GetLocations(); DataType::Type type = DataType::Type::kReference; @@ -754,7 +754,7 @@ class ReadBarrierForHeapReferenceSlowPathARM64 : public SlowPathCodeARM64 { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForHeapReferenceSlowPathARM64"; } + const char* GetDescription() const override { return "ReadBarrierForHeapReferenceSlowPathARM64"; } private: Register FindAvailableCallerSaveRegister(CodeGenerator* codegen) { @@ -794,7 +794,7 @@ class ReadBarrierForRootSlowPathARM64 : public SlowPathCodeARM64 { DCHECK(kEmitCompilerReadBarrier); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DataType::Type type = DataType::Type::kReference; DCHECK(locations->CanCall()); @@ -831,7 +831,7 @@ class ReadBarrierForRootSlowPathARM64 : public SlowPathCodeARM64 { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForRootSlowPathARM64"; } + const char* GetDescription() const override { return "ReadBarrierForRootSlowPathARM64"; } private: const Location out_; diff --git a/compiler/optimizing/code_generator_arm64.h b/compiler/optimizing/code_generator_arm64.h index 4f6a44fe4d..2e7a20b553 100644 --- a/compiler/optimizing/code_generator_arm64.h +++ b/compiler/optimizing/code_generator_arm64.h @@ -125,8 +125,8 @@ class SlowPathCodeARM64 : public SlowPathCode { vixl::aarch64::Label* GetEntryLabel() { return &entry_label_; } vixl::aarch64::Label* GetExitLabel() { return &exit_label_; } - void SaveLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) OVERRIDE; - void RestoreLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) OVERRIDE; + void SaveLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) override; + void RestoreLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) override; private: vixl::aarch64::Label entry_label_; @@ -216,11 +216,11 @@ class InvokeDexCallingConventionVisitorARM64 : public InvokeDexCallingConvention InvokeDexCallingConventionVisitorARM64() {} virtual ~InvokeDexCallingConventionVisitorARM64() {} - Location GetNextLocation(DataType::Type type) OVERRIDE; - Location GetReturnLocation(DataType::Type return_type) const OVERRIDE { + Location GetNextLocation(DataType::Type type) override; + Location GetReturnLocation(DataType::Type return_type) const override { return calling_convention.GetReturnLocation(return_type); } - Location GetMethodLocation() const OVERRIDE; + Location GetMethodLocation() const override; private: InvokeDexCallingConvention calling_convention; @@ -232,22 +232,22 @@ class FieldAccessCallingConventionARM64 : public FieldAccessCallingConvention { public: FieldAccessCallingConventionARM64() {} - Location GetObjectLocation() const OVERRIDE { + Location GetObjectLocation() const override { return helpers::LocationFrom(vixl::aarch64::x1); } - Location GetFieldIndexLocation() const OVERRIDE { + Location GetFieldIndexLocation() const override { return helpers::LocationFrom(vixl::aarch64::x0); } - Location GetReturnLocation(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { + Location GetReturnLocation(DataType::Type type ATTRIBUTE_UNUSED) const override { return helpers::LocationFrom(vixl::aarch64::x0); } Location GetSetValueLocation(DataType::Type type ATTRIBUTE_UNUSED, - bool is_instance) const OVERRIDE { + bool is_instance) const override { return is_instance ? helpers::LocationFrom(vixl::aarch64::x2) : helpers::LocationFrom(vixl::aarch64::x1); } - Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { + Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const override { return helpers::LocationFrom(vixl::aarch64::d0); } @@ -260,7 +260,7 @@ class InstructionCodeGeneratorARM64 : public InstructionCodeGenerator { InstructionCodeGeneratorARM64(HGraph* graph, CodeGeneratorARM64* codegen); #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_ARM64(DECLARE_VISIT_INSTRUCTION) @@ -268,7 +268,7 @@ class InstructionCodeGeneratorARM64 : public InstructionCodeGenerator { #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -360,7 +360,7 @@ class LocationsBuilderARM64 : public HGraphVisitor { : HGraphVisitor(graph), codegen_(codegen) {} #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_ARM64(DECLARE_VISIT_INSTRUCTION) @@ -368,7 +368,7 @@ class LocationsBuilderARM64 : public HGraphVisitor { #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -393,11 +393,11 @@ class ParallelMoveResolverARM64 : public ParallelMoveResolverNoSwap { : ParallelMoveResolverNoSwap(allocator), codegen_(codegen), vixl_temps_() {} protected: - void PrepareForEmitNativeCode() OVERRIDE; - void FinishEmitNativeCode() OVERRIDE; - Location AllocateScratchLocationFor(Location::Kind kind) OVERRIDE; - void FreeScratchLocation(Location loc) OVERRIDE; - void EmitMove(size_t index) OVERRIDE; + void PrepareForEmitNativeCode() override; + void FinishEmitNativeCode() override; + Location AllocateScratchLocationFor(Location::Kind kind) override; + void FreeScratchLocation(Location loc) override; + void EmitMove(size_t index) override; private: Arm64Assembler* GetAssembler() const; @@ -418,39 +418,39 @@ class CodeGeneratorARM64 : public CodeGenerator { OptimizingCompilerStats* stats = nullptr); virtual ~CodeGeneratorARM64() {} - void GenerateFrameEntry() OVERRIDE; - void GenerateFrameExit() OVERRIDE; + void GenerateFrameEntry() override; + void GenerateFrameExit() override; vixl::aarch64::CPURegList GetFramePreservedCoreRegisters() const; vixl::aarch64::CPURegList GetFramePreservedFPRegisters() const; - void Bind(HBasicBlock* block) OVERRIDE; + void Bind(HBasicBlock* block) override; vixl::aarch64::Label* GetLabelOf(HBasicBlock* block) { block = FirstNonEmptyBlock(block); return &(block_labels_[block->GetBlockId()]); } - size_t GetWordSize() const OVERRIDE { + size_t GetWordSize() const override { return kArm64WordSize; } - size_t GetFloatingPointSpillSlotSize() const OVERRIDE { + size_t GetFloatingPointSpillSlotSize() const override { return GetGraph()->HasSIMD() ? 2 * kArm64WordSize // 16 bytes == 2 arm64 words for each spill : 1 * kArm64WordSize; // 8 bytes == 1 arm64 words for each spill } - uintptr_t GetAddressOf(HBasicBlock* block) OVERRIDE { + uintptr_t GetAddressOf(HBasicBlock* block) override { vixl::aarch64::Label* block_entry_label = GetLabelOf(block); DCHECK(block_entry_label->IsBound()); return block_entry_label->GetLocation(); } - HGraphVisitor* GetLocationBuilder() OVERRIDE { return &location_builder_; } - HGraphVisitor* GetInstructionVisitor() OVERRIDE { return &instruction_visitor_; } - Arm64Assembler* GetAssembler() OVERRIDE { return &assembler_; } - const Arm64Assembler& GetAssembler() const OVERRIDE { return assembler_; } + HGraphVisitor* GetLocationBuilder() override { return &location_builder_; } + HGraphVisitor* GetInstructionVisitor() override { return &instruction_visitor_; } + Arm64Assembler* GetAssembler() override { return &assembler_; } + const Arm64Assembler& GetAssembler() const override { return assembler_; } vixl::aarch64::MacroAssembler* GetVIXLAssembler() { return GetAssembler()->GetVIXLAssembler(); } // Emit a write barrier. @@ -462,12 +462,12 @@ class CodeGeneratorARM64 : public CodeGenerator { // Register allocation. - void SetupBlockedRegisters() const OVERRIDE; + void SetupBlockedRegisters() const override; - size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; + size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; // The number of registers that can be allocated. The register allocator may // decide to reserve and not use a few of them. @@ -479,35 +479,35 @@ class CodeGeneratorARM64 : public CodeGenerator { static const int kNumberOfAllocatableFPRegisters = vixl::aarch64::kNumberOfFPRegisters; static constexpr int kNumberOfAllocatableRegisterPairs = 0; - void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE; - void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE; + void DumpCoreRegister(std::ostream& stream, int reg) const override; + void DumpFloatingPointRegister(std::ostream& stream, int reg) const override; - InstructionSet GetInstructionSet() const OVERRIDE { + InstructionSet GetInstructionSet() const override { return InstructionSet::kArm64; } const Arm64InstructionSetFeatures& GetInstructionSetFeatures() const; - void Initialize() OVERRIDE { + void Initialize() override { block_labels_.resize(GetGraph()->GetBlocks().size()); } // We want to use the STP and LDP instructions to spill and restore registers for slow paths. // These instructions can only encode offsets that are multiples of the register size accessed. - uint32_t GetPreferredSlotsAlignment() const OVERRIDE { return vixl::aarch64::kXRegSizeInBytes; } + uint32_t GetPreferredSlotsAlignment() const override { return vixl::aarch64::kXRegSizeInBytes; } JumpTableARM64* CreateJumpTable(HPackedSwitch* switch_instr) { jump_tables_.emplace_back(new (GetGraph()->GetAllocator()) JumpTableARM64(switch_instr)); return jump_tables_.back().get(); } - void Finalize(CodeAllocator* allocator) OVERRIDE; + void Finalize(CodeAllocator* allocator) override; // Code generation helpers. void MoveConstant(vixl::aarch64::CPURegister destination, HConstant* constant); - void MoveConstant(Location destination, int32_t value) OVERRIDE; - void MoveLocation(Location dst, Location src, DataType::Type dst_type) OVERRIDE; - void AddLocationAsTemp(Location location, LocationSummary* locations) OVERRIDE; + void MoveConstant(Location destination, int32_t value) override; + void MoveLocation(Location dst, Location src, DataType::Type dst_type) override; + void AddLocationAsTemp(Location location, LocationSummary* locations) override; void Load(DataType::Type type, vixl::aarch64::CPURegister dst, @@ -529,7 +529,7 @@ class CodeGeneratorARM64 : public CodeGenerator { void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, uint32_t dex_pc, - SlowPathCode* slow_path = nullptr) OVERRIDE; + SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record // PC-related information in a stack map. @@ -537,35 +537,35 @@ class CodeGeneratorARM64 : public CodeGenerator { HInstruction* instruction, SlowPathCode* slow_path); - ParallelMoveResolverARM64* GetMoveResolver() OVERRIDE { return &move_resolver_; } + ParallelMoveResolverARM64* GetMoveResolver() override { return &move_resolver_; } - bool NeedsTwoRegisters(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { + bool NeedsTwoRegisters(DataType::Type type ATTRIBUTE_UNUSED) const override { return false; } // Check if the desired_string_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadString::LoadKind GetSupportedLoadStringKind( - HLoadString::LoadKind desired_string_load_kind) OVERRIDE; + HLoadString::LoadKind desired_string_load_kind) override; // Check if the desired_class_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadClass::LoadKind GetSupportedLoadClassKind( - HLoadClass::LoadKind desired_class_load_kind) OVERRIDE; + HLoadClass::LoadKind desired_class_load_kind) override; // Check if the desired_dispatch_info is supported. If it is, return it, // otherwise return a fall-back info that should be used instead. HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch( const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, - HInvokeStaticOrDirect* invoke) OVERRIDE; + HInvokeStaticOrDirect* invoke) override; void GenerateStaticOrDirectCall( - HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void GenerateVirtualCall( - HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void MoveFromReturnRegister(Location trg ATTRIBUTE_UNUSED, - DataType::Type type ATTRIBUTE_UNUSED) OVERRIDE { + DataType::Type type ATTRIBUTE_UNUSED) override { UNIMPLEMENTED(FATAL); } @@ -652,13 +652,13 @@ class CodeGeneratorARM64 : public CodeGenerator { void LoadBootImageAddress(vixl::aarch64::Register reg, uint32_t boot_image_reference); void AllocateInstanceForIntrinsic(HInvokeStaticOrDirect* invoke, uint32_t boot_image_offset); - void EmitLinkerPatches(ArenaVector* linker_patches) OVERRIDE; - bool NeedsThunkCode(const linker::LinkerPatch& patch) const OVERRIDE; + void EmitLinkerPatches(ArenaVector* linker_patches) override; + bool NeedsThunkCode(const linker::LinkerPatch& patch) const override; void EmitThunkCode(const linker::LinkerPatch& patch, /*out*/ ArenaVector* code, - /*out*/ std::string* debug_name) OVERRIDE; + /*out*/ std::string* debug_name) override; - void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) OVERRIDE; + void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) override; // Generate a GC root reference load: // @@ -765,10 +765,10 @@ class CodeGeneratorARM64 : public CodeGenerator { // artReadBarrierForRootSlow. void GenerateReadBarrierForRootSlow(HInstruction* instruction, Location out, Location root); - void GenerateNop() OVERRIDE; + void GenerateNop() override; - void GenerateImplicitNullCheck(HNullCheck* instruction) OVERRIDE; - void GenerateExplicitNullCheck(HNullCheck* instruction) OVERRIDE; + void GenerateImplicitNullCheck(HNullCheck* instruction) override; + void GenerateExplicitNullCheck(HNullCheck* instruction) override; private: // Encoding of thunk type and data for link-time generated thunks for Baker read barriers. diff --git a/compiler/optimizing/code_generator_arm_vixl.cc b/compiler/optimizing/code_generator_arm_vixl.cc index 8c5eafd0bb..3580975c62 100644 --- a/compiler/optimizing/code_generator_arm_vixl.cc +++ b/compiler/optimizing/code_generator_arm_vixl.cc @@ -383,7 +383,7 @@ class NullCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { public: explicit NullCheckSlowPathARMVIXL(HNullCheck* instruction) : SlowPathCodeARMVIXL(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); if (instruction_->CanThrowIntoCatchBlock()) { @@ -397,9 +397,9 @@ class NullCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathARMVIXL"; } + const char* GetDescription() const override { return "NullCheckSlowPathARMVIXL"; } private: DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathARMVIXL); @@ -410,16 +410,16 @@ class DivZeroCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { explicit DivZeroCheckSlowPathARMVIXL(HDivZeroCheck* instruction) : SlowPathCodeARMVIXL(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); arm_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathARMVIXL"; } + const char* GetDescription() const override { return "DivZeroCheckSlowPathARMVIXL"; } private: DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathARMVIXL); @@ -430,7 +430,7 @@ class SuspendCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { SuspendCheckSlowPathARMVIXL(HSuspendCheck* instruction, HBasicBlock* successor) : SlowPathCodeARMVIXL(instruction), successor_(successor) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); arm_codegen->InvokeRuntime(kQuickTestSuspend, instruction_, instruction_->GetDexPc(), this); @@ -451,7 +451,7 @@ class SuspendCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { return successor_; } - const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathARMVIXL"; } + const char* GetDescription() const override { return "SuspendCheckSlowPathARMVIXL"; } private: // If not null, the block to branch to after the suspend check. @@ -468,7 +468,7 @@ class BoundsCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { explicit BoundsCheckSlowPathARMVIXL(HBoundsCheck* instruction) : SlowPathCodeARMVIXL(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast(codegen); LocationSummary* locations = instruction_->GetLocations(); @@ -495,9 +495,9 @@ class BoundsCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathARMVIXL"; } + const char* GetDescription() const override { return "BoundsCheckSlowPathARMVIXL"; } private: DISALLOW_COPY_AND_ASSIGN(BoundsCheckSlowPathARMVIXL); @@ -511,7 +511,7 @@ class LoadClassSlowPathARMVIXL : public SlowPathCodeARMVIXL { DCHECK_EQ(instruction_->IsLoadClass(), cls_ == instruction_); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); const uint32_t dex_pc = instruction_->GetDexPc(); @@ -549,7 +549,7 @@ class LoadClassSlowPathARMVIXL : public SlowPathCodeARMVIXL { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathARMVIXL"; } + const char* GetDescription() const override { return "LoadClassSlowPathARMVIXL"; } private: // The class this slow path will load. @@ -563,7 +563,7 @@ class LoadStringSlowPathARMVIXL : public SlowPathCodeARMVIXL { explicit LoadStringSlowPathARMVIXL(HLoadString* instruction) : SlowPathCodeARMVIXL(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { DCHECK(instruction_->IsLoadString()); DCHECK_EQ(instruction_->AsLoadString()->GetLoadKind(), HLoadString::LoadKind::kBssEntry); LocationSummary* locations = instruction_->GetLocations(); @@ -585,7 +585,7 @@ class LoadStringSlowPathARMVIXL : public SlowPathCodeARMVIXL { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathARMVIXL"; } + const char* GetDescription() const override { return "LoadStringSlowPathARMVIXL"; } private: DISALLOW_COPY_AND_ASSIGN(LoadStringSlowPathARMVIXL); @@ -596,7 +596,7 @@ class TypeCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { TypeCheckSlowPathARMVIXL(HInstruction* instruction, bool is_fatal) : SlowPathCodeARMVIXL(instruction), is_fatal_(is_fatal) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DCHECK(instruction_->IsCheckCast() || !locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg())); @@ -640,9 +640,9 @@ class TypeCheckSlowPathARMVIXL : public SlowPathCodeARMVIXL { } } - const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathARMVIXL"; } + const char* GetDescription() const override { return "TypeCheckSlowPathARMVIXL"; } - bool IsFatal() const OVERRIDE { return is_fatal_; } + bool IsFatal() const override { return is_fatal_; } private: const bool is_fatal_; @@ -655,7 +655,7 @@ class DeoptimizationSlowPathARMVIXL : public SlowPathCodeARMVIXL { explicit DeoptimizationSlowPathARMVIXL(HDeoptimize* instruction) : SlowPathCodeARMVIXL(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); LocationSummary* locations = instruction_->GetLocations(); @@ -668,7 +668,7 @@ class DeoptimizationSlowPathARMVIXL : public SlowPathCodeARMVIXL { CheckEntrypointTypes(); } - const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathARMVIXL"; } + const char* GetDescription() const override { return "DeoptimizationSlowPathARMVIXL"; } private: DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathARMVIXL); @@ -678,7 +678,7 @@ class ArraySetSlowPathARMVIXL : public SlowPathCodeARMVIXL { public: explicit ArraySetSlowPathARMVIXL(HInstruction* instruction) : SlowPathCodeARMVIXL(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); @@ -709,7 +709,7 @@ class ArraySetSlowPathARMVIXL : public SlowPathCodeARMVIXL { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ArraySetSlowPathARMVIXL"; } + const char* GetDescription() const override { return "ArraySetSlowPathARMVIXL"; } private: DISALLOW_COPY_AND_ASSIGN(ArraySetSlowPathARMVIXL); @@ -744,7 +744,7 @@ class ReadBarrierForHeapReferenceSlowPathARMVIXL : public SlowPathCodeARMVIXL { DCHECK(!obj.Equals(ref)) << "obj=" << obj << " ref=" << ref; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorARMVIXL* arm_codegen = down_cast(codegen); LocationSummary* locations = instruction_->GetLocations(); vixl32::Register reg_out = RegisterFrom(out_); @@ -868,7 +868,7 @@ class ReadBarrierForHeapReferenceSlowPathARMVIXL : public SlowPathCodeARMVIXL { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { + const char* GetDescription() const override { return "ReadBarrierForHeapReferenceSlowPathARMVIXL"; } @@ -910,7 +910,7 @@ class ReadBarrierForRootSlowPathARMVIXL : public SlowPathCodeARMVIXL { DCHECK(kEmitCompilerReadBarrier); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); vixl32::Register reg_out = RegisterFrom(out_); DCHECK(locations->CanCall()); @@ -936,7 +936,7 @@ class ReadBarrierForRootSlowPathARMVIXL : public SlowPathCodeARMVIXL { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForRootSlowPathARMVIXL"; } + const char* GetDescription() const override { return "ReadBarrierForRootSlowPathARMVIXL"; } private: const Location out_; diff --git a/compiler/optimizing/code_generator_arm_vixl.h b/compiler/optimizing/code_generator_arm_vixl.h index cb131a7ac1..33502d4f68 100644 --- a/compiler/optimizing/code_generator_arm_vixl.h +++ b/compiler/optimizing/code_generator_arm_vixl.h @@ -178,9 +178,9 @@ class InvokeDexCallingConventionVisitorARMVIXL : public InvokeDexCallingConventi InvokeDexCallingConventionVisitorARMVIXL() {} virtual ~InvokeDexCallingConventionVisitorARMVIXL() {} - Location GetNextLocation(DataType::Type type) OVERRIDE; - Location GetReturnLocation(DataType::Type type) const OVERRIDE; - Location GetMethodLocation() const OVERRIDE; + Location GetNextLocation(DataType::Type type) override; + Location GetReturnLocation(DataType::Type type) const override; + Location GetMethodLocation() const override; private: InvokeDexCallingConventionARMVIXL calling_convention; @@ -193,25 +193,25 @@ class FieldAccessCallingConventionARMVIXL : public FieldAccessCallingConvention public: FieldAccessCallingConventionARMVIXL() {} - Location GetObjectLocation() const OVERRIDE { + Location GetObjectLocation() const override { return helpers::LocationFrom(vixl::aarch32::r1); } - Location GetFieldIndexLocation() const OVERRIDE { + Location GetFieldIndexLocation() const override { return helpers::LocationFrom(vixl::aarch32::r0); } - Location GetReturnLocation(DataType::Type type) const OVERRIDE { + Location GetReturnLocation(DataType::Type type) const override { return DataType::Is64BitType(type) ? helpers::LocationFrom(vixl::aarch32::r0, vixl::aarch32::r1) : helpers::LocationFrom(vixl::aarch32::r0); } - Location GetSetValueLocation(DataType::Type type, bool is_instance) const OVERRIDE { + Location GetSetValueLocation(DataType::Type type, bool is_instance) const override { return DataType::Is64BitType(type) ? helpers::LocationFrom(vixl::aarch32::r2, vixl::aarch32::r3) : (is_instance ? helpers::LocationFrom(vixl::aarch32::r2) : helpers::LocationFrom(vixl::aarch32::r1)); } - Location GetFpuLocation(DataType::Type type) const OVERRIDE { + Location GetFpuLocation(DataType::Type type) const override { return DataType::Is64BitType(type) ? helpers::LocationFrom(vixl::aarch32::s0, vixl::aarch32::s1) : helpers::LocationFrom(vixl::aarch32::s0); @@ -229,8 +229,8 @@ class SlowPathCodeARMVIXL : public SlowPathCode { vixl::aarch32::Label* GetEntryLabel() { return &entry_label_; } vixl::aarch32::Label* GetExitLabel() { return &exit_label_; } - void SaveLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) OVERRIDE; - void RestoreLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) OVERRIDE; + void SaveLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) override; + void RestoreLiveRegisters(CodeGenerator* codegen, LocationSummary* locations) override; private: vixl::aarch32::Label entry_label_; @@ -244,10 +244,10 @@ class ParallelMoveResolverARMVIXL : public ParallelMoveResolverWithSwap { ParallelMoveResolverARMVIXL(ArenaAllocator* allocator, CodeGeneratorARMVIXL* codegen) : ParallelMoveResolverWithSwap(allocator), codegen_(codegen) {} - void EmitMove(size_t index) OVERRIDE; - void EmitSwap(size_t index) OVERRIDE; - void SpillScratch(int reg) OVERRIDE; - void RestoreScratch(int reg) OVERRIDE; + void EmitMove(size_t index) override; + void EmitSwap(size_t index) override; + void SpillScratch(int reg) override; + void RestoreScratch(int reg) override; ArmVIXLAssembler* GetAssembler() const; @@ -266,7 +266,7 @@ class LocationsBuilderARMVIXL : public HGraphVisitor { : HGraphVisitor(graph), codegen_(codegen) {} #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_ARM(DECLARE_VISIT_INSTRUCTION) @@ -274,7 +274,7 @@ class LocationsBuilderARMVIXL : public HGraphVisitor { #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -304,7 +304,7 @@ class InstructionCodeGeneratorARMVIXL : public InstructionCodeGenerator { InstructionCodeGeneratorARMVIXL(HGraph* graph, CodeGeneratorARMVIXL* codegen); #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_ARM(DECLARE_VISIT_INSTRUCTION) @@ -312,7 +312,7 @@ class InstructionCodeGeneratorARMVIXL : public InstructionCodeGenerator { #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -432,48 +432,48 @@ class CodeGeneratorARMVIXL : public CodeGenerator { OptimizingCompilerStats* stats = nullptr); virtual ~CodeGeneratorARMVIXL() {} - void GenerateFrameEntry() OVERRIDE; - void GenerateFrameExit() OVERRIDE; - void Bind(HBasicBlock* block) OVERRIDE; - void MoveConstant(Location destination, int32_t value) OVERRIDE; - void MoveLocation(Location dst, Location src, DataType::Type dst_type) OVERRIDE; - void AddLocationAsTemp(Location location, LocationSummary* locations) OVERRIDE; + void GenerateFrameEntry() override; + void GenerateFrameExit() override; + void Bind(HBasicBlock* block) override; + void MoveConstant(Location destination, int32_t value) override; + void MoveLocation(Location dst, Location src, DataType::Type dst_type) override; + void AddLocationAsTemp(Location location, LocationSummary* locations) override; - size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; + size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; - size_t GetWordSize() const OVERRIDE { + size_t GetWordSize() const override { return static_cast(kArmPointerSize); } - size_t GetFloatingPointSpillSlotSize() const OVERRIDE { return vixl::aarch32::kRegSizeInBytes; } + size_t GetFloatingPointSpillSlotSize() const override { return vixl::aarch32::kRegSizeInBytes; } - HGraphVisitor* GetLocationBuilder() OVERRIDE { return &location_builder_; } + HGraphVisitor* GetLocationBuilder() override { return &location_builder_; } - HGraphVisitor* GetInstructionVisitor() OVERRIDE { return &instruction_visitor_; } + HGraphVisitor* GetInstructionVisitor() override { return &instruction_visitor_; } - ArmVIXLAssembler* GetAssembler() OVERRIDE { return &assembler_; } + ArmVIXLAssembler* GetAssembler() override { return &assembler_; } - const ArmVIXLAssembler& GetAssembler() const OVERRIDE { return assembler_; } + const ArmVIXLAssembler& GetAssembler() const override { return assembler_; } ArmVIXLMacroAssembler* GetVIXLAssembler() { return GetAssembler()->GetVIXLAssembler(); } - uintptr_t GetAddressOf(HBasicBlock* block) OVERRIDE { + uintptr_t GetAddressOf(HBasicBlock* block) override { vixl::aarch32::Label* block_entry_label = GetLabelOf(block); DCHECK(block_entry_label->IsBound()); return block_entry_label->GetLocation(); } void FixJumpTables(); - void SetupBlockedRegisters() const OVERRIDE; + void SetupBlockedRegisters() const override; - void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE; - void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE; + void DumpCoreRegister(std::ostream& stream, int reg) const override; + void DumpFloatingPointRegister(std::ostream& stream, int reg) const override; - ParallelMoveResolver* GetMoveResolver() OVERRIDE { return &move_resolver_; } - InstructionSet GetInstructionSet() const OVERRIDE { return InstructionSet::kThumb2; } + ParallelMoveResolver* GetMoveResolver() override { return &move_resolver_; } + InstructionSet GetInstructionSet() const override { return InstructionSet::kThumb2; } const ArmInstructionSetFeatures& GetInstructionSetFeatures() const; @@ -495,7 +495,7 @@ class CodeGeneratorARMVIXL : public CodeGenerator { void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, uint32_t dex_pc, - SlowPathCode* slow_path = nullptr) OVERRIDE; + SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record // PC-related information in a stack map. @@ -519,42 +519,42 @@ class CodeGeneratorARMVIXL : public CodeGenerator { vixl32::Label* GetFinalLabel(HInstruction* instruction, vixl32::Label* final_label); - void Initialize() OVERRIDE { + void Initialize() override { block_labels_.resize(GetGraph()->GetBlocks().size()); } - void Finalize(CodeAllocator* allocator) OVERRIDE; + void Finalize(CodeAllocator* allocator) override; - bool NeedsTwoRegisters(DataType::Type type) const OVERRIDE { + bool NeedsTwoRegisters(DataType::Type type) const override { return type == DataType::Type::kFloat64 || type == DataType::Type::kInt64; } - void ComputeSpillMask() OVERRIDE; + void ComputeSpillMask() override; vixl::aarch32::Label* GetFrameEntryLabel() { return &frame_entry_label_; } // Check if the desired_string_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadString::LoadKind GetSupportedLoadStringKind( - HLoadString::LoadKind desired_string_load_kind) OVERRIDE; + HLoadString::LoadKind desired_string_load_kind) override; // Check if the desired_class_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadClass::LoadKind GetSupportedLoadClassKind( - HLoadClass::LoadKind desired_class_load_kind) OVERRIDE; + HLoadClass::LoadKind desired_class_load_kind) override; // Check if the desired_dispatch_info is supported. If it is, return it, // otherwise return a fall-back info that should be used instead. HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch( const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, - HInvokeStaticOrDirect* invoke) OVERRIDE; + HInvokeStaticOrDirect* invoke) override; void GenerateStaticOrDirectCall( - HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void GenerateVirtualCall( - HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; - void MoveFromReturnRegister(Location trg, DataType::Type type) OVERRIDE; + void MoveFromReturnRegister(Location trg, DataType::Type type) override; // The PcRelativePatchInfo is used for PC-relative addressing of methods/strings/types, // whether through .data.bimg.rel.ro, .bss, or directly in the boot image. @@ -604,13 +604,13 @@ class CodeGeneratorARMVIXL : public CodeGenerator { void LoadBootImageAddress(vixl::aarch32::Register reg, uint32_t boot_image_reference); void AllocateInstanceForIntrinsic(HInvokeStaticOrDirect* invoke, uint32_t boot_image_offset); - void EmitLinkerPatches(ArenaVector* linker_patches) OVERRIDE; - bool NeedsThunkCode(const linker::LinkerPatch& patch) const OVERRIDE; + void EmitLinkerPatches(ArenaVector* linker_patches) override; + bool NeedsThunkCode(const linker::LinkerPatch& patch) const override; void EmitThunkCode(const linker::LinkerPatch& patch, /*out*/ ArenaVector* code, - /*out*/ std::string* debug_name) OVERRIDE; + /*out*/ std::string* debug_name) override; - void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) OVERRIDE; + void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) override; // Generate a GC root reference load: // @@ -722,10 +722,10 @@ class CodeGeneratorARMVIXL : public CodeGenerator { // artReadBarrierForRootSlow. void GenerateReadBarrierForRootSlow(HInstruction* instruction, Location out, Location root); - void GenerateNop() OVERRIDE; + void GenerateNop() override; - void GenerateImplicitNullCheck(HNullCheck* instruction) OVERRIDE; - void GenerateExplicitNullCheck(HNullCheck* instruction) OVERRIDE; + void GenerateImplicitNullCheck(HNullCheck* instruction) override; + void GenerateExplicitNullCheck(HNullCheck* instruction) override; JumpTableARMVIXL* CreateJumpTable(HPackedSwitch* switch_instr) { jump_tables_.emplace_back(new (GetGraph()->GetAllocator()) JumpTableARMVIXL(switch_instr)); diff --git a/compiler/optimizing/code_generator_mips.cc b/compiler/optimizing/code_generator_mips.cc index aed334b024..d74a7a760f 100644 --- a/compiler/optimizing/code_generator_mips.cc +++ b/compiler/optimizing/code_generator_mips.cc @@ -176,7 +176,7 @@ class BoundsCheckSlowPathMIPS : public SlowPathCodeMIPS { public: explicit BoundsCheckSlowPathMIPS(HBoundsCheck* instruction) : SlowPathCodeMIPS(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorMIPS* mips_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -201,9 +201,9 @@ class BoundsCheckSlowPathMIPS : public SlowPathCodeMIPS { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathMIPS"; } + const char* GetDescription() const override { return "BoundsCheckSlowPathMIPS"; } private: DISALLOW_COPY_AND_ASSIGN(BoundsCheckSlowPathMIPS); @@ -213,16 +213,16 @@ class DivZeroCheckSlowPathMIPS : public SlowPathCodeMIPS { public: explicit DivZeroCheckSlowPathMIPS(HDivZeroCheck* instruction) : SlowPathCodeMIPS(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS* mips_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); mips_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathMIPS"; } + const char* GetDescription() const override { return "DivZeroCheckSlowPathMIPS"; } private: DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathMIPS); @@ -236,7 +236,7 @@ class LoadClassSlowPathMIPS : public SlowPathCodeMIPS { DCHECK_EQ(instruction_->IsLoadClass(), cls_ == instruction_); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); const uint32_t dex_pc = instruction_->GetDexPc(); @@ -280,7 +280,7 @@ class LoadClassSlowPathMIPS : public SlowPathCodeMIPS { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathMIPS"; } + const char* GetDescription() const override { return "LoadClassSlowPathMIPS"; } private: // The class this slow path will load. @@ -294,7 +294,7 @@ class LoadStringSlowPathMIPS : public SlowPathCodeMIPS { explicit LoadStringSlowPathMIPS(HLoadString* instruction) : SlowPathCodeMIPS(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { DCHECK(instruction_->IsLoadString()); DCHECK_EQ(instruction_->AsLoadString()->GetLoadKind(), HLoadString::LoadKind::kBssEntry); LocationSummary* locations = instruction_->GetLocations(); @@ -318,7 +318,7 @@ class LoadStringSlowPathMIPS : public SlowPathCodeMIPS { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathMIPS"; } + const char* GetDescription() const override { return "LoadStringSlowPathMIPS"; } private: DISALLOW_COPY_AND_ASSIGN(LoadStringSlowPathMIPS); @@ -328,7 +328,7 @@ class NullCheckSlowPathMIPS : public SlowPathCodeMIPS { public: explicit NullCheckSlowPathMIPS(HNullCheck* instr) : SlowPathCodeMIPS(instr) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS* mips_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); if (instruction_->CanThrowIntoCatchBlock()) { @@ -342,9 +342,9 @@ class NullCheckSlowPathMIPS : public SlowPathCodeMIPS { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathMIPS"; } + const char* GetDescription() const override { return "NullCheckSlowPathMIPS"; } private: DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathMIPS); @@ -355,7 +355,7 @@ class SuspendCheckSlowPathMIPS : public SlowPathCodeMIPS { SuspendCheckSlowPathMIPS(HSuspendCheck* instruction, HBasicBlock* successor) : SlowPathCodeMIPS(instruction), successor_(successor) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorMIPS* mips_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -375,7 +375,7 @@ class SuspendCheckSlowPathMIPS : public SlowPathCodeMIPS { return &return_label_; } - const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathMIPS"; } + const char* GetDescription() const override { return "SuspendCheckSlowPathMIPS"; } HBasicBlock* GetSuccessor() const { return successor_; @@ -396,7 +396,7 @@ class TypeCheckSlowPathMIPS : public SlowPathCodeMIPS { explicit TypeCheckSlowPathMIPS(HInstruction* instruction, bool is_fatal) : SlowPathCodeMIPS(instruction), is_fatal_(is_fatal) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); uint32_t dex_pc = instruction_->GetDexPc(); DCHECK(instruction_->IsCheckCast() @@ -435,9 +435,9 @@ class TypeCheckSlowPathMIPS : public SlowPathCodeMIPS { } } - const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathMIPS"; } + const char* GetDescription() const override { return "TypeCheckSlowPathMIPS"; } - bool IsFatal() const OVERRIDE { return is_fatal_; } + bool IsFatal() const override { return is_fatal_; } private: const bool is_fatal_; @@ -450,7 +450,7 @@ class DeoptimizationSlowPathMIPS : public SlowPathCodeMIPS { explicit DeoptimizationSlowPathMIPS(HDeoptimize* instruction) : SlowPathCodeMIPS(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS* mips_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); LocationSummary* locations = instruction_->GetLocations(); @@ -462,7 +462,7 @@ class DeoptimizationSlowPathMIPS : public SlowPathCodeMIPS { CheckEntrypointTypes(); } - const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathMIPS"; } + const char* GetDescription() const override { return "DeoptimizationSlowPathMIPS"; } private: DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathMIPS); @@ -472,7 +472,7 @@ class ArraySetSlowPathMIPS : public SlowPathCodeMIPS { public: explicit ArraySetSlowPathMIPS(HInstruction* instruction) : SlowPathCodeMIPS(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); @@ -503,7 +503,7 @@ class ArraySetSlowPathMIPS : public SlowPathCodeMIPS { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ArraySetSlowPathMIPS"; } + const char* GetDescription() const override { return "ArraySetSlowPathMIPS"; } private: DISALLOW_COPY_AND_ASSIGN(ArraySetSlowPathMIPS); @@ -533,9 +533,9 @@ class ReadBarrierMarkSlowPathMIPS : public SlowPathCodeMIPS { DCHECK(kEmitCompilerReadBarrier); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierMarkSlowPathMIPS"; } + const char* GetDescription() const override { return "ReadBarrierMarkSlowPathMIPS"; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Register ref_reg = ref_.AsRegister(); DCHECK(locations->CanCall()); @@ -627,11 +627,11 @@ class ReadBarrierMarkAndUpdateFieldSlowPathMIPS : public SlowPathCodeMIPS { DCHECK(kEmitCompilerReadBarrier); } - const char* GetDescription() const OVERRIDE { + const char* GetDescription() const override { return "ReadBarrierMarkAndUpdateFieldSlowPathMIPS"; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Register ref_reg = ref_.AsRegister(); DCHECK(locations->CanCall()); @@ -798,7 +798,7 @@ class ReadBarrierForHeapReferenceSlowPathMIPS : public SlowPathCodeMIPS { DCHECK(!obj.Equals(ref)) << "obj=" << obj << " ref=" << ref; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS* mips_codegen = down_cast(codegen); LocationSummary* locations = instruction_->GetLocations(); Register reg_out = out_.AsRegister(); @@ -922,7 +922,7 @@ class ReadBarrierForHeapReferenceSlowPathMIPS : public SlowPathCodeMIPS { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForHeapReferenceSlowPathMIPS"; } + const char* GetDescription() const override { return "ReadBarrierForHeapReferenceSlowPathMIPS"; } private: Register FindAvailableCallerSaveRegister(CodeGenerator* codegen) { @@ -965,7 +965,7 @@ class ReadBarrierForRootSlowPathMIPS : public SlowPathCodeMIPS { DCHECK(kEmitCompilerReadBarrier); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Register reg_out = out_.AsRegister(); DCHECK(locations->CanCall()); @@ -995,7 +995,7 @@ class ReadBarrierForRootSlowPathMIPS : public SlowPathCodeMIPS { __ B(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForRootSlowPathMIPS"; } + const char* GetDescription() const override { return "ReadBarrierForRootSlowPathMIPS"; } private: const Location out_; diff --git a/compiler/optimizing/code_generator_mips.h b/compiler/optimizing/code_generator_mips.h index 4830ac9bc6..bf9589331b 100644 --- a/compiler/optimizing/code_generator_mips.h +++ b/compiler/optimizing/code_generator_mips.h @@ -81,9 +81,9 @@ class InvokeDexCallingConventionVisitorMIPS : public InvokeDexCallingConventionV InvokeDexCallingConventionVisitorMIPS() {} virtual ~InvokeDexCallingConventionVisitorMIPS() {} - Location GetNextLocation(DataType::Type type) OVERRIDE; - Location GetReturnLocation(DataType::Type type) const OVERRIDE; - Location GetMethodLocation() const OVERRIDE; + Location GetNextLocation(DataType::Type type) override; + Location GetReturnLocation(DataType::Type type) const override; + Location GetMethodLocation() const override; private: InvokeDexCallingConvention calling_convention; @@ -110,23 +110,23 @@ class FieldAccessCallingConventionMIPS : public FieldAccessCallingConvention { public: FieldAccessCallingConventionMIPS() {} - Location GetObjectLocation() const OVERRIDE { + Location GetObjectLocation() const override { return Location::RegisterLocation(A1); } - Location GetFieldIndexLocation() const OVERRIDE { + Location GetFieldIndexLocation() const override { return Location::RegisterLocation(A0); } - Location GetReturnLocation(DataType::Type type) const OVERRIDE { + Location GetReturnLocation(DataType::Type type) const override { return DataType::Is64BitType(type) ? Location::RegisterPairLocation(V0, V1) : Location::RegisterLocation(V0); } - Location GetSetValueLocation(DataType::Type type, bool is_instance) const OVERRIDE { + Location GetSetValueLocation(DataType::Type type, bool is_instance) const override { return DataType::Is64BitType(type) ? Location::RegisterPairLocation(A2, A3) : (is_instance ? Location::RegisterLocation(A2) : Location::RegisterLocation(A1)); } - Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { + Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const override { return Location::FpuRegisterLocation(F0); } @@ -139,10 +139,10 @@ class ParallelMoveResolverMIPS : public ParallelMoveResolverWithSwap { ParallelMoveResolverMIPS(ArenaAllocator* allocator, CodeGeneratorMIPS* codegen) : ParallelMoveResolverWithSwap(allocator), codegen_(codegen) {} - void EmitMove(size_t index) OVERRIDE; - void EmitSwap(size_t index) OVERRIDE; - void SpillScratch(int reg) OVERRIDE; - void RestoreScratch(int reg) OVERRIDE; + void EmitMove(size_t index) override; + void EmitSwap(size_t index) override; + void SpillScratch(int reg) override; + void RestoreScratch(int reg) override; void Exchange(int index1, int index2, bool double_slot); void ExchangeQuadSlots(int index1, int index2); @@ -176,14 +176,14 @@ class LocationsBuilderMIPS : public HGraphVisitor { : HGraphVisitor(graph), codegen_(codegen) {} #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_MIPS(DECLARE_VISIT_INSTRUCTION) #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -210,14 +210,14 @@ class InstructionCodeGeneratorMIPS : public InstructionCodeGenerator { InstructionCodeGeneratorMIPS(HGraph* graph, CodeGeneratorMIPS* codegen); #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_MIPS(DECLARE_VISIT_INSTRUCTION) #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -374,35 +374,35 @@ class CodeGeneratorMIPS : public CodeGenerator { OptimizingCompilerStats* stats = nullptr); virtual ~CodeGeneratorMIPS() {} - void ComputeSpillMask() OVERRIDE; - bool HasAllocatedCalleeSaveRegisters() const OVERRIDE; - void GenerateFrameEntry() OVERRIDE; - void GenerateFrameExit() OVERRIDE; + void ComputeSpillMask() override; + bool HasAllocatedCalleeSaveRegisters() const override; + void GenerateFrameEntry() override; + void GenerateFrameExit() override; - void Bind(HBasicBlock* block) OVERRIDE; + void Bind(HBasicBlock* block) override; void MoveConstant(Location location, HConstant* c); - size_t GetWordSize() const OVERRIDE { return kMipsWordSize; } + size_t GetWordSize() const override { return kMipsWordSize; } - size_t GetFloatingPointSpillSlotSize() const OVERRIDE { + size_t GetFloatingPointSpillSlotSize() const override { return GetGraph()->HasSIMD() ? 2 * kMipsDoublewordSize // 16 bytes for each spill. : 1 * kMipsDoublewordSize; // 8 bytes for each spill. } - uintptr_t GetAddressOf(HBasicBlock* block) OVERRIDE { + uintptr_t GetAddressOf(HBasicBlock* block) override { return assembler_.GetLabelLocation(GetLabelOf(block)); } - HGraphVisitor* GetLocationBuilder() OVERRIDE { return &location_builder_; } - HGraphVisitor* GetInstructionVisitor() OVERRIDE { return &instruction_visitor_; } - MipsAssembler* GetAssembler() OVERRIDE { return &assembler_; } - const MipsAssembler& GetAssembler() const OVERRIDE { return assembler_; } + HGraphVisitor* GetLocationBuilder() override { return &location_builder_; } + HGraphVisitor* GetInstructionVisitor() override { return &instruction_visitor_; } + MipsAssembler* GetAssembler() override { return &assembler_; } + const MipsAssembler& GetAssembler() const override { return assembler_; } // Emit linker patches. - void EmitLinkerPatches(ArenaVector* linker_patches) OVERRIDE; - void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) OVERRIDE; + void EmitLinkerPatches(ArenaVector* linker_patches) override; + void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) override; // Fast path implementation of ReadBarrier::Barrier for a heap // reference field load when Baker's read barriers are used. @@ -493,20 +493,20 @@ class CodeGeneratorMIPS : public CodeGenerator { // Register allocation. - void SetupBlockedRegisters() const OVERRIDE; + void SetupBlockedRegisters() const override; - size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; + size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; void ClobberRA() { clobbered_ra_ = true; } - void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE; - void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE; + void DumpCoreRegister(std::ostream& stream, int reg) const override; + void DumpFloatingPointRegister(std::ostream& stream, int reg) const override; - InstructionSet GetInstructionSet() const OVERRIDE { return InstructionSet::kMips; } + InstructionSet GetInstructionSet() const override { return InstructionSet::kMips; } const MipsInstructionSetFeatures& GetInstructionSetFeatures() const; @@ -514,25 +514,25 @@ class CodeGeneratorMIPS : public CodeGenerator { return CommonGetLabelOf(block_labels_, block); } - void Initialize() OVERRIDE { + void Initialize() override { block_labels_ = CommonInitializeLabels(); } - void Finalize(CodeAllocator* allocator) OVERRIDE; + void Finalize(CodeAllocator* allocator) override; // Code generation helpers. - void MoveLocation(Location dst, Location src, DataType::Type dst_type) OVERRIDE; + void MoveLocation(Location dst, Location src, DataType::Type dst_type) override; - void MoveConstant(Location destination, int32_t value) OVERRIDE; + void MoveConstant(Location destination, int32_t value) override; - void AddLocationAsTemp(Location location, LocationSummary* locations) OVERRIDE; + void AddLocationAsTemp(Location location, LocationSummary* locations) override; // Generate code to invoke a runtime entry point. void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, uint32_t dex_pc, - SlowPathCode* slow_path = nullptr) OVERRIDE; + SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record // PC-related information in a stack map. @@ -543,41 +543,41 @@ class CodeGeneratorMIPS : public CodeGenerator { void GenerateInvokeRuntime(int32_t entry_point_offset, bool direct); - ParallelMoveResolver* GetMoveResolver() OVERRIDE { return &move_resolver_; } + ParallelMoveResolver* GetMoveResolver() override { return &move_resolver_; } - bool NeedsTwoRegisters(DataType::Type type) const OVERRIDE { + bool NeedsTwoRegisters(DataType::Type type) const override { return type == DataType::Type::kInt64; } // Check if the desired_string_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadString::LoadKind GetSupportedLoadStringKind( - HLoadString::LoadKind desired_string_load_kind) OVERRIDE; + HLoadString::LoadKind desired_string_load_kind) override; // Check if the desired_class_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadClass::LoadKind GetSupportedLoadClassKind( - HLoadClass::LoadKind desired_class_load_kind) OVERRIDE; + HLoadClass::LoadKind desired_class_load_kind) override; // Check if the desired_dispatch_info is supported. If it is, return it, // otherwise return a fall-back info that should be used instead. HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch( const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, - HInvokeStaticOrDirect* invoke) OVERRIDE; + HInvokeStaticOrDirect* invoke) override; void GenerateStaticOrDirectCall( - HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void GenerateVirtualCall( - HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void MoveFromReturnRegister(Location trg ATTRIBUTE_UNUSED, - DataType::Type type ATTRIBUTE_UNUSED) OVERRIDE { + DataType::Type type ATTRIBUTE_UNUSED) override { UNIMPLEMENTED(FATAL) << "Not implemented on MIPS"; } - void GenerateNop() OVERRIDE; - void GenerateImplicitNullCheck(HNullCheck* instruction) OVERRIDE; - void GenerateExplicitNullCheck(HNullCheck* instruction) OVERRIDE; + void GenerateNop() override; + void GenerateImplicitNullCheck(HNullCheck* instruction) override; + void GenerateExplicitNullCheck(HNullCheck* instruction) override; // The PcRelativePatchInfo is used for PC-relative addressing of methods/strings/types, // whether through .data.bimg.rel.ro, .bss, or directly in the boot image. diff --git a/compiler/optimizing/code_generator_mips64.cc b/compiler/optimizing/code_generator_mips64.cc index 72318e98b0..7c89808d54 100644 --- a/compiler/optimizing/code_generator_mips64.cc +++ b/compiler/optimizing/code_generator_mips64.cc @@ -128,7 +128,7 @@ class BoundsCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { public: explicit BoundsCheckSlowPathMIPS64(HBoundsCheck* instruction) : SlowPathCodeMIPS64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorMIPS64* mips64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -153,9 +153,9 @@ class BoundsCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathMIPS64"; } + const char* GetDescription() const override { return "BoundsCheckSlowPathMIPS64"; } private: DISALLOW_COPY_AND_ASSIGN(BoundsCheckSlowPathMIPS64); @@ -166,16 +166,16 @@ class DivZeroCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { explicit DivZeroCheckSlowPathMIPS64(HDivZeroCheck* instruction) : SlowPathCodeMIPS64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS64* mips64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); mips64_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathMIPS64"; } + const char* GetDescription() const override { return "DivZeroCheckSlowPathMIPS64"; } private: DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathMIPS64); @@ -189,7 +189,7 @@ class LoadClassSlowPathMIPS64 : public SlowPathCodeMIPS64 { DCHECK_EQ(instruction_->IsLoadClass(), cls_ == instruction_); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); const uint32_t dex_pc = instruction_->GetDexPc(); @@ -233,7 +233,7 @@ class LoadClassSlowPathMIPS64 : public SlowPathCodeMIPS64 { __ Bc(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathMIPS64"; } + const char* GetDescription() const override { return "LoadClassSlowPathMIPS64"; } private: // The class this slow path will load. @@ -247,7 +247,7 @@ class LoadStringSlowPathMIPS64 : public SlowPathCodeMIPS64 { explicit LoadStringSlowPathMIPS64(HLoadString* instruction) : SlowPathCodeMIPS64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { DCHECK(instruction_->IsLoadString()); DCHECK_EQ(instruction_->AsLoadString()->GetLoadKind(), HLoadString::LoadKind::kBssEntry); LocationSummary* locations = instruction_->GetLocations(); @@ -274,7 +274,7 @@ class LoadStringSlowPathMIPS64 : public SlowPathCodeMIPS64 { __ Bc(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathMIPS64"; } + const char* GetDescription() const override { return "LoadStringSlowPathMIPS64"; } private: DISALLOW_COPY_AND_ASSIGN(LoadStringSlowPathMIPS64); @@ -284,7 +284,7 @@ class NullCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { public: explicit NullCheckSlowPathMIPS64(HNullCheck* instr) : SlowPathCodeMIPS64(instr) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS64* mips64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); if (instruction_->CanThrowIntoCatchBlock()) { @@ -298,9 +298,9 @@ class NullCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathMIPS64"; } + const char* GetDescription() const override { return "NullCheckSlowPathMIPS64"; } private: DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathMIPS64); @@ -311,7 +311,7 @@ class SuspendCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { SuspendCheckSlowPathMIPS64(HSuspendCheck* instruction, HBasicBlock* successor) : SlowPathCodeMIPS64(instruction), successor_(successor) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorMIPS64* mips64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -331,7 +331,7 @@ class SuspendCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { return &return_label_; } - const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathMIPS64"; } + const char* GetDescription() const override { return "SuspendCheckSlowPathMIPS64"; } HBasicBlock* GetSuccessor() const { return successor_; @@ -352,7 +352,7 @@ class TypeCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { explicit TypeCheckSlowPathMIPS64(HInstruction* instruction, bool is_fatal) : SlowPathCodeMIPS64(instruction), is_fatal_(is_fatal) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); uint32_t dex_pc = instruction_->GetDexPc(); @@ -392,9 +392,9 @@ class TypeCheckSlowPathMIPS64 : public SlowPathCodeMIPS64 { } } - const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathMIPS64"; } + const char* GetDescription() const override { return "TypeCheckSlowPathMIPS64"; } - bool IsFatal() const OVERRIDE { return is_fatal_; } + bool IsFatal() const override { return is_fatal_; } private: const bool is_fatal_; @@ -407,7 +407,7 @@ class DeoptimizationSlowPathMIPS64 : public SlowPathCodeMIPS64 { explicit DeoptimizationSlowPathMIPS64(HDeoptimize* instruction) : SlowPathCodeMIPS64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS64* mips64_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); LocationSummary* locations = instruction_->GetLocations(); @@ -419,7 +419,7 @@ class DeoptimizationSlowPathMIPS64 : public SlowPathCodeMIPS64 { CheckEntrypointTypes(); } - const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathMIPS64"; } + const char* GetDescription() const override { return "DeoptimizationSlowPathMIPS64"; } private: DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathMIPS64); @@ -429,7 +429,7 @@ class ArraySetSlowPathMIPS64 : public SlowPathCodeMIPS64 { public: explicit ArraySetSlowPathMIPS64(HInstruction* instruction) : SlowPathCodeMIPS64(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); @@ -460,7 +460,7 @@ class ArraySetSlowPathMIPS64 : public SlowPathCodeMIPS64 { __ Bc(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ArraySetSlowPathMIPS64"; } + const char* GetDescription() const override { return "ArraySetSlowPathMIPS64"; } private: DISALLOW_COPY_AND_ASSIGN(ArraySetSlowPathMIPS64); @@ -490,9 +490,9 @@ class ReadBarrierMarkSlowPathMIPS64 : public SlowPathCodeMIPS64 { DCHECK(kEmitCompilerReadBarrier); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierMarkSlowPathMIPS"; } + const char* GetDescription() const override { return "ReadBarrierMarkSlowPathMIPS"; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); GpuRegister ref_reg = ref_.AsRegister(); DCHECK(locations->CanCall()); @@ -583,11 +583,11 @@ class ReadBarrierMarkAndUpdateFieldSlowPathMIPS64 : public SlowPathCodeMIPS64 { DCHECK(kEmitCompilerReadBarrier); } - const char* GetDescription() const OVERRIDE { + const char* GetDescription() const override { return "ReadBarrierMarkAndUpdateFieldSlowPathMIPS64"; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); GpuRegister ref_reg = ref_.AsRegister(); DCHECK(locations->CanCall()); @@ -744,7 +744,7 @@ class ReadBarrierForHeapReferenceSlowPathMIPS64 : public SlowPathCodeMIPS64 { DCHECK(!obj.Equals(ref)) << "obj=" << obj << " ref=" << ref; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorMIPS64* mips64_codegen = down_cast(codegen); LocationSummary* locations = instruction_->GetLocations(); DataType::Type type = DataType::Type::kReference; @@ -864,7 +864,7 @@ class ReadBarrierForHeapReferenceSlowPathMIPS64 : public SlowPathCodeMIPS64 { __ Bc(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { + const char* GetDescription() const override { return "ReadBarrierForHeapReferenceSlowPathMIPS64"; } @@ -909,7 +909,7 @@ class ReadBarrierForRootSlowPathMIPS64 : public SlowPathCodeMIPS64 { DCHECK(kEmitCompilerReadBarrier); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DataType::Type type = DataType::Type::kReference; GpuRegister reg_out = out_.AsRegister(); @@ -938,7 +938,7 @@ class ReadBarrierForRootSlowPathMIPS64 : public SlowPathCodeMIPS64 { __ Bc(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForRootSlowPathMIPS64"; } + const char* GetDescription() const override { return "ReadBarrierForRootSlowPathMIPS64"; } private: const Location out_; diff --git a/compiler/optimizing/code_generator_mips64.h b/compiler/optimizing/code_generator_mips64.h index fc0908b2cb..ddc154d40f 100644 --- a/compiler/optimizing/code_generator_mips64.h +++ b/compiler/optimizing/code_generator_mips64.h @@ -79,9 +79,9 @@ class InvokeDexCallingConventionVisitorMIPS64 : public InvokeDexCallingConventio InvokeDexCallingConventionVisitorMIPS64() {} virtual ~InvokeDexCallingConventionVisitorMIPS64() {} - Location GetNextLocation(DataType::Type type) OVERRIDE; - Location GetReturnLocation(DataType::Type type) const OVERRIDE; - Location GetMethodLocation() const OVERRIDE; + Location GetNextLocation(DataType::Type type) override; + Location GetReturnLocation(DataType::Type type) const override; + Location GetMethodLocation() const override; private: InvokeDexCallingConvention calling_convention; @@ -108,22 +108,22 @@ class FieldAccessCallingConventionMIPS64 : public FieldAccessCallingConvention { public: FieldAccessCallingConventionMIPS64() {} - Location GetObjectLocation() const OVERRIDE { + Location GetObjectLocation() const override { return Location::RegisterLocation(A1); } - Location GetFieldIndexLocation() const OVERRIDE { + Location GetFieldIndexLocation() const override { return Location::RegisterLocation(A0); } - Location GetReturnLocation(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { + Location GetReturnLocation(DataType::Type type ATTRIBUTE_UNUSED) const override { return Location::RegisterLocation(V0); } Location GetSetValueLocation(DataType::Type type ATTRIBUTE_UNUSED, - bool is_instance) const OVERRIDE { + bool is_instance) const override { return is_instance ? Location::RegisterLocation(A2) : Location::RegisterLocation(A1); } - Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { + Location GetFpuLocation(DataType::Type type ATTRIBUTE_UNUSED) const override { return Location::FpuRegisterLocation(F0); } @@ -136,10 +136,10 @@ class ParallelMoveResolverMIPS64 : public ParallelMoveResolverWithSwap { ParallelMoveResolverMIPS64(ArenaAllocator* allocator, CodeGeneratorMIPS64* codegen) : ParallelMoveResolverWithSwap(allocator), codegen_(codegen) {} - void EmitMove(size_t index) OVERRIDE; - void EmitSwap(size_t index) OVERRIDE; - void SpillScratch(int reg) OVERRIDE; - void RestoreScratch(int reg) OVERRIDE; + void EmitMove(size_t index) override; + void EmitSwap(size_t index) override; + void SpillScratch(int reg) override; + void RestoreScratch(int reg) override; void Exchange(int index1, int index2, bool double_slot); void ExchangeQuadSlots(int index1, int index2); @@ -173,14 +173,14 @@ class LocationsBuilderMIPS64 : public HGraphVisitor { : HGraphVisitor(graph), codegen_(codegen) {} #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_MIPS64(DECLARE_VISIT_INSTRUCTION) #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -207,14 +207,14 @@ class InstructionCodeGeneratorMIPS64 : public InstructionCodeGenerator { InstructionCodeGeneratorMIPS64(HGraph* graph, CodeGeneratorMIPS64* codegen); #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_MIPS64(DECLARE_VISIT_INSTRUCTION) #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -356,31 +356,31 @@ class CodeGeneratorMIPS64 : public CodeGenerator { OptimizingCompilerStats* stats = nullptr); virtual ~CodeGeneratorMIPS64() {} - void GenerateFrameEntry() OVERRIDE; - void GenerateFrameExit() OVERRIDE; + void GenerateFrameEntry() override; + void GenerateFrameExit() override; - void Bind(HBasicBlock* block) OVERRIDE; + void Bind(HBasicBlock* block) override; - size_t GetWordSize() const OVERRIDE { return kMips64DoublewordSize; } + size_t GetWordSize() const override { return kMips64DoublewordSize; } - size_t GetFloatingPointSpillSlotSize() const OVERRIDE { + size_t GetFloatingPointSpillSlotSize() const override { return GetGraph()->HasSIMD() ? 2 * kMips64DoublewordSize // 16 bytes for each spill. : 1 * kMips64DoublewordSize; // 8 bytes for each spill. } - uintptr_t GetAddressOf(HBasicBlock* block) OVERRIDE { + uintptr_t GetAddressOf(HBasicBlock* block) override { return assembler_.GetLabelLocation(GetLabelOf(block)); } - HGraphVisitor* GetLocationBuilder() OVERRIDE { return &location_builder_; } - HGraphVisitor* GetInstructionVisitor() OVERRIDE { return &instruction_visitor_; } - Mips64Assembler* GetAssembler() OVERRIDE { return &assembler_; } - const Mips64Assembler& GetAssembler() const OVERRIDE { return assembler_; } + HGraphVisitor* GetLocationBuilder() override { return &location_builder_; } + HGraphVisitor* GetInstructionVisitor() override { return &instruction_visitor_; } + Mips64Assembler* GetAssembler() override { return &assembler_; } + const Mips64Assembler& GetAssembler() const override { return assembler_; } // Emit linker patches. - void EmitLinkerPatches(ArenaVector* linker_patches) OVERRIDE; - void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) OVERRIDE; + void EmitLinkerPatches(ArenaVector* linker_patches) override; + void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) override; // Fast path implementation of ReadBarrier::Barrier for a heap // reference field load when Baker's read barriers are used. @@ -471,17 +471,17 @@ class CodeGeneratorMIPS64 : public CodeGenerator { // Register allocation. - void SetupBlockedRegisters() const OVERRIDE; + void SetupBlockedRegisters() const override; - size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; + size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; - void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE; - void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE; + void DumpCoreRegister(std::ostream& stream, int reg) const override; + void DumpFloatingPointRegister(std::ostream& stream, int reg) const override; - InstructionSet GetInstructionSet() const OVERRIDE { return InstructionSet::kMips64; } + InstructionSet GetInstructionSet() const override { return InstructionSet::kMips64; } const Mips64InstructionSetFeatures& GetInstructionSetFeatures() const; @@ -489,22 +489,22 @@ class CodeGeneratorMIPS64 : public CodeGenerator { return CommonGetLabelOf(block_labels_, block); } - void Initialize() OVERRIDE { + void Initialize() override { block_labels_ = CommonInitializeLabels(); } // We prefer aligned loads and stores (less code), so spill and restore registers in slow paths // at aligned locations. - uint32_t GetPreferredSlotsAlignment() const OVERRIDE { return kMips64DoublewordSize; } + uint32_t GetPreferredSlotsAlignment() const override { return kMips64DoublewordSize; } - void Finalize(CodeAllocator* allocator) OVERRIDE; + void Finalize(CodeAllocator* allocator) override; // Code generation helpers. - void MoveLocation(Location dst, Location src, DataType::Type dst_type) OVERRIDE; + void MoveLocation(Location dst, Location src, DataType::Type dst_type) override; - void MoveConstant(Location destination, int32_t value) OVERRIDE; + void MoveConstant(Location destination, int32_t value) override; - void AddLocationAsTemp(Location location, LocationSummary* locations) OVERRIDE; + void AddLocationAsTemp(Location location, LocationSummary* locations) override; void SwapLocations(Location loc1, Location loc2, DataType::Type type); @@ -513,7 +513,7 @@ class CodeGeneratorMIPS64 : public CodeGenerator { void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, uint32_t dex_pc, - SlowPathCode* slow_path = nullptr) OVERRIDE; + SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record // PC-related information in a stack map. @@ -523,39 +523,39 @@ class CodeGeneratorMIPS64 : public CodeGenerator { void GenerateInvokeRuntime(int32_t entry_point_offset); - ParallelMoveResolver* GetMoveResolver() OVERRIDE { return &move_resolver_; } + ParallelMoveResolver* GetMoveResolver() override { return &move_resolver_; } - bool NeedsTwoRegisters(DataType::Type type ATTRIBUTE_UNUSED) const OVERRIDE { return false; } + bool NeedsTwoRegisters(DataType::Type type ATTRIBUTE_UNUSED) const override { return false; } // Check if the desired_string_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadString::LoadKind GetSupportedLoadStringKind( - HLoadString::LoadKind desired_string_load_kind) OVERRIDE; + HLoadString::LoadKind desired_string_load_kind) override; // Check if the desired_class_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadClass::LoadKind GetSupportedLoadClassKind( - HLoadClass::LoadKind desired_class_load_kind) OVERRIDE; + HLoadClass::LoadKind desired_class_load_kind) override; // Check if the desired_dispatch_info is supported. If it is, return it, // otherwise return a fall-back info that should be used instead. HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch( const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, - HInvokeStaticOrDirect* invoke) OVERRIDE; + HInvokeStaticOrDirect* invoke) override; void GenerateStaticOrDirectCall( - HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void GenerateVirtualCall( - HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void MoveFromReturnRegister(Location trg ATTRIBUTE_UNUSED, - DataType::Type type ATTRIBUTE_UNUSED) OVERRIDE { + DataType::Type type ATTRIBUTE_UNUSED) override { UNIMPLEMENTED(FATAL) << "Not implemented on MIPS64"; } - void GenerateNop() OVERRIDE; - void GenerateImplicitNullCheck(HNullCheck* instruction) OVERRIDE; - void GenerateExplicitNullCheck(HNullCheck* instruction) OVERRIDE; + void GenerateNop() override; + void GenerateImplicitNullCheck(HNullCheck* instruction) override; + void GenerateExplicitNullCheck(HNullCheck* instruction) override; // The PcRelativePatchInfo is used for PC-relative addressing of methods/strings/types, // whether through .data.bimg.rel.ro, .bss, or directly in the boot image. diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index df00ec7d30..6a27081dab 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -72,7 +72,7 @@ class NullCheckSlowPathX86 : public SlowPathCode { public: explicit NullCheckSlowPathX86(HNullCheck* instruction) : SlowPathCode(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorX86* x86_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); if (instruction_->CanThrowIntoCatchBlock()) { @@ -86,9 +86,9 @@ class NullCheckSlowPathX86 : public SlowPathCode { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathX86"; } + const char* GetDescription() const override { return "NullCheckSlowPathX86"; } private: DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathX86); @@ -98,16 +98,16 @@ class DivZeroCheckSlowPathX86 : public SlowPathCode { public: explicit DivZeroCheckSlowPathX86(HDivZeroCheck* instruction) : SlowPathCode(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorX86* x86_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); x86_codegen->InvokeRuntime(kQuickThrowDivZero, instruction_, instruction_->GetDexPc(), this); CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathX86"; } + const char* GetDescription() const override { return "DivZeroCheckSlowPathX86"; } private: DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathX86); @@ -118,7 +118,7 @@ class DivRemMinusOneSlowPathX86 : public SlowPathCode { DivRemMinusOneSlowPathX86(HInstruction* instruction, Register reg, bool is_div) : SlowPathCode(instruction), reg_(reg), is_div_(is_div) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { __ Bind(GetEntryLabel()); if (is_div_) { __ negl(reg_); @@ -128,7 +128,7 @@ class DivRemMinusOneSlowPathX86 : public SlowPathCode { __ jmp(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "DivRemMinusOneSlowPathX86"; } + const char* GetDescription() const override { return "DivRemMinusOneSlowPathX86"; } private: Register reg_; @@ -140,7 +140,7 @@ class BoundsCheckSlowPathX86 : public SlowPathCode { public: explicit BoundsCheckSlowPathX86(HBoundsCheck* instruction) : SlowPathCode(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorX86* x86_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -187,9 +187,9 @@ class BoundsCheckSlowPathX86 : public SlowPathCode { CheckEntrypointTypes(); } - bool IsFatal() const OVERRIDE { return true; } + bool IsFatal() const override { return true; } - const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathX86"; } + const char* GetDescription() const override { return "BoundsCheckSlowPathX86"; } private: DISALLOW_COPY_AND_ASSIGN(BoundsCheckSlowPathX86); @@ -200,7 +200,7 @@ class SuspendCheckSlowPathX86 : public SlowPathCode { SuspendCheckSlowPathX86(HSuspendCheck* instruction, HBasicBlock* successor) : SlowPathCode(instruction), successor_(successor) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); CodeGeneratorX86* x86_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); @@ -224,7 +224,7 @@ class SuspendCheckSlowPathX86 : public SlowPathCode { return successor_; } - const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathX86"; } + const char* GetDescription() const override { return "SuspendCheckSlowPathX86"; } private: HBasicBlock* const successor_; @@ -237,7 +237,7 @@ class LoadStringSlowPathX86 : public SlowPathCode { public: explicit LoadStringSlowPathX86(HLoadString* instruction): SlowPathCode(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DCHECK(!locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg())); @@ -256,7 +256,7 @@ class LoadStringSlowPathX86 : public SlowPathCode { __ jmp(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathX86"; } + const char* GetDescription() const override { return "LoadStringSlowPathX86"; } private: DISALLOW_COPY_AND_ASSIGN(LoadStringSlowPathX86); @@ -270,7 +270,7 @@ class LoadClassSlowPathX86 : public SlowPathCode { DCHECK_EQ(instruction_->IsLoadClass(), cls_ == instruction_); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Location out = locations->Out(); const uint32_t dex_pc = instruction_->GetDexPc(); @@ -308,7 +308,7 @@ class LoadClassSlowPathX86 : public SlowPathCode { __ jmp(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathX86"; } + const char* GetDescription() const override { return "LoadClassSlowPathX86"; } private: // The class this slow path will load. @@ -322,7 +322,7 @@ class TypeCheckSlowPathX86 : public SlowPathCode { TypeCheckSlowPathX86(HInstruction* instruction, bool is_fatal) : SlowPathCode(instruction), is_fatal_(is_fatal) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); DCHECK(instruction_->IsCheckCast() || !locations->GetLiveRegisters()->ContainsCoreRegister(locations->Out().reg())); @@ -375,8 +375,8 @@ class TypeCheckSlowPathX86 : public SlowPathCode { } } - const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathX86"; } - bool IsFatal() const OVERRIDE { return is_fatal_; } + const char* GetDescription() const override { return "TypeCheckSlowPathX86"; } + bool IsFatal() const override { return is_fatal_; } private: const bool is_fatal_; @@ -389,7 +389,7 @@ class DeoptimizationSlowPathX86 : public SlowPathCode { explicit DeoptimizationSlowPathX86(HDeoptimize* instruction) : SlowPathCode(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorX86* x86_codegen = down_cast(codegen); __ Bind(GetEntryLabel()); LocationSummary* locations = instruction_->GetLocations(); @@ -402,7 +402,7 @@ class DeoptimizationSlowPathX86 : public SlowPathCode { CheckEntrypointTypes(); } - const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathX86"; } + const char* GetDescription() const override { return "DeoptimizationSlowPathX86"; } private: DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathX86); @@ -412,7 +412,7 @@ class ArraySetSlowPathX86 : public SlowPathCode { public: explicit ArraySetSlowPathX86(HInstruction* instruction) : SlowPathCode(instruction) {} - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); __ Bind(GetEntryLabel()); SaveLiveRegisters(codegen, locations); @@ -443,7 +443,7 @@ class ArraySetSlowPathX86 : public SlowPathCode { __ jmp(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ArraySetSlowPathX86"; } + const char* GetDescription() const override { return "ArraySetSlowPathX86"; } private: DISALLOW_COPY_AND_ASSIGN(ArraySetSlowPathX86); @@ -471,9 +471,9 @@ class ReadBarrierMarkSlowPathX86 : public SlowPathCode { DCHECK(kEmitCompilerReadBarrier); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierMarkSlowPathX86"; } + const char* GetDescription() const override { return "ReadBarrierMarkSlowPathX86"; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Register ref_reg = ref_.AsRegister(); DCHECK(locations->CanCall()); @@ -558,9 +558,9 @@ class ReadBarrierMarkAndUpdateFieldSlowPathX86 : public SlowPathCode { DCHECK(kEmitCompilerReadBarrier); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierMarkAndUpdateFieldSlowPathX86"; } + const char* GetDescription() const override { return "ReadBarrierMarkAndUpdateFieldSlowPathX86"; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Register ref_reg = ref_.AsRegister(); DCHECK(locations->CanCall()); @@ -724,7 +724,7 @@ class ReadBarrierForHeapReferenceSlowPathX86 : public SlowPathCode { DCHECK(!obj.Equals(ref)) << "obj=" << obj << " ref=" << ref; } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { CodeGeneratorX86* x86_codegen = down_cast(codegen); LocationSummary* locations = instruction_->GetLocations(); Register reg_out = out_.AsRegister(); @@ -843,7 +843,7 @@ class ReadBarrierForHeapReferenceSlowPathX86 : public SlowPathCode { __ jmp(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForHeapReferenceSlowPathX86"; } + const char* GetDescription() const override { return "ReadBarrierForHeapReferenceSlowPathX86"; } private: Register FindAvailableCallerSaveRegister(CodeGenerator* codegen) { @@ -883,7 +883,7 @@ class ReadBarrierForRootSlowPathX86 : public SlowPathCode { DCHECK(kEmitCompilerReadBarrier); } - void EmitNativeCode(CodeGenerator* codegen) OVERRIDE { + void EmitNativeCode(CodeGenerator* codegen) override { LocationSummary* locations = instruction_->GetLocations(); Register reg_out = out_.AsRegister(); DCHECK(locations->CanCall()); @@ -909,7 +909,7 @@ class ReadBarrierForRootSlowPathX86 : public SlowPathCode { __ jmp(GetExitLabel()); } - const char* GetDescription() const OVERRIDE { return "ReadBarrierForRootSlowPathX86"; } + const char* GetDescription() const override { return "ReadBarrierForRootSlowPathX86"; } private: const Location out_; @@ -8100,7 +8100,7 @@ class RIPFixup : public AssemblerFixup, public ArenaObjectDebugName() << " (id " << instruction->GetId() << ")"; } @@ -186,14 +186,14 @@ class InstructionCodeGeneratorX86 : public InstructionCodeGenerator { InstructionCodeGeneratorX86(HGraph* graph, CodeGeneratorX86* codegen); #define DECLARE_VISIT_INSTRUCTION(name, super) \ - void Visit##name(H##name* instr) OVERRIDE; + void Visit##name(H##name* instr) override; FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) FOR_EACH_CONCRETE_INSTRUCTION_X86(DECLARE_VISIT_INSTRUCTION) #undef DECLARE_VISIT_INSTRUCTION - void VisitInstruction(HInstruction* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) override { LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() << " (id " << instruction->GetId() << ")"; } @@ -320,23 +320,23 @@ class CodeGeneratorX86 : public CodeGenerator { OptimizingCompilerStats* stats = nullptr); virtual ~CodeGeneratorX86() {} - void GenerateFrameEntry() OVERRIDE; - void GenerateFrameExit() OVERRIDE; - void Bind(HBasicBlock* block) OVERRIDE; - void MoveConstant(Location destination, int32_t value) OVERRIDE; - void MoveLocation(Location dst, Location src, DataType::Type dst_type) OVERRIDE; - void AddLocationAsTemp(Location location, LocationSummary* locations) OVERRIDE; + void GenerateFrameEntry() override; + void GenerateFrameExit() override; + void Bind(HBasicBlock* block) override; + void MoveConstant(Location destination, int32_t value) override; + void MoveLocation(Location dst, Location src, DataType::Type dst_type) override; + void AddLocationAsTemp(Location location, LocationSummary* locations) override; - size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; - size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; + size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) override; + size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; + size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) override; // Generate code to invoke a runtime entry point. void InvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, uint32_t dex_pc, - SlowPathCode* slow_path = nullptr) OVERRIDE; + SlowPathCode* slow_path = nullptr) override; // Generate code to invoke a runtime entry point, but do not record // PC-related information in a stack map. @@ -346,46 +346,46 @@ class CodeGeneratorX86 : public CodeGenerator { void GenerateInvokeRuntime(int32_t entry_point_offset); - size_t GetWordSize() const OVERRIDE { + size_t GetWordSize() const override { return kX86WordSize; } - size_t GetFloatingPointSpillSlotSize() const OVERRIDE { + size_t GetFloatingPointSpillSlotSize() const override { return GetGraph()->HasSIMD() ? 4 * kX86WordSize // 16 bytes == 4 words for each spill : 2 * kX86WordSize; // 8 bytes == 2 words for each spill } - HGraphVisitor* GetLocationBuilder() OVERRIDE { + HGraphVisitor* GetLocationBuilder() override { return &location_builder_; } - HGraphVisitor* GetInstructionVisitor() OVERRIDE { + HGraphVisitor* GetInstructionVisitor() override { return &instruction_visitor_; } - X86Assembler* GetAssembler() OVERRIDE { + X86Assembler* GetAssembler() override { return &assembler_; } - const X86Assembler& GetAssembler() const OVERRIDE { + const X86Assembler& GetAssembler() const override { return assembler_; } - uintptr_t GetAddressOf(HBasicBlock* block) OVERRIDE { + uintptr_t GetAddressOf(HBasicBlock* block) override { return GetLabelOf(block)->Position(); } - void SetupBlockedRegisters() const OVERRIDE; + void SetupBlockedRegisters() const override; - void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE; - void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE; + void DumpCoreRegister(std::ostream& stream, int reg) const override; + void DumpFloatingPointRegister(std::ostream& stream, int reg) const override; - ParallelMoveResolverX86* GetMoveResolver() OVERRIDE { + ParallelMoveResolverX86* GetMoveResolver() override { return &move_resolver_; } - InstructionSet GetInstructionSet() const OVERRIDE { + InstructionSet GetInstructionSet() const override { return InstructionSet::kX86; } @@ -399,25 +399,25 @@ class CodeGeneratorX86 : public CodeGenerator { // Check if the desired_string_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadString::LoadKind GetSupportedLoadStringKind( - HLoadString::LoadKind desired_string_load_kind) OVERRIDE; + HLoadString::LoadKind desired_string_load_kind) override; // Check if the desired_class_load_kind is supported. If it is, return it, // otherwise return a fall-back kind that should be used instead. HLoadClass::LoadKind GetSupportedLoadClassKind( - HLoadClass::LoadKind desired_class_load_kind) OVERRIDE; + HLoadClass::LoadKind desired_class_load_kind) override; // Check if the desired_dispatch_info is supported. If it is, return it, // otherwise return a fall-back info that should be used instead. HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch( const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, - HInvokeStaticOrDirect* invoke) OVERRIDE; + HInvokeStaticOrDirect* invoke) override; // Generate a call to a static or direct method. void GenerateStaticOrDirectCall( - HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeStaticOrDirect* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; // Generate a call to a virtual method. void GenerateVirtualCall( - HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) OVERRIDE; + HInvokeVirtual* invoke, Location temp, SlowPathCode* slow_path = nullptr) override; void RecordBootImageIntrinsicPatch(HX86ComputeBaseMethodAddress* method_address, uint32_t intrinsic_data); @@ -442,16 +442,16 @@ class CodeGeneratorX86 : public CodeGenerator { dex::TypeIndex type_index, Handle handle); - void MoveFromReturnRegister(Location trg, DataType::Type type) OVERRIDE; + void MoveFromReturnRegister(Location trg, DataType::Type type) override; // Emit linker patches. - void EmitLinkerPatches(ArenaVector* linker_patches) OVERRIDE; + void EmitLinkerPatches(ArenaVector* linker_patches) override; void PatchJitRootUse(uint8_t* code, const uint8_t* roots_data, const PatchInfo