hotspot/src/share/vm/c1/c1_MacroAssembler.hpp
author vlivanov
Fri, 10 Feb 2017 20:45:39 +0300
changeset 43947 a52ee13998f3
parent 40010 e32d5e545789
permissions -rw-r--r--
8174721: C1: Inlining through MH invokers/linkers in unreachable code is unsafe Reviewed-by: iveresov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 29180
diff changeset
     2
 * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5046
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5046
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5046
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#ifndef SHARE_VM_C1_C1_MACROASSEMBLER_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_C1_C1_MACROASSEMBLER_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
14626
0cf4eccf130f 8003240: x86: move MacroAssembler into separate file
twisti
parents: 13728
diff changeset
    28
#include "asm/macroAssembler.hpp"
0cf4eccf130f 8003240: x86: move MacroAssembler into separate file
twisti
parents: 13728
diff changeset
    29
#include "asm/macroAssembler.inline.hpp"
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 29180
diff changeset
    30
#include "utilities/macros.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
class CodeEmitInfo;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
class C1_MacroAssembler: public MacroAssembler {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
  // creation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
  C1_MacroAssembler(CodeBuffer* code) : MacroAssembler(code) { pd_init(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  //----------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  void explicit_null_check(Register base);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  void inline_cache_check(Register receiver, Register iCache);
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 14626
diff changeset
    43
  void build_frame(int frame_size_in_bytes, int bang_size_in_bytes);
5046
27e801a857cb 6919934: JSR 292 needs to support x86 C1
twisti
parents: 1
diff changeset
    44
  void remove_frame(int frame_size_in_bytes);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  void unverified_entry(Register receiver, Register ic_klass);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  void verified_entry();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  void verify_stack_oop(int offset) PRODUCT_RETURN;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  void verify_not_null_oop(Register r)  PRODUCT_RETURN;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 29180
diff changeset
    51
#include CPU_HEADER(c1_MacroAssembler)
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    52
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
// A StubAssembler is a MacroAssembler w/ extra functionality for runtime
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
// stubs. Currently it 'knows' some stub info. Eventually, the information
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
// may be set automatically or can be asserted when using specialised
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
// StubAssembler functions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
class StubAssembler: public C1_MacroAssembler {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  const char* _name;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  bool        _must_gc_arguments;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  int         _frame_size;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  int         _num_rt_args;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  int         _stub_id;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  // creation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  StubAssembler(CodeBuffer* code, const char * name, int stub_id);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  void set_info(const char* name, bool must_gc_arguments);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  void set_frame_size(int size);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  void set_num_rt_args(int args);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  // accessors
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  const char* name() const                       { return _name; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  bool  must_gc_arguments() const                { return _must_gc_arguments; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  int frame_size() const                         { return _frame_size; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  int num_rt_args() const                        { return _num_rt_args; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  int stub_id() const                            { return _stub_id; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  // runtime calls (return offset of call to be used by GC map)
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    86
  int call_RT(Register oop_result1, Register metadata_result, address entry, int args_size = 0);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    87
  int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    88
  int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    89
  int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2, Register arg3);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    91
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    92
#endif // SHARE_VM_C1_C1_MACROASSEMBLER_HPP