changeset 8356:739246e5f9f3

8164508: unexpected profiling mismatch in c1 generated code Summary: made 8027631 first arg skip applicable to not inlined virtual callsite too. Reviewed-by: kvn, jcm
author dbuck
date Fri, 02 Dec 2016 10:39:04 +0000
parents 7ca49bca3c2a
children f8a5d01c0929
files src/share/vm/c1/c1_LIRGenerator.cpp test/compiler/jsr292/NullConstantReceiver.java
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Nov 23 23:15:05 2016 -0800
+++ b/src/share/vm/c1/c1_LIRGenerator.cpp	Fri Dec 02 10:39:04 2016 +0000
@@ -3191,14 +3191,14 @@
       Bytecodes::Code bc = x->method()->java_code_at_bci(bci);
       int start = 0;
       int stop = data->is_CallTypeData() ? ((ciCallTypeData*)data)->number_of_arguments() : ((ciVirtualCallTypeData*)data)->number_of_arguments();
-      if (x->inlined() && x->callee()->is_static() && Bytecodes::has_receiver(bc)) {
+      if (x->callee()->is_loaded() && x->callee()->is_static() && Bytecodes::has_receiver(bc)) {
         // first argument is not profiled at call (method handle invoke)
         assert(x->method()->raw_code_at_bci(bci) == Bytecodes::_invokehandle, "invokehandle expected");
         start = 1;
       }
       ciSignature* callee_signature = x->callee()->signature();
       // method handle call to virtual method
-      bool has_receiver = x->inlined() && !x->callee()->is_static() && !Bytecodes::has_receiver(bc);
+      bool has_receiver = x->callee()->is_loaded() && !x->callee()->is_static() && !Bytecodes::has_receiver(bc);
       ciSignatureStream callee_signature_stream(callee_signature, has_receiver ? x->callee()->holder() : NULL);
 
       bool ignored_will_link;
--- a/test/compiler/jsr292/NullConstantReceiver.java	Wed Nov 23 23:15:05 2016 -0800
+++ b/test/compiler/jsr292/NullConstantReceiver.java	Fri Dec 02 10:39:04 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -23,10 +23,11 @@
 
 /**
  * @test
- * @bug 8059556 8158639
+ * @bug 8059556 8158639 8164508
  *
  * @run main/othervm -Xbatch NullConstantReceiver
  * @run main/othervm -Xbatch -XX:CompileCommand=exclude,*::run NullConstantReceiver
+ * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,*::run NullConstantReceiver
  */
 
 import java.lang.invoke.MethodHandle;