mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8222484: Specialize generation of simple String concatenation expressions
Reviewed-by: jrose, jlaskey
This commit is contained in:
parent
7d9e7e1e0b
commit
781fb29580
5 changed files with 177 additions and 96 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -62,6 +62,11 @@ public class StringConcat {
|
|||
return "string" + stringValue;
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public String concatMethodConstString() {
|
||||
return "string".concat(stringValue);
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public String concatConstIntConstInt() {
|
||||
return "string" + intValue + "string" + intValue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue