This commit is contained in:
John R Rose 2010-06-02 22:45:42 -07:00
commit d6a9b93b5a
133 changed files with 1889 additions and 1307 deletions

View file

@ -1211,8 +1211,44 @@ void Arguments::set_cms_and_parnew_gc_flags() {
}
#endif // KERNEL
void set_object_alignment() {
// Object alignment.
assert(is_power_of_2(ObjectAlignmentInBytes), "ObjectAlignmentInBytes must be power of 2");
MinObjAlignmentInBytes = ObjectAlignmentInBytes;
assert(MinObjAlignmentInBytes >= HeapWordsPerLong * HeapWordSize, "ObjectAlignmentInBytes value is too small");
MinObjAlignment = MinObjAlignmentInBytes / HeapWordSize;
assert(MinObjAlignmentInBytes == MinObjAlignment * HeapWordSize, "ObjectAlignmentInBytes value is incorrect");
MinObjAlignmentInBytesMask = MinObjAlignmentInBytes - 1;
LogMinObjAlignmentInBytes = exact_log2(ObjectAlignmentInBytes);
LogMinObjAlignment = LogMinObjAlignmentInBytes - LogHeapWordSize;
// Oop encoding heap max
OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes;
#ifndef KERNEL
// Set CMS global values
CompactibleFreeListSpace::set_cms_values();
#endif // KERNEL
}
bool verify_object_alignment() {
// Object alignment.
if (!is_power_of_2(ObjectAlignmentInBytes)) {
jio_fprintf(defaultStream::error_stream(),
"error: ObjectAlignmentInBytes=%d must be power of 2", (int)ObjectAlignmentInBytes);
return false;
}
if ((int)ObjectAlignmentInBytes < BytesPerLong) {
jio_fprintf(defaultStream::error_stream(),
"error: ObjectAlignmentInBytes=%d must be greater or equal %d", (int)ObjectAlignmentInBytes, BytesPerLong);
return false;
}
return true;
}
inline uintx max_heap_for_compressed_oops() {
LP64_ONLY(return oopDesc::OopEncodingHeapMax - MaxPermSize - os::vm_page_size());
LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size());
NOT_LP64(ShouldNotReachHere(); return 0);
}
@ -1776,6 +1812,8 @@ bool Arguments::check_vm_args_consistency() {
status = status && verify_interval(TLABWasteTargetPercent,
1, 100, "TLABWasteTargetPercent");
status = status && verify_object_alignment();
return status;
}
@ -2848,6 +2886,9 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
UseCompressedOops = false;
#endif
// Set object alignment values.
set_object_alignment();
#ifdef SERIALGC
force_serial_gc();
#endif // SERIALGC

View file

@ -321,6 +321,9 @@ class CommandLineFlags {
diagnostic(bool, PrintCompressedOopsMode, false, \
"Print compressed oops base address and encoding mode") \
\
lp64_product(intx, ObjectAlignmentInBytes, 8, \
"Default object alignment in bytes, 8 is minimum") \
\
/* UseMembar is theoretically a temp flag used for memory barrier \
* removal testing. It was supposed to be removed before FCS but has \
* been re-added (see 6401008) */ \
@ -1117,6 +1120,9 @@ class CommandLineFlags {
product(intx, TraceRedefineClasses, 0, \
"Trace level for JVMTI RedefineClasses") \
\
develop(bool, StressMethodComparator, false, \
"run the MethodComparator on all loaded methods") \
\
/* change to false by default sometime after Mustang */ \
product(bool, VerifyMergedCPBytecodes, true, \
"Verify bytecodes after RedefineClasses constant pool merging") \

View file

@ -1435,7 +1435,7 @@ IRT_LEAF(void, SharedRuntime::fixup_callers_callsite(methodOopDesc* method, addr
// for the rest of its life! Just another racing bug in the life of
// fixup_callers_callsite ...
//
RelocIterator iter(cb, call->instruction_address(), call->next_instruction_address());
RelocIterator iter(nm, call->instruction_address(), call->next_instruction_address());
iter.next();
assert(iter.has_current(), "must have a reloc at java call site");
relocInfo::relocType typ = iter.reloc()->type();
@ -2055,11 +2055,11 @@ class AdapterHandlerTableIterator : public StackObj {
void scan() {
while (_index < _table->table_size()) {
AdapterHandlerEntry* a = _table->bucket(_index);
_index++;
if (a != NULL) {
_current = a;
return;
}
_index++;
}
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -607,8 +607,6 @@ static inline uint64_t cast_uint64_t(size_t x)
nonstatic_field(CodeBlob, _instructions_offset, int) \
nonstatic_field(CodeBlob, _frame_complete_offset, int) \
nonstatic_field(CodeBlob, _data_offset, int) \
nonstatic_field(CodeBlob, _oops_offset, int) \
nonstatic_field(CodeBlob, _oops_length, int) \
nonstatic_field(CodeBlob, _frame_size, int) \
nonstatic_field(CodeBlob, _oop_maps, OopMapSet*) \
\
@ -626,6 +624,8 @@ static inline uint64_t cast_uint64_t(size_t x)
nonstatic_field(nmethod, _deoptimize_offset, int) \
nonstatic_field(nmethod, _orig_pc_offset, int) \
nonstatic_field(nmethod, _stub_offset, int) \
nonstatic_field(nmethod, _consts_offset, int) \
nonstatic_field(nmethod, _oops_offset, int) \
nonstatic_field(nmethod, _scopes_data_offset, int) \
nonstatic_field(nmethod, _scopes_pcs_offset, int) \
nonstatic_field(nmethod, _dependencies_offset, int) \
@ -1328,14 +1328,6 @@ static inline uint64_t cast_uint64_t(size_t x)
declare_constant(LogBytesPerWord) \
declare_constant(BytesPerLong) \
\
/********************/ \
/* Object alignment */ \
/********************/ \
\
declare_constant(MinObjAlignment) \
declare_constant(MinObjAlignmentInBytes) \
declare_constant(LogMinObjAlignmentInBytes) \
\
/********************************************/ \
/* Generation and Space Hierarchy Constants */ \
/********************************************/ \