Index: build/make/targets/common_vm.xml
===================================================================
--- build/make/targets/common_vm.xml (revision 510576)
+++ build/make/targets/common_vm.xml (working copy)
@@ -73,19 +73,19 @@
-
+
-
-
+
+
-
-
-
-
+
Index: build/make/targets/jvmti.test.xml
===================================================================
--- build/make/targets/jvmti.test.xml (revision 510576)
+++ build/make/targets/jvmti.test.xml (working copy)
@@ -81,7 +81,7 @@
-
+
Index: vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp
===================================================================
--- vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp (revision 510576)
+++ vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp (working copy)
@@ -102,7 +102,7 @@
/* 4) INITILIZE STACK INFORMATION */
if (has_m2n) {
- stk_m2n_size = m2n_get_size();
+ stk_m2n_size = (unsigned)m2n_get_size();
} else {
// preserve space for callee-saves registers
stk_m2n_size = lil_cs_get_max_locals(stub) * GR_SIZE;
@@ -515,12 +515,12 @@
inline const R_Opnd & get_r_opnd(const LcgEM64TLoc * loc) const {
assert(loc->kind == LLK_Gr);
- return context.get_reg_from_map(loc->addr);
+ return context.get_reg_from_map((unsigned)loc->addr);
}
inline const XMM_Opnd & get_xmm_r_opnd(const LcgEM64TLoc * loc) const {
assert(loc->kind == LLK_Fr);
- return context.get_xmm_reg_from_map(loc->addr);
+ return context.get_xmm_reg_from_map((unsigned)loc->addr);
}
inline const M_Opnd & get_m_opnd(const LcgEM64TLoc * loc) const {
@@ -1056,7 +1056,7 @@
// debug code: check the estimate
char* i_end = buf;
- unsigned i_len = i_end - i_start;
+ unsigned i_len = (unsigned)(i_end - i_start);
if (i_len > MAX_LIL_INSTRUCTION_CODE_LENGTH) {
// the MAX_LIL_INSTRUCTION_CODE_LENGTH was underestimated.
// most likely will not cause problems in real life, though still requires correction.
@@ -1074,7 +1074,7 @@
// debug code: see above for the rationale
char* i_end = buf;
- unsigned i_len = i_end - i_start;
+ unsigned i_len = (unsigned)(i_end - i_start);
if (i_len > MAX_LIL_INSTRUCTION_CODE_LENGTH) {
assert(false);
}
Index: vm/port/src/lil/lil_code_generator.cpp
===================================================================
--- vm/port/src/lil/lil_code_generator.cpp (revision 510576)
+++ vm/port/src/lil/lil_code_generator.cpp (working copy)
@@ -64,7 +64,8 @@
compile_add_dynamic_generated_code_chunk("unknown", stub, stub_size);
if (VM_Global_State::loader_env->TI->isEnabled())
- jvmti_send_dynamic_code_generated_event("unknown", stub, stub_size);
+ jvmti_send_dynamic_code_generated_event("unknown", stub,
+ (jint)stub_size);
return stub;
}
Index: vm/port/src/lil/pim/stack_iterator.cpp
===================================================================
--- vm/port/src/lil/pim/stack_iterator.cpp (revision 510576)
+++ vm/port/src/lil/pim/stack_iterator.cpp (working copy)
@@ -59,7 +59,8 @@
if ( cci != NULL && cci->has_inline_info()) {
return cci->get_jit()->get_inline_depth(
cci->get_inline_info(),
- (POINTER_SIZE_INT)si_get_ip(si) - (POINTER_SIZE_INT)cci->get_code_block_addr());
+ // FIXME64: no support for large methods
+ (uint32)((POINTER_SIZE_INT)si_get_ip(si) - (POINTER_SIZE_INT)cci->get_code_block_addr()));
}
return 0;
}
Index: vm/port/src/atomic/win/port_atomic.c
===================================================================
--- vm/port/src/atomic/win/port_atomic.c (revision 510576)
+++ vm/port/src/atomic/win/port_atomic.c (working copy)
@@ -20,3 +20,4 @@
*/
/* All code from this file was inlinied in port_atomic.h */
+
Index: vm/vmcore/include/hashtable.h
===================================================================
--- vm/vmcore/include/hashtable.h (revision 510576)
+++ vm/vmcore/include/hashtable.h (working copy)
@@ -267,6 +267,7 @@
else
{
ABORT( "Element was inserted second time in MapEx!");
+ return NULL; // not reachable; to satisfy compiler warning
}
}
inline void Remove(Key key)
@@ -275,7 +276,7 @@
}
inline unsigned int GetItemCount()
{
- return this->size();
+ return (unsigned int)(this->size());
}
};
Index: vm/vmcore/include/vm_strings.h
===================================================================
--- vm/vmcore/include/vm_strings.h (revision 510576)
+++ vm/vmcore/include/vm_strings.h (working copy)
@@ -56,9 +56,9 @@
*/
unsigned get_utf8_length_of_unicode(const uint16 *str, unsigned unicode_length);
int get_unicode_length_of_utf8(const char *utf8);
-unsigned get_utf8_length_of_8bit(const uint8* chars, unsigned length);
+unsigned get_utf8_length_of_8bit(const uint8* chars, size_t length);
void pack_utf8(char *utf8_string, const uint16 *unicode, unsigned unicode_length);
-void utf8_from_8bit(char* utf8_string, const uint8* chars, unsigned length);
+void utf8_from_8bit(char* utf8_string, const uint8* chars, size_t length);
void unpack_utf8(uint16 *unicode, const char *utf8);
Java_java_lang_String *vm_instantiate_cp_string_slow(Class*, unsigned cp_index);
Index: vm/vmcore/include/class_member.h
===================================================================
--- vm/vmcore/include/class_member.h (revision 510576)
+++ vm/vmcore/include/class_member.h (working copy)
@@ -478,7 +478,7 @@
// The value returned by getByteCodeAddr may be NULL in which case the
// bytecodes are not available (presumably they have been garbage collected by VM).
const Byte *get_byte_code_addr() {return _byte_codes;}
- size_t get_byte_code_size() {return _byte_code_length;}
+ unsigned get_byte_code_size() {return _byte_code_length;}
// From the class file (Sec. 4.7.4)
unsigned get_max_stack() { return _max_stack; }
Index: vm/vmcore/include/compile.h
===================================================================
--- vm/vmcore/include/compile.h (revision 510576)
+++ vm/vmcore/include/compile.h (working copy)
@@ -146,7 +146,7 @@
{
const char *name;
const void *address;
- jint length;
+ size_t length;
DynamicCode *next;
};
@@ -158,7 +158,7 @@
/**
* Adding dynamic generated code info to global list.
*/
-void compile_add_dynamic_generated_code_chunk(const char* name, const void* address, jint length);
+void compile_add_dynamic_generated_code_chunk(const char* name, const void* address, size_t length);
void compile_clear_dynamic_code_list(DynamicCode* list);
#endif
Index: vm/vmcore/include/String_Pool.h
===================================================================
--- vm/vmcore/include/String_Pool.h (revision 510576)
+++ vm/vmcore/include/String_Pool.h (working copy)
@@ -53,7 +53,7 @@
// lookup string in string table & insert if not found
String * lookup(const char *str);
- String * lookup(const char *str, unsigned len);
+ String * lookup(const char *str, size_t len);
// Iterators for GC
String * get_first_string_intern();
@@ -75,7 +75,7 @@
public:
Entry * next;
String str;
- Entry(const char *s, unsigned len, Entry *n);
+ Entry(const char *s, size_t len, Entry *n);
/**
* Memory is already allocated for this object.
*/
@@ -104,12 +104,12 @@
#endif
bool has_line_end(POINTER_SIZE_INT val);
- void hash_it(const char * str, unsigned * len, POINTER_SIZE_INT * hash);
- POINTER_SIZE_INT hash_it(const char * str, unsigned len);
- String * lookup(const char *str, unsigned len, POINTER_SIZE_INT hash);
+ void hash_it(const char * str, size_t* len, POINTER_SIZE_INT * hash);
+ POINTER_SIZE_INT hash_it(const char * str, size_t len);
+ String * lookup(const char *str, size_t len, POINTER_SIZE_INT hash);
void register_interned_string(String * str);
private:
- POINTER_SIZE_INT hash_it_unaligned(const char * str, unsigned len);
+ POINTER_SIZE_INT hash_it_unaligned(const char * str, size_t len);
public:
// memory pool
Index: vm/vmcore/include/dump.h
===================================================================
--- vm/vmcore/include/dump.h (revision 510576)
+++ vm/vmcore/include/dump.h (working copy)
@@ -32,6 +32,6 @@
#define DUMP_STUB(addr, name, len)
#endif
-int dump(const char * code, const char * name, unsigned int length);
+int dump(const char * code, const char * name, size_t length);
#endif // _DUMP_H_
Index: vm/vmcore/src/jni/jni.cpp
===================================================================
--- vm/vmcore/src/jni/jni.cpp (revision 510576)
+++ vm/vmcore/src/jni/jni.cpp (working copy)
@@ -600,8 +600,8 @@
else
{
static const char* mess_templ = "duplicate class definition: ";
- static unsigned mess_templ_len = strlen(mess_templ);
- unsigned mess_size = mess_templ_len + strlen(name) + 1; // 1 is for trailing '\0'
+ static size_t mess_templ_len = strlen(mess_templ);
+ size_t mess_size = mess_templ_len + strlen(name) + 1; // 1 is for trailing '\0'
char* err_mess = (char*)STD_ALLOCA(mess_size);
sprintf(err_mess, "%s%s", mess_templ, name);
exn = exn_create("java/lang/LinkageError", err_mess);
Index: vm/vmcore/src/jit/dump.cpp
===================================================================
--- vm/vmcore/src/jit/dump.cpp (revision 510576)
+++ vm/vmcore/src/jit/dump.cpp (working copy)
@@ -31,7 +31,7 @@
// this variable is filled in by parse_args()
const char * dump_file_name = "file.dump";
-int dump(const char * code, const char * name, unsigned int length) {
+int dump(const char * code, const char * name, size_t length) {
static apr_pool_t * pool = NULL;
static port_disassembler_t * disassembler;
static apr_file_t * file = NULL;
@@ -54,7 +54,9 @@
}
apr_file_printf(file, "Function dump begin: %s\n", name);
- port_disasm_to_file(disassembler, code, length, file);
+ // FIXME64: no support for large methods
+ // with compiled code size greater than 2GB
+ port_disasm_to_file(disassembler, code, (int)length, file);
apr_file_printf(file, "Function dump end: %s\n", name);
// apr_pool_destroy(pool);
Index: vm/vmcore/src/jit/compile.cpp
===================================================================
--- vm/vmcore/src/jit/compile.cpp (revision 510576)
+++ vm/vmcore/src/jit/compile.cpp (working copy)
@@ -809,7 +809,7 @@
}
// Adding dynamic generated code info to global list
-void compile_add_dynamic_generated_code_chunk(const char* name, const void* address, jint length)
+void compile_add_dynamic_generated_code_chunk(const char* name, const void* address, size_t length)
{
DynamicCode *dc = (DynamicCode *)STD_MALLOC(sizeof(DynamicCode));
assert(dc);
Index: vm/vmcore/src/jvmti/jvmti_stack.cpp
===================================================================
--- vm/vmcore/src/jvmti/jvmti_stack.cpp (revision 510576)
+++ vm/vmcore/src/jvmti/jvmti_stack.cpp (working copy)
@@ -206,8 +206,10 @@
if (NULL != cci)
{
NativeCodePtr ip = si_get_ip(si);
- uint32 offset = (POINTER_SIZE_INT)ip -
- (POINTER_SIZE_INT)cci->get_code_block_addr();
+ // FIXME64: missing support for methods
+ // with compiled code greater than 2GB
+ uint32 offset = (uint32)((POINTER_SIZE_INT)ip -
+ (POINTER_SIZE_INT)cci->get_code_block_addr());
JIT *jit = cci->get_jit();
uint16 bc;
@@ -715,8 +717,10 @@
if (NULL != cci)
{
NativeCodePtr ip = si_get_ip(si);
- uint32 offset = (POINTER_SIZE_INT)ip -
- (POINTER_SIZE_INT)cci->get_code_block_addr();
+ // FIXME64: no support for methods
+ // with compiled code greated than 4GB
+ uint32 offset = (uint32)((POINTER_SIZE_INT)ip -
+ (POINTER_SIZE_INT)cci->get_code_block_addr());
JIT *jit = cci->get_jit();
uint16 bc;
Index: vm/vmcore/src/jvmti/jvmti_class.cpp
===================================================================
--- vm/vmcore/src/jvmti/jvmti_class.cpp (revision 510576)
+++ vm/vmcore/src/jvmti/jvmti_class.cpp (working copy)
@@ -300,8 +300,8 @@
{
TRACE2("jvmti.class", "GetClassSignature called");
SuspendEnabledChecker sec;
- int len,
- sig_len;
+ int len;
+ size_t sig_len;
char *pointer,
*signature;
Class *klass;
Index: vm/vmcore/src/jvmti/jvmti.cpp
===================================================================
--- vm/vmcore/src/jvmti/jvmti.cpp (revision 510576)
+++ vm/vmcore/src/jvmti/jvmti.cpp (working copy)
@@ -404,10 +404,10 @@
static char *parse_agent_option(apr_pool_t* pool, const char *str, const char *option_str,
const char option_separator, char **options)
{
- int cmd_length = strlen(option_str);
+ size_t cmd_length = strlen(option_str);
const char *lib_name = str + cmd_length;
char *opts_start = (char *)strchr(lib_name, option_separator);
- int lib_name_length;
+ size_t lib_name_length;
if (NULL == opts_start)
lib_name_length = strlen(lib_name);
Index: vm/vmcore/src/jvmti/ulist.h
===================================================================
--- vm/vmcore/src/jvmti/ulist.h (revision 510576)
+++ vm/vmcore/src/jvmti/ulist.h (working copy)
@@ -89,7 +89,7 @@
}
};
- ulist(int initial)
+ ulist(size_t initial)
: used(0), capacity(initial), next(NULL)
{
chunk = new T[capacity];
@@ -173,9 +173,9 @@
ulist* current = this;
while (current) {
if (current->chunk <= t && t < current->chunk + current->capacity) {
- int index = t - current->chunk;
+ int index = (int)(t - current->chunk);
assert(0 <= index && (size_t)index < current->used && "deleted or moved element");
- return iterator(current, t - current->chunk);
+ return iterator(current, (int)(t - current->chunk));
}
current = current->next;
}
Index: vm/vmcore/src/jvmti/jvmti_break_intf.cpp
===================================================================
--- vm/vmcore/src/jvmti/jvmti_break_intf.cpp (revision 510576)
+++ vm/vmcore/src/jvmti/jvmti_break_intf.cpp (working copy)
@@ -285,7 +285,7 @@
assert(interpreter_enabled());
bool UNREF check = check_insert_breakpoint(bp);
assert(check);
- bp->saved_byte = (POINTER_SIZE_INT)
+ bp->saved_byte =
interpreter.interpreter_ti_set_breakpoint(bp->method, bp->location);
insert_breakpoint(bp);
@@ -761,7 +761,7 @@
char *branch_address = code - 1;
code = jump(code, next_instruction);
- jint offset = code - branch_address - 1;
+ jint offset = (jint)(code - branch_address - 1);
*branch_address = offset;
jump(code, jump_target);
@@ -774,7 +774,7 @@
char *code = (char *)instruction_buffer;
// Push "return address" to the $next_instruction
- code = push(code, Imm_Opnd((POINTER_SIZE_INT)next_instruction));
+ code = push(code, Imm_Opnd(size_platf, (POINTER_SIZE_INT)next_instruction));
// Jump to the target address of the call instruction
jump(code, jump_target);
@@ -797,7 +797,7 @@
char *code = (char *)instruction_buffer;
// Push "return address" to the $next_instruction
- code = push(code, Imm_Opnd((POINTER_SIZE_INT)next_instruction));
+ code = push(code, Imm_Opnd(size_platf, (POINTER_SIZE_INT)next_instruction));
// Jump to the target address of the call instruction
jump(code, jump_target);
Index: vm/vmcore/src/jvmti/jvmti_heap.cpp
===================================================================
--- vm/vmcore/src/jvmti/jvmti_heap.cpp (revision 510576)
+++ vm/vmcore/src/jvmti/jvmti_heap.cpp (working copy)
@@ -629,7 +629,7 @@
hythread_suspend_disable(); // ---------------vv
ti_env->tags->get_objects_with_tags(tag_set, objects);
- int count = objects.size();
+ int count = (int)objects.size();
*count_ptr = count;
if (count == 0) {
// set output args to NULL
Index: vm/vmcore/src/jvmti/jvmti_event.cpp
===================================================================
--- vm/vmcore/src/jvmti/jvmti_event.cpp (revision 510576)
+++ vm/vmcore/src/jvmti/jvmti_event.cpp (working copy)
@@ -537,7 +537,9 @@
for (CodeChunkInfo* cci = method->get_first_JIT_specific_info(); cci; cci = cci->_next)
{
- jint code_size = cci->get_code_block_size();
+ // FIXME64: no support for large methods
+ // with compiled code size greater than 2GB
+ jint code_size = (jint)cci->get_code_block_size();
const void* code_addr = cci->get_code_block_addr();
if ( code_size <= 0 || code_addr == NULL)
@@ -681,7 +683,8 @@
// FIXME: linked list usage without sync
for (DynamicCode *dcList = compile_get_dynamic_code_list();
NULL != dcList; dcList = dcList->next)
- jvmti_send_dynamic_code_generated_event(dcList->name, dcList->address, dcList->length);
+ jvmti_send_dynamic_code_generated_event(dcList->name,
+ dcList->address, (jint)dcList->length);
return JVMTI_ERROR_NONE;
} // generate_events_dynamic_code_generated
Index: vm/vmcore/src/kernel_classes/native/Runtime_win.cpp
===================================================================
--- vm/vmcore/src/kernel_classes/native/Runtime_win.cpp (revision 510576)
+++ vm/vmcore/src/kernel_classes/native/Runtime_win.cpp (working copy)
@@ -109,7 +109,7 @@
char *strCmnd = (char*)malloc(btl);
*strCmnd = '\0';
jsize len = env->GetArrayLength(cmdarray);
- int cur_pos = 0;
+ size_t cur_pos = 0;
int i;
for ( i = 0; i < len; i++ ) {
jstring jo = (jstring)env->GetObjectArrayElement(cmdarray, (jsize) i);
Index: vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp
===================================================================
--- vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp (revision 510576)
+++ vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp (working copy)
@@ -371,7 +371,7 @@
(genv->bootstrap_class_loader);
Package_Table* ptab = cl->getPackageTable();
cl->Lock();
- unsigned p_num = ptab->size();
+ unsigned p_num = (unsigned)ptab->size();
if (p_num == (unsigned)len)
{
cl->Unlock();
Index: vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
===================================================================
--- vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp (revision 510576)
+++ vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp (working copy)
@@ -225,7 +225,7 @@
jclass pdc = struct_Class_to_java_lang_Class_Handle(genv->java_security_ProtectionDomain_Class);
assert(pdc);
- size = domains.size();
+ size = (unsigned)domains.size();
TRACE("Domains on stack: " << size);
// create & fill java array
jarray arr = jenv->NewObjectArray(size, pdc, NULL);
Index: vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp
===================================================================
--- vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp (revision 510576)
+++ vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp (working copy)
@@ -69,5 +69,5 @@
JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getClassDepthOffset(JNIEnv *, jclass)
{
- return Class::get_offset_of_depth();
+ return (jint)Class::get_offset_of_depth();
}
Index: vm/vmcore/src/class_support/Prepare.cpp
===================================================================
--- vm/vmcore/src/class_support/Prepare.cpp (revision 510576)
+++ vm/vmcore/src/class_support/Prepare.cpp (working copy)
@@ -1072,7 +1072,8 @@
Intfc_Table* Class::create_and_populate_interface_table(const std::vector& intfc_table_entries)
{
// shouldn't it be called vtable_index?
- Intfc_Table* intfc_table = create_intfc_table(this, intfc_table_entries.size());
+ Intfc_Table* intfc_table = create_intfc_table(this,
+ (unsigned)intfc_table_entries.size());
if(intfc_table_entries.size() != 0) {
unsigned vtable_offset = m_num_virtual_method_entries;
for (unsigned i = 0; i < intfc_table_entries.size(); i++) {
Index: vm/vmcore/src/class_support/String_Pool.cpp
===================================================================
--- vm/vmcore/src/class_support/String_Pool.cpp (revision 510576)
+++ vm/vmcore/src/class_support/String_Pool.cpp (working copy)
@@ -58,13 +58,13 @@
string_pool_lock = 0;
} //String_Pool::unlock_pool
-String_Pool::Entry::Entry(const char * s, unsigned len, Entry *n) : next(n) {
+String_Pool::Entry::Entry(const char * s, size_t len, Entry *n) : next(n) {
// This constructor can be run very early on during VM execution--even before main is entered.
// This is before we have had a chance to process any command line arguments. So, initialize the
// interned Java_lang_String reference to NULL in a way that will work whether references are compressed or not.
str.intern.raw_ref = NULL;
- str.len = (len);
- assert(strlen(s) >= (len));
+ str.len = (unsigned)len;
+ assert(strlen(s) >= len);
memcpy(str.bytes, s, len);
str.bytes[len] = '\0';
} //String_Pool::Entry::Entry
@@ -92,7 +92,7 @@
return (val ^ ~(val + BIT_MASK)) & ~BIT_MASK;
}
-void String_Pool::hash_it(const char * s, unsigned * len, POINTER_SIZE_INT * hash) {
+void String_Pool::hash_it(const char * s, size_t* len, POINTER_SIZE_INT * hash) {
POINTER_SIZE_INT h1 = 0;
POINTER_SIZE_INT h2 = 0;
const char * p_val = s;
@@ -129,7 +129,7 @@
*hash = h1 - h2;
}
-POINTER_SIZE_INT String_Pool::hash_it(const char * s, unsigned len) {
+POINTER_SIZE_INT String_Pool::hash_it(const char * s, size_t len) {
#ifdef _IPF_
// aligned loading is critical for _IPF_
@@ -139,7 +139,7 @@
#endif
POINTER_SIZE_INT h1 = 0, h2 = 0;
- const unsigned parts = len / sizeof(POINTER_SIZE_INT);
+ const unsigned parts = (unsigned)(len / sizeof(POINTER_SIZE_INT));
for (unsigned i = 0; i < parts; i++) {
h1 += *((POINTER_SIZE_INT *)s + i);
@@ -152,13 +152,13 @@
return h1 - h2;
}
-POINTER_SIZE_INT String_Pool::hash_it_unaligned(const char * s, unsigned len) {
+POINTER_SIZE_INT String_Pool::hash_it_unaligned(const char * s, size_t len) {
POINTER_SIZE_INT h1 = 0, h2 = 0;
- const unsigned parts = len / sizeof(POINTER_SIZE_INT);
+ const size_t parts = len / sizeof(POINTER_SIZE_INT);
// ATTENTION! we got here with unaligned s!
- for (unsigned i = 0; i < parts; i++) {
+ for (size_t i = 0; i < parts; i++) {
#ifdef _IPF_ /* 64 bit and little endian */
h1 += (POINTER_SIZE_INT) s[i * 8 + 0]
+ ((POINTER_SIZE_INT)s[i * 8 + 1] << 8)
@@ -173,14 +173,14 @@
#endif
}
- for (unsigned j = parts * sizeof(POINTER_SIZE_INT); j < len; j++) {
+ for (size_t j = parts * sizeof(POINTER_SIZE_INT); j < len; j++) {
h2 += s[j];
}
return h1 - h2;
}
-String * String_Pool::lookup(const char *s, unsigned len, POINTER_SIZE_INT raw_hash) {
+String * String_Pool::lookup(const char *s, size_t len, POINTER_SIZE_INT raw_hash) {
#ifdef VM_STATS
// we need a lock here since apr_palloc & apr_hash_set is single threaded
LMAutoUnlock auto_lock(&VM_Statistics::get_vm_stats().vm_stats_lock);
@@ -200,7 +200,7 @@
++key_stats->num_lookup;
#endif
- int hash = raw_hash % STRING_TABLE_SIZE;
+ int hash = (int)(raw_hash % STRING_TABLE_SIZE);
// search bucket for string, no lock
for (Entry *e = table[hash]; e != NULL; e = e->next) {
@@ -241,7 +241,7 @@
// compute size of Entry record
// add one to str_len for '\0'
// subtract STRING_PADDING already in Entry
- unsigned entry_size = sizeof(Entry) + len + 1 - STRING_PADDING;
+ size_t entry_size = sizeof(Entry) + len + 1 - STRING_PADDING;
/* Synchronized via String_Pool lock */
void * mem = memory_pool.alloc(entry_size);
@@ -258,14 +258,14 @@
String * String_Pool::lookup(const char *s) {
POINTER_SIZE_INT hash;
- unsigned len;
+ size_t len;
hash_it(s, &len, &hash);
return lookup(s, len, hash);
} //String_Pool::lookup
-String * String_Pool::lookup(const char *s, unsigned len) {
+String * String_Pool::lookup(const char *s, size_t len) {
return lookup(s, len, hash_it(s, len));
} //String_Pool::lookup
Index: vm/vmcore/src/class_support/manifest.cpp
===================================================================
--- vm/vmcore/src/class_support/manifest.cpp (revision 510576)
+++ vm/vmcore/src/class_support/manifest.cpp (working copy)
@@ -73,7 +73,7 @@
*dst = *src;
} while (*src != '\0');
- return dst - manifest;
+ return (long)(dst - manifest);
}
Manifest::Manifest( const JarFile* jf )
@@ -117,7 +117,7 @@
{
// parse property name
// skip useless characters
- long skipSpace = strspn( pointer, WHITESPACE_CHARS );
+ size_t skipSpace = strspn( pointer, WHITESPACE_CHARS );
pointer += skipSpace;
// set property name
char *propName = pointer;
@@ -128,8 +128,8 @@
break;
}
// find first whitespace character after property name, cut tail
- long findSpace = strcspn( pointer, WHITESPACE_CHARS );
- if( findSpace < nextPart - pointer ) {
+ size_t findSpace = strcspn( pointer, WHITESPACE_CHARS );
+ if( findSpace < (size_t)(nextPart - pointer) ) {
pointer[findSpace] = '\0';
} else {
*nextPart = '\0';
Index: vm/vmcore/src/class_support/classloader.cpp
===================================================================
--- vm/vmcore/src/class_support/classloader.cpp (revision 510576)
+++ vm/vmcore/src/class_support/classloader.cpp (working copy)
@@ -1789,7 +1789,8 @@
apr_file_close(file_handle);
// define class
- Class* clss = DefineClass(m_env, class_name->bytes, buf, 0, buf_len);
+ Class* clss = DefineClass(m_env, class_name->bytes, buf, 0,
+ (unsigned)buf_len);
if(clss) {
clss->set_class_file_name(m_env->string_pool.lookup(full_name));
}
Index: vm/vmcore/src/init/parse_arguments.cpp
===================================================================
--- vm/vmcore/src/init/parse_arguments.cpp (revision 510576)
+++ vm/vmcore/src/init/parse_arguments.cpp (working copy)
@@ -275,7 +275,7 @@
USE_JAVA_HELP;
LOGGER_EXIT(1);
} else {
- unsigned len = strlen(++arg);
+ unsigned len = (unsigned)strlen(++arg);
if (len >= 3 && strncmp("...", arg + len - 3, 3) == 0) {
get_assert_reg(p_env)->add_package(p_env, arg, len - 3, value);
} else {
Index: vm/vmcore/src/init/vm_init.cpp
===================================================================
--- vm/vmcore/src/init/vm_init.cpp (revision 510576)
+++ vm/vmcore/src/init/vm_init.cpp (working copy)
@@ -547,7 +547,8 @@
if (name) {
args[2].l = oh_allocate_local_handle();
- args[2].l->object = string_create_from_utf8(name, strlen(name));
+ args[2].l->object = string_create_from_utf8(name,
+ (unsigned)strlen(name));
} else {
args[2].l = NULL;
}
Index: vm/vmcore/src/stack/stack_trace.cpp
===================================================================
--- vm/vmcore/src/stack/stack_trace.cpp (revision 510576)
+++ vm/vmcore/src/stack/stack_trace.cpp (working copy)
@@ -41,7 +41,7 @@
*line = -1;
if (interpreter_enabled()) {
- int bc = (uint8*)ip - (uint8*)method->get_byte_code_addr();
+ int bc = (int)((uint8*)ip - (uint8*)method->get_byte_code_addr());
*line = method->get_line_number((uint16)bc);
return;
}
@@ -107,7 +107,9 @@
if (target_depth < depth + inlined_depth) {
CodeChunkInfo* cci = si_get_code_chunk_info(si);
- uint32 offset = (POINTER_SIZE_INT)stf->ip - (POINTER_SIZE_INT)cci->get_code_block_addr();
+ // FIXME64: no support for large methods
+ // with compiled code size greater than 4GB
+ uint32 offset = (uint32)((POINTER_SIZE_INT)stf->ip - (POINTER_SIZE_INT)cci->get_code_block_addr());
stf->method = cci->get_jit()->get_inlined_method(
cci->get_inline_info(), offset, target_depth - depth);
}
@@ -165,7 +167,9 @@
} else {
JIT *jit = cci->get_jit();
uint32 inlined_depth = si_get_inline_depth(si);
- uint32 offset = (POINTER_SIZE_INT)ip - (POINTER_SIZE_INT)cci->get_code_block_addr();
+ // FIXME64: no support for large methods
+ // with compiled code greater than 4GB
+ uint32 offset = (uint32)((POINTER_SIZE_INT)ip - (POINTER_SIZE_INT)cci->get_code_block_addr());
for (uint32 i = 0; i < inlined_depth; i++) {
stf->method = jit->get_inlined_method(cci->get_inline_info(), offset, i);
@@ -258,7 +262,9 @@
CodeChunkInfo* cci = si_get_code_chunk_info(si);
if ( cci != NULL ) {
uint32 inlined_depth = si_get_inline_depth(si);
- uint32 offset = (POINTER_SIZE_INT)si_get_ip(si) - (POINTER_SIZE_INT)cci->get_code_block_addr();
+ // FIXME64: no support for large methods
+ // with compiled code size greater than 4GB
+ uint32 offset = (uint32)((POINTER_SIZE_INT)si_get_ip(si) - (POINTER_SIZE_INT)cci->get_code_block_addr());
for (uint32 i = 0; i < inlined_depth; i++) {
Method *real_method = cci->get_jit()->get_inlined_method(cci->get_inline_info(), offset, i);
Index: vm/vmcore/src/stack/stack_dump.cpp
===================================================================
--- vm/vmcore/src/stack/stack_dump.cpp (revision 510576)
+++ vm/vmcore/src/stack/stack_dump.cpp (working copy)
@@ -239,7 +239,9 @@
st_get_c_method_info(&m, frames[i].ip);
} else { // Java method
uint32 inlined_depth = si_get_inline_depth(si);
- uint32 offset = (POINTER_SIZE_INT)si_get_ip(si) - (POINTER_SIZE_INT)cci->get_code_block_addr();
+ // FIXME64: on 64-bit architectures method bodies can be
+ // potentially greater than 2GB in size
+ uint32 offset = (uint32)((POINTER_SIZE_INT)si_get_ip(si) - (POINTER_SIZE_INT)cci->get_code_block_addr());
for (uint32 j = 0; j < inlined_depth; j++) {
Method *real_method = cci->get_jit()->get_inlined_method(cci->get_inline_info(), offset, j);
st_get_java_method_info(&m, real_method, frames[i].ip, 0 == i);
Index: vm/vmcore/src/verifier/Graph.cpp
===================================================================
--- vm/vmcore/src/verifier/Graph.cpp (revision 510576)
+++ vm/vmcore/src/verifier/Graph.cpp (working copy)
@@ -391,7 +391,7 @@
const char *method_desc = method_get_descriptor( ctex->m_method );
// create file name
- unsigned len = strlen( class_name ) + strlen( method_name )
+ size_t len = strlen( class_name ) + strlen( method_name )
+ strlen( method_desc ) + 6;
char *fname = (char*)STD_ALLOCA( len );
sprintf( fname, "%s_%s%s.dot", class_name, method_name, method_desc );
Index: vm/vmcore/src/verifier/ver_graph.h
===================================================================
--- vm/vmcore/src/verifier/ver_graph.h (revision 510576)
+++ vm/vmcore/src/verifier/ver_graph.h (working copy)
@@ -284,7 +284,8 @@
+ method_get_code_length( context->m_method )
: context->m_code[node->m_end + 1].m_addr;
- unsigned len = code_end - context->m_code[node->m_start].m_addr;
+ unsigned len = (unsigned)(code_end -
+ context->m_code[node->m_start].m_addr);
return len;
} // GetNodeBytecodeLen
Index: vm/vmcore/src/verifier/ver_real.h
===================================================================
--- vm/vmcore/src/verifier/ver_real.h (revision 510576)
+++ vm/vmcore/src/verifier/ver_real.h (working copy)
@@ -320,7 +320,7 @@
* @note Trace is available with argument verifier:memory.
*/
void *
-vf_calloc_func( unsigned number, unsigned element_size, VERIFY_SOURCE_PARAMS );
+vf_calloc_func( unsigned number, size_t element_size, VERIFY_SOURCE_PARAMS );
/**
* Function allocates memory blocks.
@@ -334,7 +334,7 @@
* @note Trace is available with argument verifier:memory.
*/
void *
-vf_malloc_func( unsigned size, VERIFY_SOURCE_PARAMS );
+vf_malloc_func( size_t size, VERIFY_SOURCE_PARAMS );
/**
* Function releases allocated memory blocks.
@@ -362,7 +362,7 @@
* @note Trace is available with argument verifier:memory.
*/
void *
-vf_realloc_func( void *pointer, unsigned resize, VERIFY_SOURCE_PARAMS );
+vf_realloc_func( void *pointer, size_t resize, VERIFY_SOURCE_PARAMS );
/**
* Function creates memory pool structure.
@@ -388,7 +388,7 @@
* @note Trace is available with argument verifier:memory:pool.
*/
void *
-vf_alloc_pool_memory_func( vf_VerifyPool_t *pool, unsigned size, VERIFY_SOURCE_PARAMS );
+vf_alloc_pool_memory_func( vf_VerifyPool_t *pool, size_t size, VERIFY_SOURCE_PARAMS );
/**
* Function cleans given pool.
@@ -560,7 +560,7 @@
* @see vf_HashEntry_t
* @note Created hash key and hash entry is allocated into hash memory pool.
*/
- vf_HashEntry_t * NewHashEntry( const char *key, unsigned len );
+ vf_HashEntry_t * NewHashEntry( const char *key, size_t len );
private:
vf_VerifyPool_t *m_pool; ///< hash memory pool
@@ -587,7 +587,7 @@
* else returns false.
* @see vf_HashEntry_t
*/
- bool CheckKey( vf_HashEntry_t *hash_entry, const char *key, unsigned len );
+ bool CheckKey( vf_HashEntry_t *hash_entry, const char *key, size_t len );
/**
* Hash function.
@@ -602,7 +602,7 @@
* @param len - key length
* @return Hash index relevant to key.
*/
- unsigned HashFunc( const char *key, unsigned len );
+ unsigned HashFunc( const char *key, size_t len );
}; // struct vf_Hash
//===========================================================
@@ -646,7 +646,7 @@
* @return Created valid type structure.
* @see vf_ValidType_t
*/
- vf_ValidType_t * NewType( const char *type, unsigned len );
+ vf_ValidType_t * NewType( const char *type, size_t len );
/**
* Function creates valid type which is identical to an element of a given array type.
@@ -825,9 +825,9 @@
*/
struct vf_VerifyPool {
vf_VerifyPoolInternal_t *m_pool; ///< pool entry
- unsigned m_memory; ///< allocated memory size
- unsigned m_used; ///< used memory size
- unsigned m_maxuse; ///< max used memory size
+ size_t m_memory; ///< allocated memory size
+ size_t m_used; ///< used memory size
+ size_t m_maxuse; ///< max used memory size
};
/**
@@ -837,7 +837,7 @@
void *m_memory; ///< pool entry memory
char *m_free; ///< free space in pool entry
vf_VerifyPoolInternal_t *m_next; ///< next pool entry
- unsigned m_freesize; ///< size of free space in pool entry
+ size_t m_freesize; ///< size of free space in pool entry
};
/**
@@ -1019,7 +1019,7 @@
vf_free( ctex->m_error );
}
// create message
- int len = stream.str().length();
+ size_t len = stream.str().length();
if( len ) {
ctex->m_error = (char*)vf_malloc( len + 1 );
memcpy( ctex->m_error, stream.str().c_str(), len );
Index: vm/vmcore/src/verifier/Verifier.cpp
===================================================================
--- vm/vmcore/src/verifier/Verifier.cpp (revision 510576)
+++ vm/vmcore/src/verifier/Verifier.cpp (working copy)
@@ -1534,8 +1534,8 @@
*/
static inline const char *
vf_get_class_valid_type( const char *class_name, // class name
- unsigned name_len, // class name length
- unsigned *len, // length of created string
+ size_t name_len, // class name length
+ size_t *len, // length of created string
vf_VerifyPool_t *pool) // memory pool
{
char *result;
@@ -1582,12 +1582,12 @@
vf_create_class_valid_type( const char *class_name, // class name
vf_Context_t *ctex) // verifier context
{
- unsigned len;
+ size_t len;
vf_ValidType_t *result;
// get class valid type
- unsigned class_name_len = strlen( class_name );
- const char *type = vf_get_class_valid_type( class_name, class_name_len,
+ const char *type = vf_get_class_valid_type( class_name,
+ strlen( class_name ),
&len, ctex->m_pool );
// create valid type
result = ctex->m_type->NewType( type, len );
@@ -3786,13 +3786,13 @@
*/
static inline const char *
vf_get_class_array_valid_type( const char *element_name, // array element name
- unsigned name_len, // element name length
+ size_t name_len, // element name length
unsigned dimension, // dimension of array
- unsigned *result_len, // pointer to result string length
+ size_t *result_len, // pointer to result string length
vf_VerifyPool_t *pool) // memory pool
{
- unsigned len,
- index;
+ size_t len;
+ unsigned index;
char *result;
// create valid type
@@ -3861,9 +3861,9 @@
assert( name );
// create valid type string
- unsigned len;
- unsigned class_name_len = strlen( name );
- const char *array = vf_get_class_array_valid_type( name, class_name_len, 1,
+ size_t len;
+ const char *array = vf_get_class_array_valid_type( name,
+ strlen( name ), 1,
&len, ctex->m_pool );
// check dimension
@@ -4018,9 +4018,9 @@
assert( name );
// get valid type string
- unsigned len;
- unsigned class_name_len = strlen( name );
- const char *array = vf_get_class_valid_type( name, class_name_len,
+ size_t len;
+ const char *array = vf_get_class_valid_type( name,
+ strlen( name ),
&len, ctex->m_pool );
// check dimension
unsigned short index;
@@ -5255,7 +5255,7 @@
* Set valid types
*/
const char *class_name = class_get_name( klass );
- unsigned class_name_len = strlen( class_name );
+ size_t class_name_len = strlen( class_name );
char *type_name = (char*)STD_ALLOCA( class_name_len + 1 + 1 );
// it will be a funny name for array :)
memcpy( &type_name[1], class_name, class_name_len );
Index: vm/vmcore/src/verifier/ver_utils.cpp
===================================================================
--- vm/vmcore/src/verifier/ver_utils.cpp (revision 510576)
+++ vm/vmcore/src/verifier/ver_utils.cpp (working copy)
@@ -81,7 +81,7 @@
inline bool
vf_Hash::CheckKey( vf_HashEntry_t *hash_entry, // checked hash entry
const char *key, // checked key
- unsigned len) // key length
+ size_t len) // key length
{
if( !strncmp( hash_entry->key, key, len ) && hash_entry->key[len] == '\0' ) {
return true;
@@ -109,7 +109,7 @@
*/
inline unsigned
vf_Hash::HashFunc( const char *key, // key for hash function
- unsigned len) // key length
+ size_t len) // key length
{
unsigned result = 0;
@@ -178,7 +178,7 @@
}
// create key string
- unsigned len = strlen(key);
+ size_t len = strlen(key);
char *hash_key = (char*)vf_alloc_pool_memory( m_pool, len + 1 );
memcpy( hash_key, key, len );
@@ -196,7 +196,7 @@
*/
inline vf_HashEntry_t *
vf_Hash::NewHashEntry( const char *key, // hash key
- unsigned len) // key length
+ size_t len) // key length
{
// lookup type in hash
assert( key );
@@ -252,7 +252,7 @@
*/
vf_ValidType_t *
vf_TypePool::NewType( const char *type, // class name
- unsigned len) // name length
+ size_t len) // name length
{
vf_ValidType_t *result;
vf_HashEntry_t *hash;
@@ -675,7 +675,7 @@
} while( name[index] == '[' );
if( name[index] == 'L' ) {
// array of objects, construct array name
- unsigned len = strlen( name );
+ size_t len = strlen( name );
char *buf = (char *)STD_ALLOCA( len + 2 );
memcpy( buf, name, len );
buf[len] = ';';
@@ -791,7 +791,7 @@
const char *sig1 = method_get_descriptor( method1 );
const char *sig2 = method_get_descriptor( method2 );
char *end_params = (char *)strrchr( sig1, ')' );
- unsigned len = end_params - sig1 + 1;
+ unsigned len = (unsigned)(end_params - sig1 + 1);
if( !memcmp( sig1, sig2, len ) ) {
// methods arguments are the same
if( strcmp( &sig1[len], &sig2[len] ) ) {
@@ -1009,6 +1009,7 @@
&& vf_is_super_class( current, target );
}
LDIE(40, "Verifier: vf_is_valid: invalid check type" );
+ return false;
} // vf_is_valid
/**
@@ -1497,7 +1498,7 @@
*/
void*
vf_calloc_func( unsigned num, // number of elements
- unsigned size, // size of element
+ size_t size, // size of element
VERIFY_SOURCE_PARAMS) // debug info
{
assert(num);
@@ -1523,7 +1524,7 @@
* Function allocates memory blocks.
*/
void *
-vf_malloc_func( unsigned size, // size of memory block
+vf_malloc_func( size_t size, // size of memory block
VERIFY_SOURCE_PARAMS) // debug info
{
assert( size );
@@ -1549,7 +1550,7 @@
*/
void *
vf_realloc_func( void *pointer, // old pointer
- unsigned size, // size of memory block
+ size_t size, // size of memory block
VERIFY_SOURCE_PARAMS) // debug info
{
assert( size );
@@ -1597,7 +1598,7 @@
* Function creates wide memory pool structure.
*/
static inline vf_VerifyPoolInternal_t *
-vf_create_pool_element( unsigned size, // initial pool size
+vf_create_pool_element( size_t size, // initial pool size
VERIFY_SOURCE_PARAMS) // debug info
{
vf_VerifyPoolInternal_t *result;
@@ -1656,7 +1657,7 @@
*/
void *
vf_alloc_pool_memory_func( vf_VerifyPool_t *hpool, // a given pool
- unsigned size, // memory size
+ size_t size, // memory size
VERIFY_SOURCE_PARAMS) // debug info
{
const unsigned align = sizeof(void*) - 1;
@@ -1736,7 +1737,8 @@
vf_VerifyPoolInternal_t *pool = hpool->m_pool;
while( pool ) {
// clean pool element space
- unsigned used_size = pool->m_free - (char*)pool->m_memory;
+ unsigned used_size =
+ (unsigned)(pool->m_free - (char*)pool->m_memory);
memset(pool->m_memory, 0, used_size);
pool->m_free = (char*)pool->m_memory;
pool->m_freesize += used_size;
Index: vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp
===================================================================
--- vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp (revision 510576)
+++ vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp (working copy)
@@ -165,7 +165,7 @@
// compute the base address of an array
uint64* lens_base = (uint64*)(args+2);
for(unsigned i = 0; i < dims; i++) {
- lens[i] = lens_base[dims-i-1];
+ lens[i] = (int)lens_base[dims-i-1];
}
return vm_rt_multianewarray_recursive(c, lens, dims);
}
Index: vm/vmcore/src/util/em64t/base/compile_em64t.cpp
===================================================================
--- vm/vmcore/src/util/em64t/base/compile_em64t.cpp (revision 510576)
+++ vm/vmcore/src/util/em64t/base/compile_em64t.cpp (working copy)
@@ -139,7 +139,7 @@
// 6 xmm registers
// 6 gp registers
// method handle
-const int32 stack_size = m2n_get_size() + 8 + 120;
+const int32 stack_size = (int32)m2n_get_size() + 8 + 120;
static NativeCodePtr compile_get_compile_me_generic() {
static NativeCodePtr addr = NULL;
@@ -186,7 +186,7 @@
stub = call(stub, (char *)&compile_me);
// pop m2n from the stack
- const int32 bytes_to_m2n_bottom = stack_size - m2n_get_size();
+ const int32 bytes_to_m2n_bottom = (int32)(stack_size - m2n_get_size());
stub = m2n_gen_pop_m2n(stub, false, 0, bytes_to_m2n_bottom, 1);
// restore gp inputs from the stack
Index: vm/vmcore/src/util/jarfile_support.cpp
===================================================================
--- vm/vmcore/src/util/jarfile_support.cpp (revision 510576)
+++ vm/vmcore/src/util/jarfile_support.cpp (working copy)
@@ -146,7 +146,7 @@
m_jars.push_back(fileName);
JarEntry je;
- m_jarFileIdx = je.m_jarFileIdx = m_jars.size()-1;
+ m_jarFileIdx = je.m_jarFileIdx = (int)(m_jars.size() - 1);
struct stat fs;
if(stat(fileName, &fs) == -1) return false;
Index: vm/vmcore/src/util/vm_strings.cpp
===================================================================
--- vm/vmcore/src/util/vm_strings.cpp (revision 510576)
+++ vm/vmcore/src/util/vm_strings.cpp (working copy)
@@ -84,10 +84,10 @@
return length;
} //get_utf8_length_of_unicode
-unsigned get_utf8_length_of_8bit(const uint8* chars, unsigned length)
+unsigned get_utf8_length_of_8bit(const uint8* chars, size_t length)
{
unsigned len = 0;
- for(unsigned i=0; i