hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp
author twisti
Mon, 04 Apr 2011 03:02:00 -0700
changeset 9103 535a93f494f6
parent 7397 5b173b4ca846
child 10260 b7007c4de557
permissions -rw-r--r--
7032458: Zero and Shark fixes Reviewed-by: twisti Contributed-by: Gary Benson <gbenson@redhat.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     1
/*
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
     2
 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
9103
535a93f494f6 7032458: Zero and Shark fixes
twisti
parents: 7397
diff changeset
     3
 * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     5
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     8
 * published by the Free Software Foundation.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     9
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    14
 * accompanied this code).
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    15
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    19
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4745
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4745
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4745
diff changeset
    22
 * questions.
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    23
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    24
 */
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    25
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
#include "asm/assembler.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "assembler_zero.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "code/debugInfoRec.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
#include "code/icBuffer.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
#include "code/vtableStubs.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    32
#include "interpreter/interpreter.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    33
#include "oops/compiledICHolderOop.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    34
#include "prims/jvmtiRedefineClassesTrace.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    35
#include "runtime/sharedRuntime.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    36
#include "runtime/vframeArray.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    37
#include "vmreg_zero.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    38
#ifdef COMPILER1
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    39
#include "c1/c1_Runtime1.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    40
#endif
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    41
#ifdef COMPILER2
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    42
#include "opto/runtime.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    43
#endif
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    44
#ifdef SHARK
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    45
#include "compiler/compileBroker.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    46
#include "shark/sharkCompiler.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    47
#endif
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    48
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    49
DeoptimizationBlob *SharedRuntime::_deopt_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    50
SafepointBlob      *SharedRuntime::_polling_page_safepoint_handler_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    51
SafepointBlob      *SharedRuntime::_polling_page_return_handler_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    52
RuntimeStub        *SharedRuntime::_wrong_method_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    53
RuntimeStub        *SharedRuntime::_ic_miss_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    54
RuntimeStub        *SharedRuntime::_resolve_opt_virtual_call_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    55
RuntimeStub        *SharedRuntime::_resolve_virtual_call_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    56
RuntimeStub        *SharedRuntime::_resolve_static_call_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    57
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    58
int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    59
                                           VMRegPair *regs,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    60
                                           int total_args_passed,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    61
                                           int is_outgoing) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    62
  return 0;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    63
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    64
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    65
AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    66
                        MacroAssembler *masm,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    67
                        int total_args_passed,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    68
                        int comp_args_on_stack,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    69
                        const BasicType *sig_bt,
4745
5ec280d96474 6920970: Zero build fixes after 6849984 and 6911204
twisti
parents: 4448
diff changeset
    70
                        const VMRegPair *regs,
5ec280d96474 6920970: Zero build fixes after 6849984 and 6911204
twisti
parents: 4448
diff changeset
    71
                        AdapterFingerPrint *fingerprint) {
5ec280d96474 6920970: Zero build fixes after 6849984 and 6911204
twisti
parents: 4448
diff changeset
    72
  return AdapterHandlerLibrary::new_entry(
5ec280d96474 6920970: Zero build fixes after 6849984 and 6911204
twisti
parents: 4448
diff changeset
    73
    fingerprint,
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    74
    ShouldNotCallThisStub(),
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    75
    ShouldNotCallThisStub(),
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    76
    ShouldNotCallThisStub());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    77
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    78
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    79
nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    80
                                                methodHandle method,
9103
535a93f494f6 7032458: Zero and Shark fixes
twisti
parents: 7397
diff changeset
    81
                                                int compile_id,
535a93f494f6 7032458: Zero and Shark fixes
twisti
parents: 7397
diff changeset
    82
                                                int total_args_passed,
535a93f494f6 7032458: Zero and Shark fixes
twisti
parents: 7397
diff changeset
    83
                                                int max_arg,
535a93f494f6 7032458: Zero and Shark fixes
twisti
parents: 7397
diff changeset
    84
                                                BasicType *sig_bt,
535a93f494f6 7032458: Zero and Shark fixes
twisti
parents: 7397
diff changeset
    85
                                                VMRegPair *regs,
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    86
                                                BasicType ret_type) {
4448
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
    87
#ifdef SHARK
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
    88
  return SharkCompiler::compiler()->generate_native_wrapper(masm,
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
    89
                                                            method,
9103
535a93f494f6 7032458: Zero and Shark fixes
twisti
parents: 7397
diff changeset
    90
                                                            compile_id,
535a93f494f6 7032458: Zero and Shark fixes
twisti
parents: 7397
diff changeset
    91
                                                            sig_bt,
4448
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
    92
                                                            ret_type);
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
    93
#else
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    94
  ShouldNotCallThis();
4448
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
    95
#endif // SHARK
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    96
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    97
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    98
int Deoptimization::last_frame_adjust(int callee_parameters,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    99
                                      int callee_locals) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   100
  return 0;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   101
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   102
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   103
uint SharedRuntime::out_preserve_stack_slots() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   104
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   105
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   106
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   107
static RuntimeStub* generate_empty_runtime_stub(const char* name) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   108
  CodeBuffer buffer(name, 0, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   109
  return RuntimeStub::new_runtime_stub(name, &buffer, 0, 0, NULL, false);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   110
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   111
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   112
static SafepointBlob* generate_empty_safepoint_blob() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   113
  CodeBuffer buffer("handler_blob", 0, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   114
  return SafepointBlob::create(&buffer, NULL, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   115
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   116
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   117
void SharedRuntime::generate_stubs() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   118
  _wrong_method_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   119
    generate_empty_runtime_stub("wrong_method_stub");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   120
  _ic_miss_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   121
    generate_empty_runtime_stub("ic_miss_stub");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   122
  _resolve_opt_virtual_call_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   123
    generate_empty_runtime_stub("resolve_opt_virtual_call");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   124
  _resolve_virtual_call_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   125
    generate_empty_runtime_stub("resolve_virtual_call");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   126
  _resolve_static_call_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   127
    generate_empty_runtime_stub("resolve_static_call");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   128
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   129
  _polling_page_safepoint_handler_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   130
    generate_empty_safepoint_blob();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   131
  _polling_page_return_handler_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   132
    generate_empty_safepoint_blob();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   133
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   134
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   135
int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   136
                                         VMRegPair *regs,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   137
                                         int total_args_passed) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   138
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   139
}