hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp
author twisti
Wed, 12 May 2010 03:49:52 -0700
changeset 5427 08c6b2b940f7
parent 4745 5ec280d96474
child 5547 f4b087cbb361
permissions -rw-r--r--
6951784: Zero deoptimizer changes Summary: The way Zero currently handles deoptimization can lead to methods being freed while they are still being executed. 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
/*
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     2
 * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
4745
5ec280d96474 6920970: Zero build fixes after 6849984 and 6911204
twisti
parents: 4448
diff changeset
     3
 * Copyright 2007, 2008, 2009, 2010 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
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    20
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    21
 * CA 95054 USA or visit www.sun.com if you need additional information or
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    22
 * have any questions.
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
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    26
#include "incls/_precompiled.incl"
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    27
#include "incls/_sharedRuntime_zero.cpp.incl"
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    28
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    29
DeoptimizationBlob *SharedRuntime::_deopt_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    30
SafepointBlob      *SharedRuntime::_polling_page_safepoint_handler_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    31
SafepointBlob      *SharedRuntime::_polling_page_return_handler_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    32
RuntimeStub        *SharedRuntime::_wrong_method_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    33
RuntimeStub        *SharedRuntime::_ic_miss_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    34
RuntimeStub        *SharedRuntime::_resolve_opt_virtual_call_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    35
RuntimeStub        *SharedRuntime::_resolve_virtual_call_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    36
RuntimeStub        *SharedRuntime::_resolve_static_call_blob;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    37
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    38
int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    39
                                           VMRegPair *regs,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    40
                                           int total_args_passed,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    41
                                           int is_outgoing) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    42
  return 0;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    43
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    44
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    45
AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    46
                        MacroAssembler *masm,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    47
                        int total_args_passed,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    48
                        int comp_args_on_stack,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    49
                        const BasicType *sig_bt,
4745
5ec280d96474 6920970: Zero build fixes after 6849984 and 6911204
twisti
parents: 4448
diff changeset
    50
                        const VMRegPair *regs,
5ec280d96474 6920970: Zero build fixes after 6849984 and 6911204
twisti
parents: 4448
diff changeset
    51
                        AdapterFingerPrint *fingerprint) {
5ec280d96474 6920970: Zero build fixes after 6849984 and 6911204
twisti
parents: 4448
diff changeset
    52
  return AdapterHandlerLibrary::new_entry(
5ec280d96474 6920970: Zero build fixes after 6849984 and 6911204
twisti
parents: 4448
diff changeset
    53
    fingerprint,
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    54
    ShouldNotCallThisStub(),
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    55
    ShouldNotCallThisStub(),
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    56
    ShouldNotCallThisStub());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    57
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    58
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    59
nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    60
                                                methodHandle method,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    61
                                                int total_in_args,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    62
                                                int comp_args_on_stack,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    63
                                                BasicType *in_sig_bt,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    64
                                                VMRegPair *in_regs,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    65
                                                BasicType ret_type) {
4448
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
    66
#ifdef SHARK
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
    67
  return SharkCompiler::compiler()->generate_native_wrapper(masm,
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
    68
                                                            method,
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
    69
                                                            in_sig_bt,
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
    70
                                                            ret_type);
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
    71
#else
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    72
  ShouldNotCallThis();
4448
d6ec2737186c 6896043: first round of zero fixes
twisti
parents: 4013
diff changeset
    73
#endif // SHARK
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    74
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    75
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    76
int Deoptimization::last_frame_adjust(int callee_parameters,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    77
                                      int callee_locals) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    78
  return 0;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    79
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    80
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    81
uint SharedRuntime::out_preserve_stack_slots() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    82
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    83
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    84
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    85
static RuntimeStub* generate_empty_runtime_stub(const char* name) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    86
  CodeBuffer buffer(name, 0, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    87
  return RuntimeStub::new_runtime_stub(name, &buffer, 0, 0, NULL, false);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    88
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    89
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    90
static SafepointBlob* generate_empty_safepoint_blob() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    91
  CodeBuffer buffer("handler_blob", 0, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    92
  return SafepointBlob::create(&buffer, NULL, 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    93
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    94
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    95
void SharedRuntime::generate_stubs() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    96
  _wrong_method_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    97
    generate_empty_runtime_stub("wrong_method_stub");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    98
  _ic_miss_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    99
    generate_empty_runtime_stub("ic_miss_stub");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   100
  _resolve_opt_virtual_call_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   101
    generate_empty_runtime_stub("resolve_opt_virtual_call");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   102
  _resolve_virtual_call_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   103
    generate_empty_runtime_stub("resolve_virtual_call");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   104
  _resolve_static_call_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   105
    generate_empty_runtime_stub("resolve_static_call");
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   106
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   107
  _polling_page_safepoint_handler_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   108
    generate_empty_safepoint_blob();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   109
  _polling_page_return_handler_blob =
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   110
    generate_empty_safepoint_blob();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   111
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   112
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   113
int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   114
                                         VMRegPair *regs,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   115
                                         int total_args_passed) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   116
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   117
}