You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by va...@apache.org on 2007/06/01 11:13:48 UTC
svn commit: r543439 - in /harmony/enhanced/drlvm/trunk/vm:
jitrino/src/jet/compiler.cpp jitrino/src/shared/Type.h
vmcore/src/jit/jit_runtime_support.cpp
Author: varlax
Date: Fri Jun 1 02:13:47 2007
New Revision: 543439
URL: http://svn.apache.org/viewvc?view=rev&rev=543439
Log:
HARMONY-3727, HARMONY-3856, HARMONY-3858 [drlvm][jit] Known/proven race conditions markup
Modified:
harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h
harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp?view=diff&rev=543439&r1=543438&r2=543439
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp Fri Jun 1 02:13:47 2007
@@ -367,12 +367,14 @@
//
// Initialization done, collect statistics
//
+ UNSAFE_REGION_START
STATS_INC(Stats::methodsCompiled, 1);
STATS_INC(Stats::methodsWOCatchHandlers, m_handlers.size() ? 0 : 1);
//
STATS_MEASURE_MIN_MAX_VALUE(bc_size, m_infoBlock.get_bc_size(), meth_fname());
STATS_MEASURE_MIN_MAX_VALUE(jstack, max_stack, meth_fname());
STATS_MEASURE_MIN_MAX_VALUE(locals, num_locals, meth_fname());
+ UNSAFE_REGION_END
//
// ~Stats
//
@@ -1534,7 +1536,7 @@
JITInstanceContext* jitContext = JITInstanceContext::getContextForJIT(m_hjit);
ProfilingInterface* pi = jitContext->getProfilingInterface();
if (pi->isProfilingEnabled(ProfileType_EntryBackedge, JITProfilingRole_GEN)) {
- MemoryManager mm(128, "jet_profiling_mm");
+ MemoryManager mm("jet_profiling_mm");
MethodDesc md(m_method, m_hjit);
g_compileLock.lock();
Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h?view=diff&rev=543439&r1=543438&r2=543439
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h Fri Jun 1 02:13:47 2007
@@ -30,6 +30,8 @@
#include "MemoryManager.h"
#include "HashTable.h"
+#include "port_threadunsafe.h"
+
namespace Jitrino {
class SsaOpnd;
@@ -143,7 +145,7 @@
NumTypeTags,
InavlidTag = NumTypeTags
};
- Type(Tag t) : tag(t), id(++nextTypeId) {}
+ Type(Tag t) : tag(t), id(genNextTypeId()) {}
virtual ~Type() {}
const Tag tag;
@@ -366,10 +368,19 @@
protected:
virtual bool _isFinalClass() {return false;}
- static uint32 nextTypeId;
+
+ static uint32 genNextTypeId() {
+ // this operation can be unsafe until types are cached only per compilation session
+ // and every compilation session is performed in a single thread
+ UNSAFE_REGION_START
+ nextTypeId++;
+ UNSAFE_REGION_END
+ return nextTypeId;
+ }
private:
const uint32 id;
+ static uint32 nextTypeId;
};
///////////////////////////////////////////////////////////////////////////////
Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp?view=diff&rev=543439&r1=543438&r2=543439
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp Fri Jun 1 02:13:47 2007
@@ -63,6 +63,7 @@
#include "dump.h"
#include "vm_stats.h"
+#include "port_threadunsafe.h"
// macro that gets the offset of a certain field within a struct or class type
#define OFFSET(Struct, Field) \
@@ -364,6 +365,7 @@
// Checkcast stats update
static void rth_update_checkcast_stats(ManagedObject* o, Class* super)
{
+ UNSAFE_REGION_START
VM_Statistics::get_vm_stats().num_checkcast ++;
if (o == (ManagedObject*)VM_Global_State::loader_env->managed_null) {
VM_Statistics::get_vm_stats().num_checkcast_null++;
@@ -374,6 +376,7 @@
VM_Statistics::get_vm_stats().num_checkcast_fast_decision ++;
rth_type_test_update_stats(o->vt(), super);
}
+ UNSAFE_REGION_END
}
// Instanceof stats update