< prev index next >

src/hotspot/cpu/x86/macroAssembler_x86.hpp

Print this page

   1 /*
   2  * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *

 346   void resolve_global_jobject(Register value, Register thread, Register tmp);
 347 
 348   // C 'boolean' to Java boolean: x == 0 ? 0 : 1
 349   void c2bool(Register x);
 350 
 351   // C++ bool manipulation
 352 
 353   void movbool(Register dst, Address src);
 354   void movbool(Address dst, bool boolconst);
 355   void movbool(Address dst, Register src);
 356   void testbool(Register dst);
 357 
 358   void resolve_oop_handle(Register result, Register tmp);
 359   void resolve_weak_handle(Register result, Register tmp);
 360   void load_mirror(Register mirror, Register method, Register tmp);
 361   void load_method_holder_cld(Register rresult, Register rmethod);
 362 
 363   void load_method_holder(Register holder, Register method);
 364 
 365   // oop manipulations



 366   void load_klass(Register dst, Register src, Register tmp);
 367   void store_klass(Register dst, Register src, Register tmp);
 368 








 369   void access_load_at(BasicType type, DecoratorSet decorators, Register dst, Address src,
 370                       Register tmp1, Register thread_tmp);
 371   void access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register val,
 372                        Register tmp1, Register tmp2, Register tmp3);
 373 
 374   void load_heap_oop(Register dst, Address src, Register tmp1 = noreg,
 375                      Register thread_tmp = noreg, DecoratorSet decorators = 0);
 376   void load_heap_oop_not_null(Register dst, Address src, Register tmp1 = noreg,
 377                               Register thread_tmp = noreg, DecoratorSet decorators = 0);
 378   void store_heap_oop(Address dst, Register val, Register tmp1 = noreg,
 379                       Register tmp2 = noreg, Register tmp3 = noreg, DecoratorSet decorators = 0);
 380 
 381   // Used for storing null. All other oop constants should be
 382   // stored using routines that take a jobject.
 383   void store_heap_oop_null(Address dst);
 384 
 385 #ifdef _LP64
 386   void store_klass_gap(Register dst, Register src);
 387 
 388   // This dummy is to prevent a call to store_heap_oop from

2006   void convert_f2i(Register dst, XMMRegister src);
2007   void convert_d2i(Register dst, XMMRegister src);
2008   void convert_f2l(Register dst, XMMRegister src);
2009   void convert_d2l(Register dst, XMMRegister src);
2010   void round_double(Register dst, XMMRegister src, Register rtmp, Register rcx);
2011   void round_float(Register dst, XMMRegister src, Register rtmp, Register rcx);
2012 
2013   void cache_wb(Address line);
2014   void cache_wbsync(bool is_pre);
2015 
2016 #ifdef COMPILER2_OR_JVMCI
2017   void generate_fill_avx3(BasicType type, Register to, Register value,
2018                           Register count, Register rtmp, XMMRegister xtmp);
2019 #endif // COMPILER2_OR_JVMCI
2020 #endif // _LP64
2021 
2022   void vallones(XMMRegister dst, int vector_len);
2023 
2024   void check_stack_alignment(Register sp, const char* msg, unsigned bias = 0, Register tmp = noreg);
2025 
2026   void lightweight_lock(Register obj, Register hdr, Register thread, Register tmp, Label& slow);
2027   void lightweight_unlock(Register obj, Register hdr, Register tmp, Label& slow);
2028 };
2029 
2030 /**
2031  * class SkipIfEqual:
2032  *
2033  * Instantiating this class will result in assembly code being output that will
2034  * jump around any code emitted between the creation of the instance and it's
2035  * automatic destruction at the end of a scope block, depending on the value of
2036  * the flag passed to the constructor, which will be checked at run-time.
2037  */
2038 class SkipIfEqual {
2039  private:
2040   MacroAssembler* _masm;
2041   Label _label;
2042 
2043  public:
2044    SkipIfEqual(MacroAssembler*, const bool* flag_addr, bool value, Register rscratch);
2045    ~SkipIfEqual();
2046 };
2047 

   1 /*
   2  * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *

 346   void resolve_global_jobject(Register value, Register thread, Register tmp);
 347 
 348   // C 'boolean' to Java boolean: x == 0 ? 0 : 1
 349   void c2bool(Register x);
 350 
 351   // C++ bool manipulation
 352 
 353   void movbool(Register dst, Address src);
 354   void movbool(Address dst, bool boolconst);
 355   void movbool(Address dst, Register src);
 356   void testbool(Register dst);
 357 
 358   void resolve_oop_handle(Register result, Register tmp);
 359   void resolve_weak_handle(Register result, Register tmp);
 360   void load_mirror(Register mirror, Register method, Register tmp);
 361   void load_method_holder_cld(Register rresult, Register rmethod);
 362 
 363   void load_method_holder(Register holder, Register method);
 364 
 365   // oop manipulations
 366 #ifdef _LP64
 367   void load_nklass_compact(Register dst, Register src);
 368 #endif
 369   void load_klass(Register dst, Register src, Register tmp);
 370   void store_klass(Register dst, Register src, Register tmp);
 371 
 372   // Compares the Klass pointer of an object to a given Klass (which might be narrow,
 373   // depending on UseCompressedClassPointers).
 374   void cmp_klass(Register klass, Register dst, Register tmp);
 375 
 376   // Compares the Klass pointer of two objects o1 and o2. Result is in the condition flags.
 377   // Uses tmp1 and tmp2 as temporary registers.
 378   void cmp_klass(Register src, Register dst, Register tmp1, Register tmp2);
 379 
 380   void access_load_at(BasicType type, DecoratorSet decorators, Register dst, Address src,
 381                       Register tmp1, Register thread_tmp);
 382   void access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register val,
 383                        Register tmp1, Register tmp2, Register tmp3);
 384 
 385   void load_heap_oop(Register dst, Address src, Register tmp1 = noreg,
 386                      Register thread_tmp = noreg, DecoratorSet decorators = 0);
 387   void load_heap_oop_not_null(Register dst, Address src, Register tmp1 = noreg,
 388                               Register thread_tmp = noreg, DecoratorSet decorators = 0);
 389   void store_heap_oop(Address dst, Register val, Register tmp1 = noreg,
 390                       Register tmp2 = noreg, Register tmp3 = noreg, DecoratorSet decorators = 0);
 391 
 392   // Used for storing null. All other oop constants should be
 393   // stored using routines that take a jobject.
 394   void store_heap_oop_null(Address dst);
 395 
 396 #ifdef _LP64
 397   void store_klass_gap(Register dst, Register src);
 398 
 399   // This dummy is to prevent a call to store_heap_oop from

2017   void convert_f2i(Register dst, XMMRegister src);
2018   void convert_d2i(Register dst, XMMRegister src);
2019   void convert_f2l(Register dst, XMMRegister src);
2020   void convert_d2l(Register dst, XMMRegister src);
2021   void round_double(Register dst, XMMRegister src, Register rtmp, Register rcx);
2022   void round_float(Register dst, XMMRegister src, Register rtmp, Register rcx);
2023 
2024   void cache_wb(Address line);
2025   void cache_wbsync(bool is_pre);
2026 
2027 #ifdef COMPILER2_OR_JVMCI
2028   void generate_fill_avx3(BasicType type, Register to, Register value,
2029                           Register count, Register rtmp, XMMRegister xtmp);
2030 #endif // COMPILER2_OR_JVMCI
2031 #endif // _LP64
2032 
2033   void vallones(XMMRegister dst, int vector_len);
2034 
2035   void check_stack_alignment(Register sp, const char* msg, unsigned bias = 0, Register tmp = noreg);
2036 
2037   void lightweight_lock(Register obj, Register reg_rax, Register thread, Register tmp, Label& slow);
2038   void lightweight_unlock(Register obj, Register reg_rax, Register thread, Register tmp, Label& slow);
2039 };
2040 
2041 /**
2042  * class SkipIfEqual:
2043  *
2044  * Instantiating this class will result in assembly code being output that will
2045  * jump around any code emitted between the creation of the instance and it's
2046  * automatic destruction at the end of a scope block, depending on the value of
2047  * the flag passed to the constructor, which will be checked at run-time.
2048  */
2049 class SkipIfEqual {
2050  private:
2051   MacroAssembler* _masm;
2052   Label _label;
2053 
2054  public:
2055    SkipIfEqual(MacroAssembler*, const bool* flag_addr, bool value, Register rscratch);
2056    ~SkipIfEqual();
2057 };
2058 
< prev index next >