1 /* |
1 /* |
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
155 } else { |
155 } else { |
156 // This assumes that all prototype bits fit in an int32_t |
156 // This assumes that all prototype bits fit in an int32_t |
157 movptr(Address(obj, oopDesc::mark_offset_in_bytes ()), (int32_t)(intptr_t)markOopDesc::prototype()); |
157 movptr(Address(obj, oopDesc::mark_offset_in_bytes ()), (int32_t)(intptr_t)markOopDesc::prototype()); |
158 } |
158 } |
159 #ifdef _LP64 |
159 #ifdef _LP64 |
160 if (UseCompressedOops) { // Take care not to kill klass |
160 if (UseCompressedKlassPointers) { // Take care not to kill klass |
161 movptr(t1, klass); |
161 movptr(t1, klass); |
162 encode_heap_oop_not_null(t1); |
162 encode_heap_oop_not_null(t1); |
163 movl(Address(obj, oopDesc::klass_offset_in_bytes()), t1); |
163 movl(Address(obj, oopDesc::klass_offset_in_bytes()), t1); |
164 } else |
164 } else |
165 #endif |
165 #endif |
169 |
169 |
170 if (len->is_valid()) { |
170 if (len->is_valid()) { |
171 movl(Address(obj, arrayOopDesc::length_offset_in_bytes()), len); |
171 movl(Address(obj, arrayOopDesc::length_offset_in_bytes()), len); |
172 } |
172 } |
173 #ifdef _LP64 |
173 #ifdef _LP64 |
174 else if (UseCompressedOops) { |
174 else if (UseCompressedKlassPointers) { |
175 xorptr(t1, t1); |
175 xorptr(t1, t1); |
176 store_klass_gap(obj, t1); |
176 store_klass_gap(obj, t1); |
177 } |
177 } |
178 #endif |
178 #endif |
179 } |
179 } |
332 // explicit NULL check not needed since load from [klass_offset] causes a trap |
332 // explicit NULL check not needed since load from [klass_offset] causes a trap |
333 // check against inline cache |
333 // check against inline cache |
334 assert(!MacroAssembler::needs_explicit_null_check(oopDesc::klass_offset_in_bytes()), "must add explicit null check"); |
334 assert(!MacroAssembler::needs_explicit_null_check(oopDesc::klass_offset_in_bytes()), "must add explicit null check"); |
335 int start_offset = offset(); |
335 int start_offset = offset(); |
336 |
336 |
337 if (UseCompressedOops) { |
337 if (UseCompressedKlassPointers) { |
338 load_klass(rscratch1, receiver); |
338 load_klass(rscratch1, receiver); |
339 cmpptr(rscratch1, iCache); |
339 cmpptr(rscratch1, iCache); |
340 } else { |
340 } else { |
341 cmpptr(iCache, Address(receiver, oopDesc::klass_offset_in_bytes())); |
341 cmpptr(iCache, Address(receiver, oopDesc::klass_offset_in_bytes())); |
342 } |
342 } |
343 // if icache check fails, then jump to runtime routine |
343 // if icache check fails, then jump to runtime routine |
344 // Note: RECEIVER must still contain the receiver! |
344 // Note: RECEIVER must still contain the receiver! |
345 jump_cc(Assembler::notEqual, |
345 jump_cc(Assembler::notEqual, |
346 RuntimeAddress(SharedRuntime::get_ic_miss_stub())); |
346 RuntimeAddress(SharedRuntime::get_ic_miss_stub())); |
347 const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9); |
347 const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9); |
348 assert(UseCompressedOops || offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry"); |
348 assert(UseCompressedKlassPointers || offset() - start_offset == ic_cmp_size, "check alignment in emit_method_entry"); |
349 } |
349 } |
350 |
350 |
351 |
351 |
352 void C1_MacroAssembler::build_frame(int frame_size_in_bytes) { |
352 void C1_MacroAssembler::build_frame(int frame_size_in_bytes) { |
353 // Make sure there is enough stack space for this method's activation. |
353 // Make sure there is enough stack space for this method's activation. |