1.1 --- a/src/os_cpu/bsd_x86/vm/bsd_x86_64.ad Thu Feb 16 11:33:49 2012 -0800 1.2 +++ b/src/os_cpu/bsd_x86/vm/bsd_x86_64.ad Thu Feb 16 17:12:49 2012 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 // 1.5 -// Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. 1.6 +// Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. 1.7 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 // 1.9 // This code is free software; you can redistribute it and/or modify it 1.10 @@ -55,8 +55,7 @@ 1.11 // adding a syntax that specifies the sizes of fields in an order, 1.12 // so that the adlc can build the emit functions automagically 1.13 1.14 - enc_class Java_To_Runtime(method meth) 1.15 - %{ 1.16 + enc_class Java_To_Runtime(method meth) %{ 1.17 // No relocation needed 1.18 1.19 // movq r10, <meth> 1.20 @@ -70,104 +69,15 @@ 1.21 emit_opcode(cbuf, 0xD0 | (R10_enc - 8)); 1.22 %} 1.23 1.24 - enc_class bsd_breakpoint 1.25 - %{ 1.26 - MacroAssembler* masm = new MacroAssembler(&cbuf); 1.27 - masm->call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint))); 1.28 - %} 1.29 - 1.30 - enc_class call_epilog 1.31 - %{ 1.32 - if (VerifyStackAtCalls) { 1.33 - // Check that stack depth is unchanged: find majik cookie on stack 1.34 - int framesize = 1.35 - ra_->reg2offset_unchecked(OptoReg::add(ra_->_matcher._old_SP, -3*VMRegImpl::slots_per_word)); 1.36 - if (framesize) { 1.37 - if (framesize < 0x80) { 1.38 - emit_opcode(cbuf, Assembler::REX_W); 1.39 - emit_opcode(cbuf, 0x81); // cmpq [rsp+0],0xbadb1ood 1.40 - emit_d8(cbuf, 0x7C); 1.41 - emit_d8(cbuf, 0x24); 1.42 - emit_d8(cbuf, framesize); // Find majik cookie from ESP 1.43 - emit_d32(cbuf, 0xbadb100d); 1.44 - } else { 1.45 - emit_opcode(cbuf, Assembler::REX_W); 1.46 - emit_opcode(cbuf, 0x81); // cmpq [rsp+0],0xbadb1ood 1.47 - emit_d8(cbuf, 0xBC); 1.48 - emit_d8(cbuf, 0x24); 1.49 - emit_d32(cbuf, framesize); // Find majik cookie from ESP 1.50 - emit_d32(cbuf, 0xbadb100d); 1.51 - } 1.52 - } 1.53 - // jmp EQ around INT3 1.54 - // QQQ TODO 1.55 - const int jump_around = 5; // size of call to breakpoint, 1 for CC 1.56 - emit_opcode(cbuf, 0x74); 1.57 - emit_d8(cbuf, jump_around); 1.58 - // QQQ temporary 1.59 - emit_break(cbuf); 1.60 - // Die if stack mismatch 1.61 - // emit_opcode(cbuf,0xCC); 1.62 - } 1.63 - %} 1.64 - 1.65 -%} 1.66 - 1.67 -// INSTRUCTIONS -- Platform dependent 1.68 - 1.69 -//----------OS and Locking Instructions---------------------------------------- 1.70 - 1.71 -// This name is KNOWN by the ADLC and cannot be changed. 1.72 -// The ADLC forces a 'TypeRawPtr::BOTTOM' output type 1.73 -// for this guy. 1.74 -instruct tlsLoadP(r15_RegP dst) 1.75 -%{ 1.76 - match(Set dst (ThreadLocal)); 1.77 - effect(DEF dst); 1.78 - 1.79 - size(0); 1.80 - format %{ "# TLS is in R15" %} 1.81 - ins_encode( /*empty encoding*/ ); 1.82 - ins_pipe(ialu_reg_reg); 1.83 -%} 1.84 - 1.85 -// Die now 1.86 -instruct ShouldNotReachHere() 1.87 -%{ 1.88 - match(Halt); 1.89 - 1.90 - // Use the following format syntax 1.91 - format %{ "int3\t# ShouldNotReachHere" %} 1.92 - // QQQ TODO for now call breakpoint 1.93 - // opcode(0xCC); 1.94 - // ins_encode(Opc); 1.95 - ins_encode(bsd_breakpoint); 1.96 - ins_pipe(pipe_slow); 1.97 %} 1.98 1.99 1.100 // Platform dependent source 1.101 1.102 -source 1.103 -%{ 1.104 +source %{ 1.105 1.106 int MachCallRuntimeNode::ret_addr_offset() { 1.107 return 13; // movq r10,#addr; callq (r10) 1.108 } 1.109 1.110 -// emit an interrupt that is caught by the debugger 1.111 -void emit_break(CodeBuffer& cbuf) { 1.112 - // Debugger doesn't really catch this but best we can do so far QQQ 1.113 - MacroAssembler* masm = new MacroAssembler(&cbuf); 1.114 - masm->call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint))); 1.115 -} 1.116 - 1.117 -void MachBreakpointNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const { 1.118 - emit_break(cbuf); 1.119 -} 1.120 - 1.121 -uint MachBreakpointNode::size(PhaseRegAlloc* ra_) const { 1.122 - return 5; 1.123 -} 1.124 - 1.125 %}