harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r649391 [1/4] - in /harmony/enhanced/drlvm/trunk: ./ make/ make/extra/ make/vm/ vm/em/src/ vm/gc_gen/src/common/ vm/gc_gen/src/gen/ vm/gc_gen/src/mark_compact/ vm/gc_gen/src/semi_space/ vm/interpreter/src/ vm/port/include/ vm/port/include/t...
Date Fri, 18 Apr 2008 07:26:38 GMT
Author: varlax
Date: Fri Apr 18 00:26:23 2008
New Revision: 649391

URL: http://svn.apache.org/viewvc?rev=649391&view=rev
Log:
main part of HARMONY-5692 [drlvm][build] replace log4cxx with lightweight custom logger and remove apr-util and apr-iconv from the list of dependencies

Added:
    harmony/enhanced/drlvm/trunk/vm/port/src/logger/logparams.cpp   (with props)
Removed:
    harmony/enhanced/drlvm/trunk/make/extra/aprutil.xml
    harmony/enhanced/drlvm/trunk/make/extra/log4cxx.xml
    harmony/enhanced/drlvm/trunk/vm/port/include/log_macro.h
Modified:
    harmony/enhanced/drlvm/trunk/build.xml
    harmony/enhanced/drlvm/trunk/make/depends.properties
    harmony/enhanced/drlvm/trunk/make/vm/hythr.xml
    harmony/enhanced/drlvm/trunk/make/vm/vmcore.xml
    harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
    harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp
    harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp
    harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp
    harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_metadata.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_options.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/large_pages.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect_compact.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_extend_compact.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace.cpp
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_defs.h
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ipf.cpp
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_stack_trace.cpp
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_vm_helpers.cpp
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp
    harmony/enhanced/drlvm/trunk/vm/port/include/clog.h
    harmony/enhanced/drlvm/trunk/vm/port/include/cxxlog.h
    harmony/enhanced/drlvm/trunk/vm/port/include/logger.h
    harmony/enhanced/drlvm/trunk/vm/port/include/loggerstring.h
    harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h
    harmony/enhanced/drlvm/trunk/vm/port/include/tl/memory_pool.h
    harmony/enhanced/drlvm/trunk/vm/port/src/logger/logger.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/malloc/port_malloc_registrar.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/misc/win/timer.c
    harmony/enhanced/drlvm/trunk/vm/port/src/tl/memory_pool.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/vmem/win/port_vmem.c
    harmony/enhanced/drlvm/trunk/vm/vmcore/build/vmcore.exp
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/classloader.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/environment.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/hashtable.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/init.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/jni_direct.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/object_layout.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_log.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Environment.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Resolve.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/java_type.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/method.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/type.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/type_access.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_jit.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/stop_the_world_root_set_enum.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalize.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/harmony.properties
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/primitives_support.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_utils.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_general.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_locals.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_pop_frame.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/ulist.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/Runtime_win.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMMemoryManager.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMField.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_lang_management_ClassLoadingMXBeanImpl.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/em64t/lil_code_generator_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/lil_code_generator_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/stack_iterator_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/lil.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/lil_code_generator_utils.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/vm_arrays.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/annotations.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/reflection.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/object_generic.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_dump.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_basic.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_monitors.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_suspend.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_manager.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/verify_stack_enumeration.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base_natives/java_lang_thread_em64t.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/ini_iA32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/optimize_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base_natives/java_lang_thread_ia32.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/mem_alloc.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/natives_support.cpp
    harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp

Modified: harmony/enhanced/drlvm/trunk/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build.xml?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/build.xml (original)
+++ harmony/enhanced/drlvm/trunk/build.xml Fri Apr 18 00:26:23 2008
@@ -113,8 +113,6 @@
     <target name="build-extra" depends=""
         description="Compiles external dependencies">
         <ant antfile="make/extra/apr.xml"/>
-        <ant antfile="make/extra/aprutil.xml"/>
-        <ant antfile="make/extra/log4cxx.xml"/>
     </target>
 
     <target name="encoder">

Modified: harmony/enhanced/drlvm/trunk/make/depends.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/make/depends.properties?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/make/depends.properties (original)
+++ harmony/enhanced/drlvm/trunk/make/depends.properties Fri Apr 18 00:26:23 2008
@@ -38,22 +38,6 @@
 apr.src.tgz.url=http://archive.apache.org/dist/apr/apr-1.2.12.tar.gz
 apr.src.tgz.md5=020ea947446dca2d1210c099c7a4c837
 
-aprutil.src.tgz=${depends.oss}/apr/apr-util-1.2.12.tar.gz
-aprutil.src.rootdir=apr-util-1.2.12
-aprutil.src.tgz.url=http://archive.apache.org/dist/apr/apr-util-1.2.12.tar.gz
-aprutil.src.tgz.md5=e292942e22edd21b68609086352212e4
-
-apriconv.src.tgz=${depends.oss}/apr/apr-iconv-1.2.1.tar.gz
-apriconv.src.rootdir=apr-iconv-1.2.1
-apriconv.src.tgz.url=http://archive.apache.org/dist/apr/apr-iconv-1.2.1.tar.gz
-apriconv.src.tgz.md5=4a27a1480e6862543396e59c4ffcdeb4
-
-# LOG4CXX
-# http://logging.apache.org/site/cvs-repositories.html
-log4cxx.svn.url=http://svn.apache.org/repos/asf/logging/log4cxx/trunk
-log4cxx.svn.revision=467164
-log4cxx.svn.dir=${depends.oss}/log4cxx
-
 # ZLIB, version 1.2.1 or above
 # http://www.zlib.net/
 zlib.dir=${base.dep.dir}/libs/${hy.platform.variant}/zlib-123

Modified: harmony/enhanced/drlvm/trunk/make/vm/hythr.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/make/vm/hythr.xml?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/make/vm/hythr.xml (original)
+++ harmony/enhanced/drlvm/trunk/make/vm/hythr.xml Fri Apr 18 00:26:23 2008
@@ -42,7 +42,7 @@
         </compiler>
 
         <linker id="linker" extends="common.linker">
-            <libset libs="port,log4cxx,aprutil-1,apr-1"
+            <libset libs="port,apr-1"
                     dir="${drlvm.lib.dir}" />
 
             <linkerarg value="/DEF:${vm.home}/thread/src/hythr.def" if="is.windows"/>

Modified: harmony/enhanced/drlvm/trunk/make/vm/vmcore.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/make/vm/vmcore.xml?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/make/vm/vmcore.xml (original)
+++ harmony/enhanced/drlvm/trunk/make/vm/vmcore.xml Fri Apr 18 00:26:23 2008
@@ -74,7 +74,12 @@
     </target>
 
     <target name="-check-setup-win" if="is.windows">
-        <available file="${drlvm.bin.dir}/zlib1.dll" property="zlib.available"/>
+        <condition property="zlib.available">
+            <and>
+                <available file="${drlvm.bin.dir}/zlib1.dll"/>
+                <available file="${drlvm.include.dir}/zlib.h"/>
+            </and>
+        </condition>
         <condition property="win.setup.complete">
             <isset property="zlib.available"/>
         </condition>
@@ -212,7 +217,7 @@
         
         <link-lib name="harmonyvm" type="shared">
             <linker id="linker" extends="common.linker">
-                <libset libs="port,encoder,verifier,log4cxx,aprutil-1,apr-1"
+                <libset libs="port,encoder,verifier,apr-1"
                     dir="${drlvm.lib.dir}" />
                 <libset libs="hythr" dir="${drlvm.shlib.dir}" />
                 <libset libs="icuuc" dir="${drlvm.shlib.dir}"/>

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp Fri Apr 18 00:26:23 2008
@@ -17,6 +17,8 @@
 /**
 * @author Mikhail Y. Fursov
 */
+#define LOG_DOMAIN "em"
+#include "cxxlog.h"
 
 #include "DrlEMImpl.h"
 
@@ -32,19 +34,15 @@
 #include "open/vm_method_access.h"
 #include "open/vm_class_manipulation.h"
 #include "ini.h"
-#include "cxxlog.h"
 
 #include "vm_properties.h"
 
-#include <assert.h>
 #include <algorithm>
 #include <sstream>
 #include <fstream>
 #include "port_threadunsafe.h"
 #include "port_mutex.h"
 
-#define LOG_DOMAIN "em"
-
 #define EDGE_PROFILER_STR  "EDGE_PROFILER"
 #define VALUE_PROFILER_STR  "VALUE_PROFILER"
 #define ENTRY_BACKEDGE_PROFILER_STR  "EB_PROFILER"
@@ -422,7 +420,7 @@
 }
 
 void DrlEMImpl::buildChains(std::string& config) {
-    bool loggingEnabled =  is_info_enabled(LOG_DOMAIN);
+    bool loggingEnabled =  log_is_info_enabled(LOG_DOMAIN);
     StringList chainNames = getParamAsList(config, "chains", ',', true);
     if (chainNames.empty()) {
         LECHO(3, "EM: No 'chains' property found in configuration");
@@ -458,7 +456,7 @@
                 break;
             }
             RStep* step = new RStep(jh, jitName, chain, libHandle);
-            step->loggingEnabled = loggingEnabled || is_info_enabled(step->catName.c_str());
+            step->loggingEnabled = loggingEnabled || log_is_info_enabled(step->catName.c_str());
             chain->steps.push_back(step);
 
             if (!initJIT(fullJitLibPath, libHandle, *step)) {

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp Fri Apr 18 00:26:23 2008
@@ -44,9 +44,9 @@
 {
     assert( (mode == EB_PCMODE_SYNC ? (initialTimeout==0 && timeout==0) : timeout > 0) );
     catName = std::string(LOG_DOMAIN) + ".profiler." + name;
-    loggingEnabled =  is_info_enabled(LOG_DOMAIN);
+    loggingEnabled =  log_is_info_enabled(LOG_DOMAIN);
     if (!loggingEnabled) {
-        loggingEnabled = is_info_enabled(catName.c_str());
+        loggingEnabled = log_is_info_enabled(catName.c_str());
     }
     if (loggingEnabled) {
         std::ostringstream msg;

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp Fri Apr 18 00:26:23 2008
@@ -102,7 +102,7 @@
 {
     port_mutex_create(&profilesLock, APR_THREAD_MUTEX_NESTED);
     catName = std::string(LOG_DOMAIN) + ".profiler." + name;
-    loggingEnabled =  is_info_enabled(LOG_DOMAIN) ||  is_info_enabled(catName.c_str());
+    loggingEnabled =  log_is_info_enabled(LOG_DOMAIN) || log_is_info_enabled(catName.c_str());
     if (loggingEnabled) {
         std::ostringstream msg;
         msg<< "EM: edge profiler intialized: "<<name

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp Fri Apr 18 00:26:23 2008
@@ -22,11 +22,11 @@
 * Journal of Instruction-Level Parallelism, 1999>
 *
 */
+#define LOG_DOMAIN "em"
+#include "cxxlog.h"
 #include "NValueProfileCollector.h"
 
 #include <algorithm>
-#include <assert.h>
-#include "cxxlog.h"
 #include <sstream>
 #include "open/vm_class_info.h"
 #include "open/vm_ee.h"
@@ -36,7 +36,6 @@
 #include "open/vm_class_manipulation.h"
 #include "open/vm.h" // for vtable_get_class
 
-#define LOG_DOMAIN "em"
 
 VPInstructionProfileData* TNVTableManager::createProfileData()
 {
@@ -333,12 +332,8 @@
             (_TNV_steady_size, _TNV_clear_size, _clear_interval, update_strategy);
     }
     catName = std::string(LOG_DOMAIN) + ".profiler." + name;
-    loggingEnabled =  is_info_enabled(LOG_DOMAIN) ||  is_info_enabled(catName.c_str());
-    if (loggingEnabled) {
-        std::ostringstream msg;
-        msg<< "EM: value profiler intialized: "<<name;
-        INFO2(catName.c_str(), msg.str().c_str());
-    }
+    loggingEnabled =  log_is_info_enabled(LOG_DOMAIN) || log_is_info_enabled(catName.c_str());
+    INFO2(catName.c_str(), "EM: value profiler intialized: " << name.c_str());
 }
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.cpp Fri Apr 18 00:26:23 2008
@@ -182,7 +182,7 @@
         if (code_block_addr < last_end_addr) {
             printf("Method_Lookup_Table::append_unlocked: New entry [%p..%p] is before last table entry [%p..%p]\n",
                    code_block_addr, code_end_addr, last_code_addr, last_end_addr);
-            ABORT("New entry is before last table entry"); 
+            DIE(("New entry is before last table entry")); 
         }
     }
 

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_metadata.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_metadata.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_metadata.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_metadata.cpp Fri Apr 18 00:26:23 2008
@@ -126,8 +126,7 @@
  
   unsigned int num_alloced = metadata->num_alloc_segs;
   if(num_alloced == GC_METADATA_SEGMENT_NUM){
-    DIE2("gc.verbose","Warning: Run out GC metadata, please give it more segments!");
-    exit(0);
+    DIE(("GC: Run out GC metadata, please give it more segments!"));
   }
 
   unsigned int seg_size =  GC_METADATA_EXTEND_SIZE_BYTES + METADATA_BLOCK_SIZE_BYTES;
@@ -651,6 +650,7 @@
 
 void free_set_pool_put_entry(Vector_Block* block, GC_Metadata *metadata)
 { pool_put_entry(metadata->free_set_pool, block); }
+
 
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_options.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_options.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_options.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_options.cpp Fri Apr 18 00:26:23 2008
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
+#define LOG_DOMAIN "gc.base"
 #include "gc_common.h"
 #include "open/vm_properties.h"
 
@@ -87,7 +87,7 @@
     GC_PROP |= ALGO_MS_NORMAL;
     gc = gc_ms_create();
   }else{
-    WARN2("gc.base","\nWarning: GC algorithm setting incorrect. Will use default value.\n");
+    WARN(("\nGC algorithm setting incorrect. Will use default value.\n"));
     GC_PROP |= ALGO_COMPACT_MOVE;
     gc = gc_mc_create();  
   }
@@ -99,8 +99,7 @@
 {
     assert(property_name);
     if(!vm_property_is_set(property_name, VM_PROPERTIES)) {
-        DIE2("gc.base","Warning: property value "<<property_name<<"is not set!");
-        exit(0);
+        DIE(("Property value %s is not set!", property_name));
     }
 
     return vm_property_get_integer(property_name, 0, VM_PROPERTIES);
@@ -110,8 +109,7 @@
 {
   assert(property_name);
   if (!vm_property_is_set(property_name, VM_PROPERTIES)){
-    DIE2("gc.base","Warning: property value "<<property_name<<" is not set!");
-    exit(0);
+        DIE(("Property value %s is not set!", property_name));
   }
 
   return vm_property_get_boolean(property_name, FALSE, VM_PROPERTIES);
@@ -121,8 +119,7 @@
 {
     assert(property_name);
     if(!vm_property_is_set(property_name, VM_PROPERTIES)) {
-        DIE2("gc.base","Warning: property value "<<property_name<<" is not set!");
-        exit(0);
+        DIE(("Property value %s is not set!", property_name));
     }
 
     return vm_property_get_size(property_name, 0, VM_PROPERTIES);
@@ -163,7 +160,7 @@
 
   if(unique_algo){
     if(minor_algo || major_algo){
-      WARN2("gc.base","Warning: generational options cannot be set with unique_algo, ignored.");
+      WARN(("Generational options cannot be set with unique_algo, ignored."));
     }
     gc = gc_decide_collection_algo(unique_algo, has_los);
     vm_properties_destroy_value(unique_algo);  
@@ -207,11 +204,11 @@
 
     if (max_heap_size < min_heap_size){
       max_heap_size = min_heap_size;
-      WARN2("gc.base","Warning: Max heap size you set is too small, reset to "<<max_heap_size/MB<<" MB!");
+      WARN(("Max heap size you set is too small, reset to %dMB", max_heap_size/MB));
     }
     if (0 == max_heap_size){
       max_heap_size = HEAP_SIZE_DEFAULT;
-      WARN2("gc.base","Warning: Max heap size you set euqals to zero, reset to "<<max_heap_size/MB<<" MB!");
+      WARN(("Max heap size you set equals to zero, reset to %dMB", max_heap_size/MB));
     }
  
     min_heap_size = max_heap_size / 10;
@@ -225,13 +222,13 @@
     min_heap_size = vm_property_get_size("gc.ms");
     if (min_heap_size < min_heap_size_bytes){
       min_heap_size = min_heap_size_bytes;
-      WARN2("gc.base","Warning: Min heap size you set is too small, reset to "<<min_heap_size/MB<<" MB!");
+      WARN(("Min heap size you set is too small, reset to %dMB", min_heap_size/MB));
     } 
   }
 
   if (min_heap_size > max_heap_size){
     max_heap_size = min_heap_size;
-    WARN2("gc.base","Warning: Max heap size is too small, reset to "<<max_heap_size/MB<<" MB!");
+    WARN(("Max heap size is too small, reset to %dMB", max_heap_size/MB));
   }
 
   min_heap_size_bytes = min_heap_size;
@@ -360,14 +357,14 @@
   if(vm_property_is_set("gc.prefetch_distance",VM_PROPERTIES)==1) {
     PREFETCH_DISTANCE = vm_property_get_size("gc.prefetch_distance");
     if(!PREFETCH_ENABLED) {
-      WARN2("gc.prefetch_distance","Warning: Prefetch distance set with Prefetch disabled!");
+      WARN(("Prefetch distance set with Prefetch disabled!"));
     }
   }
 
   if(vm_property_is_set("gc.prefetch_stride",VM_PROPERTIES)==1) {
     PREFETCH_STRIDE = vm_property_get_size("gc.prefetch_stride");
     if(!PREFETCH_ENABLED) {
-      WARN2("gc.prefetch_stride","Warning: Prefetch stride set  with Prefetch disabled!");
+      WARN(("Prefetch stride set  with Prefetch disabled!"));
     }  
   }
   

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/large_pages.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/large_pages.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/large_pages.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/large_pages.cpp Fri Apr 18 00:26:23 2008
@@ -18,6 +18,7 @@
 /**
  * @author Yu-Nan He, 2007/01/18
  */
+#define LOG_DOMAIN "gc.base"
 #include "gc_common.h"
 char* large_page_hint = NULL;
 
@@ -68,15 +69,15 @@
     alloc_addr = VirtualAlloc(NULL, size, MEM_RESERVE | MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE);    
     release_lock_memory_priv();    
     if(alloc_addr == NULL){
-      WARN2("gc.base","GC large_page: No required number of large pages found. Please reboot.....\n");
+      WARN(("GC large_page: No required number of large pages found. Please reboot.....\n"));
       return NULL;
     }else
       return alloc_addr;
   }else{
-    WARN2("gc.base","GC large_page: Check that you have permissions:");
-    WARN2("gc.base","GC large_page: Control Panel->Administrative Tools->Local Security Settings->->User Rights Assignment->Lock pages in memory;");
-    WARN2("gc.base","GC large_page: Start VM as soon after reboot as possible, because large pages become fragmented and unusable after a while;");
-    WARN2("gc.base","GC large_page: Heap size should be multiple of large page size.");
+    WARN(("GC large_page: Check that you have permissions:"));
+    WARN(("GC large_page: Control Panel->Administrative Tools->Local Security Settings->->User Rights Assignment->Lock pages in memory."));
+    WARN(("GC large_page: Start VM as soon after reboot as possible, because large pages become fragmented and unusable after a while."));
+    WARN(("GC large_page: Heap size should be multiple of large page size."));
     return NULL;
   }
 }
@@ -107,7 +108,7 @@
 static void parse_proc_meminfo(size_t required_size){
   FILE* f = fopen("/proc/meminfo", "r");
   if (f == NULL){
-    WARN2("gc.base","GC large_page: Can't open /proc/meminfo");
+    WARN(("GC large_page: Can't open /proc/meminfo"));
     return;
   }
 
@@ -124,18 +125,18 @@
   if (buf) free(buf);
   
   if (proc_huge_pages_total == (size_t)-1){
-    WARN2("gc.base","GC large_page: Large pages are not supported by kernel.");
-    WARN2("gc.base","GC large_page: CONFIG_HUGETLB_PAGE and CONFIG_HUGETLBFS needs to be enabled.");
+    WARN(("GC large_page: Large pages are not supported by kernel."));
+    WARN(("GC large_page: CONFIG_HUGETLB_PAGE and CONFIG_HUGETLBFS needs to be enabled."));
   } else if (proc_huge_pages_total == 0){
-    WARN2("gc.base","GC large_page: No large pages reserved,  Use following command: echo num> /proc/sys/vm/nr_hugepages.");
-    WARN2("gc.base","GC large_page: Do it just after kernel boot before huge pages become fragmented.");
+    WARN(("GC large_page: No large pages reserved,  Use following command: echo num> /proc/sys/vm/nr_hugepages."));
+    WARN(("GC large_page: Do it just after kernel boot before huge pages become fragmented."));
   } else if (proc_huge_pages_free * proc_huge_page_size < required_size) {
     if (proc_huge_pages_total * proc_huge_page_size >= required_size) {
-      WARN2("gc.base","GC large_page: Not enough free large pages, some of reserved space is already busy.");
+      WARN(("GC large_page: Not enough free large pages, some of reserved space is already busy."));
     } else {
-      WARN2("gc.base","GC large_page: Not enough free large pages, some of reserved space is already busy.");
+      WARN(("GC large_page: Not enough free large pages, some of reserved space is already busy."));
     }
-    WARN2("gc.base","GC large_page: Large pages can be only allocated.");
+    WARN(("GC large_page: Large pages can be only allocated."));
   }
 }
 
@@ -150,9 +151,9 @@
 
   int fd = open(buf, O_CREAT | O_RDWR, 0700);
   if (fd == -1){
-    WARN2("gc.base","GC large_page: Can't open Mount hugetlbfs with: mount none /mnt/huge -t hugetlbfsi.");
-    WARN2("gc.base","GC large_page: Check you have appropriate permissions to /mnt/huge.");
-    WARN2("gc.base","GC large_page: Use command line switch -Dgc.lp=/mnt/huge.");
+    WARN(("GC large_page: Can't open Mount hugetlbfs with: mount none /mnt/huge -t hugetlbfsi."));
+    WARN(("GC large_page: Check you have appropriate permissions to /mnt/huge."));
+    WARN(("GC large_page: Use command line switch -Dgc.lp=/mnt/huge."));
     free(buf);
     return NULL;
   }
@@ -160,7 +161,7 @@
 
   void* addr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
   if (addr == MAP_FAILED){
-    WARN2("gc.base","GC large_page: Map failed.");
+    WARN(("GC large_page: Map failed."));
     close(fd);
     free(buf);
     return NULL;
@@ -174,7 +175,7 @@
   parse_proc_meminfo(size);
   void* alloc_addr = mmap_large_pages(size, hint);
   if(alloc_addr == NULL){
-    WARN2("gc.base","GC large_page: Large pages allocation failed.");
+    WARN(("GC large_page: Large pages allocation failed."));
     return NULL;
   }
   return alloc_addr;

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/gen/gen.cpp Fri Apr 18 00:26:23 2008
@@ -18,7 +18,7 @@
 /**
  * @author Xiao-Feng Li, 2006/10/05
  */
-
+#define LOG_DOMAIN "gc.base"
 #include "gen.h"
 #include "../finalizer_weakref/finalizer_weakref.h"
 #include "../verify/verify_live_heap.h"
@@ -192,18 +192,17 @@
     if(large_page_hint){
       reserved_base = alloc_large_pages(max_heap_size, large_page_hint);
       if(reserved_base){
-        WARN2("gc.base","GC use large pages.");
+        WARN(("GC use large pages."));
       } else {
         free(large_page_hint);
         large_page_hint = NULL;
-        WARN2("gc.base","GC use small pages.");
+        WARN(("GC use small pages."));
       }
     }
   
   if(reserved_base == NULL){
     if(max_heap_size < min_heap_size){
-      DIE2("gc.base","Max heap size is smaller than min heap size. Please choose other values.");
-      exit(0);
+      DIE(("Max heap size is smaller than min heap size. Please choose other values."));
     }
 
     unsigned int max_size_reduced = 0;
@@ -217,7 +216,7 @@
     physical_start = reserved_base;
     
     if(max_size_reduced){
-      DIE2("gc.base","Max heap size: can't be reserved. The max size can be reserved is "<< max_heap_size/MB<<" MB. ");
+      DIE(("Max heap size: can't be reserved. The max size can be reserved is %dMB", max_heap_size/MB));
       exit(0);
     }
     
@@ -487,7 +486,7 @@
       GC_PROP |= ALGO_COPY_SEMISPACE;
     
     }else {
-      WARN2("gc.base","\nWarning: GC algorithm setting incorrect. Will use default value.\n");
+      WARN(("GC algorithm setting incorrect. Will use default value.\n"));
       use_default = TRUE;
     }
   }
@@ -510,7 +509,7 @@
       GC_PROP |= ALGO_MARKSWEEP;
     
     }else{
-     WARN2("gc.base","\nWarning: GC algorithm setting incorrect. Will use default value.\n");
+     WARN(("GC algorithm setting incorrect. Will use default value.\n"));
      use_default = TRUE; 
     }
   }
@@ -887,9 +886,7 @@
   }
   
   if( gc->collect_result == FALSE){
-    DIE2("gc.collect", "Out of Memory!\n");
-    assert(0);
-    exit(0);
+    DIE(("Out of Memory while collecting!\n"));
   }
   
   nos_reset_after_collection(nos);

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect_compact.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect_compact.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect_compact.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_collect_compact.cpp Fri Apr 18 00:26:23 2008
@@ -292,8 +292,7 @@
     TRACE2("gc.process", "\nGC: end of move compact algo ... \n");
 
   }else{
-    DIE2("gc.collect", "The speficied major collection algorithm doesn't exist!");
-    exit(0);
+    DIE(("GC: The speficied major collection algorithm doesn't exist!"));
   }
 
   if((!LOS_ADJUST_BOUNDARY)&&(kind != TRANS_NOTHING) ) {

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_extend_compact.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_extend_compact.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_extend_compact.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_extend_compact.cpp Fri Apr 18 00:26:23 2008
@@ -283,7 +283,7 @@
   old_num = atomic_inc32(&num_space_changing_collectors);
   if( ++old_num == num_active_collectors ){
      if(NOS_SIZE) /* when NOS_SIZE is speficied, it can't be shrunk. */
-       WARN2("gc.process", "GC: collector["<<((POINTER_SIZE_INT)collector->thread_handle)<<"]: MOS is overflowed, have to reduce NOS size.");
+       WARN(("GC: collector[%p]: MOS is overflowed, have to reduce NOS size.", ((POINTER_SIZE_INT)collector->thread_handle)));
      Block *old_nos_boundary = nspace->blocks;
      nos_boundary = &mspace->blocks[mspace->free_block_idx - mspace->first_block_idx];
      if(nspace->num_managed_blocks != 0) /* FIXME:: why can it be 0 here?? Because mspace extend can't happen is NOS is zero size */

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/semi_space/sspace.cpp Fri Apr 18 00:26:23 2008
@@ -39,9 +39,9 @@
     if( TOSPACE_SIZE != 0 ) TOSPACE_SIZE -= 1; 
 
     if( TOSPACE_SIZE >= MB ){
-      WARN2("gc.init", "TOSPACE_SIZE is too big, set it to be " << TOSPACE_SIZE/MB << "MB");
+        WARN(("GC Init: TOSPACE_SIZE is too big, set it to be %dMB", TOSPACE_SIZE/MB));
     }else{
-      WARN2("gc.init", "TOSPACE_SIZE is too big, set it to be " << TOSPACE_SIZE/KB << "KB");
+        WARN(("GC Init: TOSPACE_SIZE is too big, set it to be %dKB", TOSPACE_SIZE/KB));
     }
   }
 

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_defs.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_defs.h?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_defs.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_defs.h Fri Apr 18 00:26:23 2008
@@ -22,8 +22,6 @@
  * @file
  * Major interpreter-related definitions.
  */
-
-#define LOG_DOMAIN "interpreter.unspecified"
 #include "cxxlog.h"
 #include "vm_log.h"
 

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_em64t.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_em64t.cpp Fri Apr 18 00:26:23 2008
@@ -33,9 +33,6 @@
 
 
 
-// ppervov: HACK: allows using STL modifiers (dec/hex) and special constants (endl)
-using namespace std;
-
 extern "C" {
     int64 invokeJNI(uint64 *args, uword n_fps, uword n_stacks, GenericFunctionPointer f);
 }
@@ -174,7 +171,7 @@
                 }
 
             default:
-                ABORT("Unexpected java type");
+                DIE(("Unexpected java type"));
         }
     }
 //    assert(argId <= sz + 2);
@@ -246,7 +243,7 @@
             break;
 
         default:
-            ABORT("Unexpected java type");
+            DIE(("Unexpected java type"));
     }
 
     if (exn_raised()) {
@@ -404,7 +401,7 @@
                 break;
 
             default:
-                ABORT("Unexpected java type");
+                DIE(("Unexpected java type"));
         }
     }
     assert(*mtype == ')');
@@ -540,7 +537,7 @@
             break;
 
         default:
-            ABORT("Unexpected java type");
+            DIE(("Unexpected java type"));
     }
 
     if (method->is_synchronized()) {
@@ -682,7 +679,7 @@
                 pos -= 2;
                 break;
             default:
-                ABORT("Unexpected java type");
+                DIE(("Unexpected java type"));
         }
     }
     assert(*mtype == ')');
@@ -819,7 +816,7 @@
             break;
 
         default:
-            ABORT("Unexpected java type");
+            DIE(("Unexpected java type"));
     }
 
     if (method->is_synchronized()) {

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ia32.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ia32.cpp Fri Apr 18 00:26:23 2008
@@ -148,7 +148,7 @@
                 arg_words[argId++] = val.v[1].i;
                 break;
             default:
-                ABORT("Invalid java type");
+                DIE(("Invalid java type"));
         }
     }
     assert(argId <= sz + 2);
@@ -222,7 +222,7 @@
             break;
 
         default:
-            ABORT("Invalid java type");
+            DIE(("Invalid java type"));
     }
 
     if (exn_raised()) {
@@ -320,7 +320,7 @@
                 pos -= 2;
                 break;
             default:
-                ABORT("Invalid java type");
+                DIE(("Invalid java type"));
         }
     }
     assert(*mtype == ')');
@@ -454,7 +454,7 @@
             break;
 
         default:
-            ABORT("Invalid java type");
+            DIE(("Invalid java type"));
     }
 
     if (method->is_synchronized()) {
@@ -541,7 +541,7 @@
                 pos -= 2;
                 break;
             default:
-                ABORT("Invalid java type");
+                DIE(("Invalid java type"));
         }
     }
     assert(*mtype == ')');
@@ -676,7 +676,7 @@
             break;
 
         default:
-            ABORT("Invalid java type");
+            DIE(("Invalid java type"));
     }
 
     if (method->is_synchronized()) {

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ipf.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ipf.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ipf.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_native_ipf.cpp Fri Apr 18 00:26:23 2008
@@ -32,9 +32,6 @@
 
 
 
-// ppervov: HACK: allows using STL modifiers (dec/hex) and special constants (endl)
-using namespace std;
-
 /* implementation of "get_stacked_register_address" for interpreter */
 uint64* interpreter_get_stacked_register_address(uint64* bsp, unsigned reg) {
     M2nFrame *m2n = (M2nFrame*) bsp;

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_stack_trace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_stack_trace.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_stack_trace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_stack_trace.cpp Fri Apr 18 00:26:23 2008
@@ -29,9 +29,6 @@
 #include "vtable.h"
 #include "jit_import_rt.h"
 
-// ppervov: HACK: allows using STL modifiers (dec/hex) and special constants (endl)
-using namespace std;
-
 typedef struct StackFrame StackIterator_interp;
 
 static inline StackIterator_interp*
@@ -179,12 +176,12 @@
 
         if (si->This) {
             vm_enumerate_root_reference((void**)&si->This, FALSE);
-            DEBUG_GC("  [THIS]: " << si->This->vt()->clss->get_name()->bytes << endl);
+            DEBUG_GC("  [THIS]: " << si->This);
         }
 
         if (si->exc) {
             vm_enumerate_root_reference((void**)&si->exc, FALSE);
-            DEBUG_GC("  [EXCEPTION]: " << si->exc->vt()->clss->get_name()->bytes << endl);
+            DEBUG_GC("  [EXCEPTION]: " << si->exc);
         }
 
         if (method->is_native()) {
@@ -205,7 +202,7 @@
                     if (obj == 0) {
                         DEBUG_GC("NULL");
                     } else {
-                        DEBUG_GC(obj->vt()->clss->get_name()->bytes << endl);
+                        DEBUG_GC(obj);
                         vm_enumerate(ref, FALSE); // CHECK!!! can we enumerate uncompressed ref in compressed mode
                     }
                 }
@@ -221,7 +218,7 @@
                     if (obj == 0) {
                         DEBUG_GC("NULL\n");
                     } else {
-                        DEBUG_GC(obj->vt()->clss->get_name()->bytes << endl);
+                        DEBUG_GC(obj);
                         vm_enumerate(ref, FALSE); // CHECK!!! can we enumerate uncompressed ref in compressed mode
                     }
                 }
@@ -270,7 +267,7 @@
                     (void**)&si->This, si->This,
                     JVMTI_HEAP_ROOT_STACK_LOCAL,
                     depth, method_id, slot++);
-            DEBUG_GC("  [THIS]: " << si->This->vt()->clss->get_name()->bytes << endl);
+            DEBUG_GC("  [THIS]: " << si->This);
         }
 
         if (si->exc) {
@@ -278,7 +275,7 @@
                 (void**)&si->exc, si->exc,
                 JVMTI_HEAP_ROOT_STACK_LOCAL,
                 depth, method_id, slot++);
-            DEBUG_GC("  [EXCEPTION]: " << si->exc->vt()->clss->get_name()->bytes << endl);
+            DEBUG_GC("  [EXCEPTION]: " << si->exc);
         }
 
         if (method->is_native()) {
@@ -299,7 +296,7 @@
                     if (obj == 0) {
                         DEBUG_GC("NULL");
                     } else {
-                        DEBUG_GC(obj->vt()->clss->get_name()->bytes << endl);
+                        DEBUG_GC(obj);
                         vm_ti_enumerate_stack_root(ti_env,
                             ref, (Managed_Object_Handle)obj, 
                             JVMTI_HEAP_ROOT_STACK_LOCAL,
@@ -318,7 +315,7 @@
                     if (obj == 0) {
                         DEBUG_GC("NULL\n");
                     } else {
-                        DEBUG_GC(obj->vt()->clss->get_name()->bytes << endl);
+                        DEBUG_GC(obj);
                         vm_ti_enumerate_stack_root(ti_env,
                             ref, (Managed_Object_Handle)obj, 
                             JVMTI_HEAP_ROOT_STACK_LOCAL,

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_vm_helpers.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_vm_helpers.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_vm_helpers.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_vm_helpers.cpp Fri Apr 18 00:26:23 2008
@@ -26,9 +26,7 @@
 #include "interp_native.h"
 #include "exceptions.h"
 #include "compile.h"
-#include "cxxlog.h"
 #include "interp_defs.h"
-#include "vtable.h"
 
 void interp_throw_exception(const char* exc_name) {
     M2N_ALLOC_MACRO;

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp Fri Apr 18 00:26:23 2008
@@ -43,9 +43,6 @@
 #define isnan _isnan
 #endif
 
-// ppervov: HACK: allows using STL modifiers (dec/hex) and special constants (endl)
-using namespace std;
-
 bool interpreter_enable_debug = true;
 int interpreter_enable_debug_trigger = -1;
 
@@ -971,19 +968,19 @@
 #ifndef NDEBUG
     switch(cp.get_tag(index)) {
         case CONSTANT_String:
-            DEBUG_BYTECODE("#" << dec << (int)index << " String: \"" << cp.get_string_chars(index) << "\"");
+            DEBUG_BYTECODE("#" << (int)index << " String: \"" << cp.get_string_chars(index) << "\"");
             break;
         case CONSTANT_Integer:
-            DEBUG_BYTECODE("#" << dec << (int)index << " Integer: " << (int)cp.get_int(index));
+            DEBUG_BYTECODE("#" << (int)index << " Integer: " << (int)cp.get_int(index));
             break;
         case CONSTANT_Float:
-            DEBUG_BYTECODE("#" << dec << (int)index << " Float: " << cp.get_float(index));
+            DEBUG_BYTECODE("#" << (int)index << " Float: " << cp.get_float(index));
             break;
         case CONSTANT_Class:
-            DEBUG_BYTECODE("#" << dec << (int)index << " Class: \"" << class_cp_get_class_name(clazz, index) << "\"");
+            DEBUG_BYTECODE("#" << (int)index << " Class: \"" << class_cp_get_class_name(clazz, index) << "\"");
             break;
         default:
-            DEBUG_BYTECODE("#" << dec << (int)index << " Unknown type = " << cp.get_tag(index));
+            DEBUG_BYTECODE("#" << (int)index << " Unknown type = " << cp.get_tag(index));
             LDIE(4, "ldc instruction: unexpected type ({0}) of constant pool entry [{1}]"
                  << cp.get_tag(index) << index);
             break;
@@ -1042,7 +1039,7 @@
     val.u64 = ((uint64)cp.get_8byte_high_word(index) << 32)
         | cp.get_8byte_low_word(index);
     frame.stack.setLong(0, val);
-    DEBUG_BYTECODE("#" << dec << (int)index << " (val = " << hex << val.d << ")");
+    DEBUG_BYTECODE("#" << (int)index << " (val = " << val.d << ")");
     frame.ip += 3;
 }
 
@@ -1074,7 +1071,7 @@
         case AR_SHORT:   clazz = env->ArrayOfShort_Class; break;
         case AR_INT:     clazz = env->ArrayOfInt_Class; break;
         case AR_LONG:    clazz = env->ArrayOfLong_Class; break;
-        default: ABORT("Invalid array type");
+        default: DIE(("Invalid array type"));
     }
     assert(clazz);
 
@@ -1095,7 +1092,7 @@
     }
    
     frame.stack.pick().ref = COMPRESS_INTERP((ManagedObject*)array);
-    DEBUG_BYTECODE(" (val = " << hex << (int)frame.stack.pick().i << ")");
+    DEBUG_BYTECODE(" (val = " << (int)frame.stack.pick().i << ")");
     frame.stack.ref() = FLAG_OBJECT;
     frame.ip += 2;
 }
@@ -1125,7 +1122,7 @@
     }
 
     set_vector_length(array, length);
-    DEBUG_BYTECODE("length = " << dec << length);
+    DEBUG_BYTECODE("length = " << length);
 
     frame.stack.pick().ref = COMPRESS_INTERP((ManagedObject*)array);
     frame.stack.ref() = FLAG_OBJECT;
@@ -1232,7 +1229,7 @@
     }
 
     frame.stack.popClearRef(depth - 1);
-    DEBUG_BYTECODE(" (val = " << hex << (int)frame.stack.pick().i << ")");
+    DEBUG_BYTECODE(" (val = " << (int)frame.stack.pick().i << ")");
     frame.ip += 4;
 }
 
@@ -1264,7 +1261,7 @@
     frame.stack.push();
 
     frame.stack.pick().ref = COMPRESS_INTERP(obj);
-    DEBUG_BYTECODE(" (val = " << hex << (int)frame.stack.pick().i << ")");
+    DEBUG_BYTECODE(" (val = " << (int)frame.stack.pick().i << ")");
     frame.stack.ref() = FLAG_OBJECT;
     frame.ip += 3;
 }
@@ -1408,7 +1405,7 @@
 
     frame.stack.ref() = FLAG_NONE;
     frame.stack.pick().i = get_vector_length((Vector_Handle)ref);
-    DEBUG_BYTECODE("length = " << dec << frame.stack.pick().i);
+    DEBUG_BYTECODE("length = " << frame.stack.pick().i);
     frame.ip++;
 }
 
@@ -1423,7 +1420,7 @@
     uint32 length = get_vector_length(array);
     uint32 pos = frame.stack.pick(0).u;
 
-    DEBUG_BYTECODE("length = " << dec << (int)length << " pos = " << (int)pos);
+    DEBUG_BYTECODE("length = " << (int)length << " pos = " << (int)pos);
 
     if (pos >= length) {
         throwAIOOBE(pos);
@@ -1454,7 +1451,7 @@
     uint32 length = get_vector_length(array);                                   \
     uint32 pos = frame.stack.pick(0).u;                                         \
                                                                                 \
-    DEBUG_BYTECODE("length = " << dec << (int)length << " pos = " << (int)pos); \
+    DEBUG_BYTECODE("length = " << (int)length << " pos = " << (int)pos); \
                                                                                 \
     if (pos >= length) {                                                        \
         throwAIOOBE(pos);                                                       \
@@ -1486,7 +1483,7 @@
     uint32 length = get_vector_length(array);
     uint32 pos = frame.stack.pick(0).u;
 
-    DEBUG_BYTECODE("length = " << dec << (int)length << " pos = " << (int)pos);
+    DEBUG_BYTECODE("length = " << (int)length << " pos = " << (int)pos);
 
     if (pos >= length) {
         throwAIOOBE(pos);
@@ -1511,7 +1508,7 @@
     uint32 length = get_vector_length(array);
     uint32 pos = frame.stack.pick(1).u;
 
-    DEBUG_BYTECODE("length = " << dec << (int)length << " pos = " << (int)pos);
+    DEBUG_BYTECODE("length = " << (int)length << " pos = " << (int)pos);
 
     if (pos >= length) {
         throwAIOOBE(pos);
@@ -1552,7 +1549,7 @@
     uint32 length = get_vector_length(array);                                   \
     uint32 pos = frame.stack.pick(1).u;                                         \
                                                                                 \
-    DEBUG_BYTECODE("length = " << dec << (int)length << " pos = " << (int)pos); \
+    DEBUG_BYTECODE("length = " << (int)length << " pos = " << (int)pos); \
                                                                                 \
     if (pos >= length) {                                                        \
         throwAIOOBE(pos);                                                       \
@@ -1592,7 +1589,7 @@
     uint32 length = get_vector_length(array);
     uint32 pos = frame.stack.pick(2).u;
 
-    DEBUG_BYTECODE("length = " << dec << (int)length << " pos = " << (int)pos);
+    DEBUG_BYTECODE("length = " << (int)length << " pos = " << (int)pos);
 
     if (pos >= length) {
         /* FIXME ivan 20041005: array index out of bounds exception */
@@ -1641,7 +1638,7 @@
     void* addr = field_get_address(field);
 
     DEBUG_BYTECODE(field->get_name()->bytes << " " << field->get_descriptor()->bytes
-            << " (val = " << hex << (int)frame.stack.pick().i << ")");
+            << " (val = " << (int)frame.stack.pick().i << ")");
 
     switch (field->get_java_type()) {
 #ifdef COMPACT_FIELDS // use compact fields on ipf
@@ -1701,7 +1698,7 @@
             }
 
         default:
-            ABORT("Unexpected data type");
+            DIE(("Unexpected data type"));
     }
     frame.ip += 3;
 }
@@ -1782,10 +1779,10 @@
             }
 
         default:
-            ABORT("Unexpected data type");
+            DIE(("Unexpected data type"));
     }
     DEBUG_BYTECODE(field->get_name()->bytes << " " << field->get_descriptor()->bytes
-            << " (val = " << hex << (int)frame.stack.pick().i << ")");
+            << " (val = " << (int)frame.stack.pick().i << ")");
     frame.ip += 3;
 }
 
@@ -1811,7 +1808,7 @@
     }
 
     DEBUG_BYTECODE(field->get_name()->bytes << " " << field->get_descriptor()->bytes
-            << " (val = " << hex << (int)frame.stack.pick().i << ")");
+            << " (val = " << (int)frame.stack.pick().i << ")");
 
     uint16 obj_ref_pos = 1;
 
@@ -1899,7 +1896,7 @@
             }
 
         default:
-            ABORT("Unexpected data type");
+            DIE(("Unexpected data type"));
     }
     frame.ip += 3;
 }
@@ -1980,10 +1977,10 @@
             }
 
         default:
-            ABORT("Unexpected data type");
+            DIE(("Unexpected data type"));
     }
     DEBUG_BYTECODE(field->get_name()->bytes << " " << field->get_descriptor()->bytes
-            << " (val = " << hex << (int)frame.stack.pick().i << ")");
+            << " (val = " << (int)frame.stack.pick().i << ")");
 
     frame.ip += 3;
 }
@@ -1996,9 +1993,7 @@
     Method *method = interp_resolve_virtual_method(clazz, methodId);
     if (!method) return; // exception
 
-    DEBUG_BYTECODE(class_get_name(method_get_class(method)) << "."
-            << method->get_name()->bytes << "/"
-            << method->get_descriptor()->bytes<< endl);
+    DEBUG_BYTECODE(method);
 
     hythread_exception_safe_point();
     if(check_current_thread_exception()) {
@@ -2016,9 +2011,7 @@
     Method *method = interp_resolve_interface_method(clazz, methodId);
     if (!method) return; // exception
     
-    DEBUG_BYTECODE(class_get_name(method_get_class(method)) << "."
-            << method->get_name()->bytes << "/"
-            << method->get_descriptor()->bytes << endl);
+    DEBUG_BYTECODE(method);
 
     hythread_exception_safe_point();
     if(check_current_thread_exception()) {
@@ -2036,9 +2029,7 @@
     Method *method = interp_resolve_static_method(clazz, methodId);
     if (!method) return; // exception
 
-    DEBUG_BYTECODE(class_get_name(method_get_class(method)) << "."
-            << method->get_name()->bytes << "/"
-            << method->get_descriptor()->bytes << endl);
+    DEBUG_BYTECODE(method);
 
     // FIXME: is it possible to move the code into !cp_is_resolved condition above?
     class_initialize(method->get_class());
@@ -2060,9 +2051,7 @@
     Method *method = interp_resolve_special_method(clazz, methodId);
     if (!method) return; // exception
     
-    DEBUG_BYTECODE(class_get_name(method_get_class(method)) << "."
-            << method->get_name()->bytes << "/"
-             << method->get_descriptor()->bytes << endl);
+    DEBUG_BYTECODE(method);
 
     hythread_exception_safe_point();
     if (check_current_thread_exception()) {
@@ -2268,7 +2257,7 @@
         interp_throw_exception("java/lang/VerifyError");
         return;
     }
-    DEBUG_BYTECODE(" " << obj->vt()->clss->get_name()->bytes << endl);
+    DEBUG_BYTECODE(obj);
     assert(!hythread_is_suspend_enabled());
     set_current_thread_exception(obj);
 }
@@ -2280,13 +2269,10 @@
 
     Method *m = frame.method;
     DEBUG_BYTECODE("Searching for exception handler:");
-    DEBUG_BYTECODE("   In "
-            << class_get_name(method_get_class(m)) << "/"
-            << m->get_name()->bytes
-            << m->get_descriptor()->bytes << endl);
+    DEBUG_BYTECODE("   In " << m);
 
     uint32 ip = (uint32)(frame.ip - (uint8*)m->get_byte_code_addr());
-    DEBUG_BYTECODE("ip = " << dec << (int)ip << endl);
+    DEBUG_BYTECODE("ip = " << (int)ip);
 
     // When VM is in shutdown stage we need to execute final block to
     // release monitors and propogate an exception to the upper frames.
@@ -2308,7 +2294,7 @@
         Handler *h = m->get_bc_exception_handler_info(i);
         DEBUG_BYTECODE("handler" << (int) i
                 << ": start_pc=" << (int) h->get_start_pc()
-                << " end_pc=" << (int) h->get_end_pc() << endl);
+                << " end_pc=" << (int) h->get_end_pc());
 
         if (ip < h->get_start_pc()) continue;
         if (ip >= h->get_end_pc()) continue;
@@ -2319,7 +2305,7 @@
             // 0 - is handler for all
             // if !0 - check if the handler catches this exception type
 
-            DEBUG_BYTECODE("catch type index = " << (int)catch_type_index << endl);
+            DEBUG_BYTECODE("catch type index = " << (int)catch_type_index);
 
             // WARNING: GC may occur here !!!
             Class *obj = interp_resolve_class(clazz, catch_type_index);
@@ -2342,7 +2328,7 @@
     Method *m = frame.method;
     Handler *h;
     if (findExceptionHandler(frame, exception, &h)){
-        DEBUG_BYTECODE("Exception caught: " << (*exception)->vt()->clss->get_name()->bytes << endl);
+        DEBUG_BYTECODE("Exception caught: " << (*exception));
         DEBUG_BYTECODE("Found handler!\n");
         frame.ip = (uint8*)m->get_byte_code_addr() + h->get_handler_pc();
         return true;
@@ -2501,7 +2487,7 @@
             break;
 
         default:
-            ABORT("Unexpected java type");
+            DIE(("Unexpected java type"));
     }
 
     method_exit_callback(method, false, val);
@@ -2515,10 +2501,7 @@
     int stackLength = 0;
     size_t available;
     
-    DEBUG_TRACE_PLAIN("interpreter: "
-            << class_get_name(method_get_class(frame.method))
-            << " " << frame.method->get_name()->bytes
-            << frame.method->get_descriptor()->bytes << endl);
+    DEBUG_TRACE_PLAIN("interpreter: " << frame.method);
 
     assert(frame.method->is_static() || frame.This);
     
@@ -2574,7 +2557,7 @@
     while (true) {
         ip0 = *frame.ip;
 
-        DEBUG_BYTECODE(endl << "(" << frame.stack.getIndex()
+        DEBUG_BYTECODE("\n(" << frame.stack.getIndex()
                    << ") " << opcodeNames[ip0] << ": ");
 
 restart:
@@ -2967,16 +2950,16 @@
                     case OPCODE_IINC: Opcode_WIDE_IINC(frame); break;
                     case OPCODE_RET: Opcode_WIDE_RET(frame); break;
                     default:
-                     DEBUG2("wide bytecode 0x" << hex << (int)*ip1 << " not implemented\n");
+                     DEBUG2("wide bytecode " << (int)*ip1 << " not implemented\n");
                      stackDump(stdout, frame);
-                     ABORT("Unexpected wide bytecode");
+                     DIE(("Unexpected wide bytecode"));
                 }
                 break;
             }
 
-            default: DEBUG2("bytecode 0x" << hex << (int)ip0 << " not implemented\n");
+            default: DEBUG2("bytecode " << (int)ip0 << " not implemented\n");
                      stackDump(stdout, frame);
-                     ABORT("Unexpected bytecode");
+                     DIE(("Unexpected bytecode"));
         }
         assert(&frame == getLastStackFrame());
         continue;
@@ -3095,10 +3078,7 @@
         return;
     }
 
-    DEBUG_TRACE("\n{{{ interpreter_invoke: "
-           << class_get_name(method_get_class(method)) << " "
-           << method->get_name()->bytes
-           << method->get_descriptor()->bytes << endl);
+    DEBUG_TRACE("\n{{{ interpreter_invoke: " << method);
 
     DEBUG("\tmax stack = " << method->get_max_stack() << endl);
     DEBUG("\tmax locals = " << method->get_max_locals() << endl);
@@ -3237,7 +3217,7 @@
             break;
 
         default:
-            ABORT("Unexpected java type");
+            DIE(("Unexpected java type"));
     }
     setLastStackFrame(frame.prev);
     DEBUG_TRACE("interpreter_invoke }}}\n");
@@ -3259,10 +3239,7 @@
         return;
     }
 
-    DEBUG_TRACE("\n{{{ invoke_static     : "
-           << class_get_name(method_get_class(method)) << " "
-           << method->get_name()->bytes
-           << method->get_descriptor()->bytes << endl);
+    DEBUG_TRACE("\n{{{ invoke_static     : " << method);
 
     DEBUG("\tmax stack = " << method->get_max_stack() << endl);
     DEBUG("\tmax locals = " << method->get_max_locals() << endl);
@@ -3328,7 +3305,7 @@
             break;
 
         default:
-            ABORT("Unexpected java type");
+            DIE(("Unexpected java type"));
     }
 
     setLastStackFrame(frame.prev);
@@ -3416,7 +3393,7 @@
             break;
 
         default:
-            ABORT("Unexpected java type");
+            DIE(("Unexpected java type"));
     }
 
     setLastStackFrame(frame.prev);
@@ -3440,17 +3417,14 @@
     method = objClass->get_method_from_vtable(method->get_index());
 
     if (method->is_abstract()) {
-        ostringstream str;
+        std::ostringstream str;
         str << class_get_name(method_get_class(method)) << "." <<
             method_get_name(method) << method_get_descriptor(method);
         throwAME(str.str().c_str());
         return;
     }
 
-    DEBUG_TRACE("\n{{{ invoke_virtual    : "
-           << class_get_name(method_get_class(method)) << " "
-           << method->get_name()->bytes
-           << method->get_descriptor()->bytes << endl);
+    DEBUG_TRACE("\n{{{ invoke_virtual    : " << method);
 
     interpreterInvoke(prevFrame, method, args, obj, false);
     DEBUG_TRACE("invoke_virtual }}}\n");
@@ -3487,7 +3461,7 @@
     method = found_method;
 
     if (method->is_abstract()) {
-        ostringstream str;
+        std::ostringstream str;
         str << class_get_name(method_get_class(method)) << "." <<
             method_get_name(method) << method_get_descriptor(method);
         throwAME(str.str().c_str());
@@ -3495,17 +3469,14 @@
     }
 
     if (!method->is_public()) {
-        ostringstream str;
+        std::ostringstream str;
         str << class_get_name(method_get_class(method)) << "." <<
             method_get_name(method) << method_get_descriptor(method);
         throwIAE(str.str().c_str());
         return;
     }
 
-    DEBUG_TRACE("\n{{{ invoke_interface  : "
-           << class_get_name(method_get_class(method)) << " "
-           << method->get_name()->bytes
-           << method->get_descriptor()->bytes << endl);
+    DEBUG_TRACE("\n{{{ invoke_interface  : " << method);
 
     interpreterInvoke(prevFrame, method, args, obj, true);
 
@@ -3524,7 +3495,7 @@
     }
 
     if (method->is_abstract()) {
-        ostringstream str;
+        std::ostringstream str;
         str << class_get_name(method_get_class(method)) << "." <<
             method_get_name(method) << method_get_descriptor(method);
         throwAME(str.str().c_str());
@@ -3548,10 +3519,7 @@
         return;
     }
 
-    DEBUG_TRACE("\n{{{ invoke_special    : "
-           << class_get_name(method_get_class(method)) << " "
-           << method->get_name()->bytes
-           << method->get_descriptor()->bytes << endl);
+    DEBUG_TRACE("\n{{{ invoke_special    : " << method);
 
     DEBUG("\tmax stack = " << method->get_max_stack() << endl);
     DEBUG("\tmax locals = " << method->get_max_locals() << endl);
@@ -3614,7 +3582,7 @@
             break;
 
         default:
-            ABORT("Unexpected java type");
+            DIE(("Unexpected java type"));
     }
     setLastStackFrame(frame.prev);
     DEBUG_TRACE("invoke_special }}}\n");

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter_ti.cpp Fri Apr 18 00:26:23 2008
@@ -602,7 +602,7 @@
         }
             break;
         default:
-            ABORT("Unexpected data type");
+            DIE(("Unexpected data type"));
     }
     return val;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/port/include/clog.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/clog.h?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/clog.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/clog.h Fri Apr 18 00:26:23 2008
@@ -14,118 +14,97 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
-* @author Roman S. Bushmanov
-* @version $Revision: 1.1.2.1.4.3 $
-*/  
+#ifndef _CLOG_H
+#define _CLOG_H
 
-#ifndef _C_LOG_H_
-#define _C_LOG_H_
-
-#include <assert.h>
+/**
+ * @file
+ * C logging macro definitions.
+ */
 #include "logger.h"
-#include "port_malloc.h"
 
-#define LOGGER_EXIT(code) { \
-    shutdown_log_system(); \
-    ::exit(code); \
-}
+/**
+ * Macro expansion. It is used, for example, to combine
+ * a filename and a line number in
+ * <code>__FILELINE__</code> macro.
+ */
+#define EXPAND_(a) # a
+#define EXPAND(a) EXPAND_(a)
+
+/**
+ * Expands to a function name.
+ */
+#define __FILELINE__ __FILE__ ":" EXPAND(__LINE__)
+
+#ifndef __PRETTY_FUNCTION__
+#   if defined(_MSC_VER) && (defined(__INTEL_COMPILER) || _MSC_VER >= 1300)
+#       define __PRETTY_FUNCTION__ __FUNCSIG__
+#   else
+#       define __PRETTY_FUNCTION__ __func__
+#   endif
+#endif
+
+#ifndef LOG_DOMAIN
+#define LOG_DOMAIN "harmonyvm"
+#endif
+
+/**
+ * Prints a simple string message to stdout and exits the program.
+ * This macro call works when logging subsystem is not yet fully
+ * initialized.
+ */
+#define DIE(message) { \
+    log_printf("[error] "); \
+    log_header(LOG_DOMAIN, __FILELINE__, __PRETTY_FUNCTION__); \
+    log_printf message; \
+    log_abort(); \
+}
+
+#define WARN(message) \
+    if (log_is_warn_enabled()) { \
+        log_printf("[warning] "); \
+        log_header(LOG_DOMAIN, __FILELINE__, __PRETTY_FUNCTION__); \
+        log_printf message; \
+        log_printf("\n"); \
+    }
+
+#define CTRACE(message) CTRACE2(LOG_DOMAIN, message)
+
+#define VERIFY(expr, message) \
+    if(!(expr)) { \
+        DIE(message); \
+    }
 
-#define DIE2(category, message) { \
-    const char* formatted = log_printf message; \
-    log4cxx_from_c(category, DIE, formatted, __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-    STD_FREE((void*)formatted); \
-    shutdown_log_system(); \
-    abort(); \
-}
-
-#define WARN2(category, message) { \
-    if (is_warn_enabled(category)) { \
-    const char* formatted = log_printf message; \
-    log4cxx_from_c(category, WARN, formatted, __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-    STD_FREE((void*)formatted); \
-    } \
+#define VERIFY_SUCCESS(func) { \
+    int ret = func; \
+    VERIFY(0 == ret, \
+        ("a call to " #func " returned a non-zero error code %d", ret)); \
 }
 
-#define INFO2(category, message) { \
-    if (is_info_enabled(category)) { \
-    const char* formatted = log_printf message; \
-    log4cxx_from_c(category, INFO, formatted, __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-    STD_FREE((void*)formatted); \
+#define LOG_SITE(level, category, out)  { \
+    static struct LogSite log_site = {LOG_UNKNOWN, NULL}; \
+    if (log_site.state && (log_site.state == LOG_ENABLED \
+    || log_cache(log_is_##level##_enabled(category), &log_site))) { \
+        out \
+        log_printf("\n"); \
     } \
 }
 
+/**
+ * Lightweight macro to replace a standard C <code>assert()</code>
+ * and debugging <code>printf</code>.   
+ */
 #ifdef NDEBUG
+#    define ASSERT(expr, message)
+#    define CTRACE2(category, message)
+#else
+#    define ASSERT(expr, message)  VERIFY(expr, message)
+#    define CTRACE2(category, message) LOG_SITE(trace, category, \
+        log_printf("[trace] "); \
+        log_header(category, __FILELINE__, __PRETTY_FUNCTION__); \
+        log_printf message; \
+    )
 
-#define LOG2(category, message) 
-#define TRACE2(category, message)
-
-#else // NDEBUG
-
-#define LOG2(category, message) { \
-    static LogSite logSite = {UNKNOWN, NULL}; \
-    if (logSite.state && is_log_enabled(category, &logSite)) { \
-    const char* formatted = log_printf message; \
-    log4cxx_from_c(category, LOG, formatted, __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-    STD_FREE((void*)formatted); \
-    } \
-}
-
-#define TRACE2(category, message) { \
-    static LogSite logSite = {UNKNOWN, NULL}; \
-    if (logSite.state && is_trace_enabled(category, &logSite)) { \
-    const char* formatted = log_printf message; \
-    log4cxx_from_c(category, TRACE, formatted, __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-    STD_FREE((void*)formatted); \
-    } \
-}
-
-
-#endif // NDEBUG
-
-#ifdef LOG_DOMAIN
-
-#define DIE(message) DIE2(LOG_DOMAIN, message)
-#define WARN(message) WARN2(LOG_DOMAIN, message)
-#define INFO(message) INFO2(LOG_DOMAIN, message)
-#define LOG(message) LOG2(LOG_DOMAIN, message)
-#define TRACE(message) TRACE2(LOG_DOMAIN, message)
-
-#ifdef NDEBUG
-
-#define VERIFY(expr, message) { \
-    if (!(expr)) { \
-    const char* formatted_msg = log_printf message; \
-    DIE(("Assertion failed: %s\n %s", #expr, formatted_msg)); \
-    STD_FREE((void*)formatted_msg); \
-    } \
-}
-#define ASSERT(expr, message)
-
-#else //NDEBUG
-
-#define VERIFY(expr, message) {\
-        if(!(expr)) { \
-        const char* formatted_msg = log_printf message; \
-        const char* complete_msg = log_printf("Internal error: %s failed\n%s", #expr, formatted_msg); \
-        log4cxx_from_c(LOG_DOMAIN, DIE, complete_msg, __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-        STD_FREE((void*)formatted_msg); \
-        STD_FREE((void*)complete_msg); \
-        shutdown_log_system(); \
-        assert(expr); \
-        }\
-}
-
-#define ASSERT(expr, message)  VERIFY(expr, message)
-
-#endif //NDEBUG 
-
-#define VERIFY_SUCCESS(func) { \
-    int ret = func; \
-    VERIFY(0 == ret, \
-        ("a call to " #func " returned a non-zero error code %d", ret)); \
-}
-
-#endif // LOG_DOMAIN
+#endif /* NDEBUG */
 
-#endif // _C_LOG_H_
+#endif /* _CLOG_H */

Modified: harmony/enhanced/drlvm/trunk/vm/port/include/cxxlog.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/cxxlog.h?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/cxxlog.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/cxxlog.h Fri Apr 18 00:26:23 2008
@@ -14,159 +14,64 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Alexey V. Varlamov, Evgueni Brevnov
- * @version $Revision: 1.1.2.2.4.4 $
- */  
-#ifndef _CXX_LOG_H_
-#define _CXX_LOG_H_
+#ifndef _CXXLOG_H
+#define _CXXLOG_H
 
-#include <assert.h>
-#include "logger.h"
+/**
+ * @file
+ * Additional C++ logging macro definitions.
+ */
+#include "clog.h"
 #include "loggerstring.h"
 #include "logparams.h"
-#include "log_macro.h"
 
-namespace util
-{
-    /**
-     * Predefined classloader filter.
-     */
-    const char CLASS_LOGGER[] = "class";
-    /**
-     * Predefined gc filter.
-     */
-    const char GC_LOGGER[] = "gc";
-    /**
-     * Predefined jni filter.
-     */
-    const char JNI_LOGGER[] = "jni";
-
-} // namespace util
-
-#define LOGGER_EXIT(code) { \
-    shutdown_log_system(); \
-    ::exit(code); \
-}
-
-#define ECHO(message) { \
-    LoggerString logger_string; \
-    logger_string << message; \
-    log4cxx_from_c("root", DIE, logger_string.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-}
-
-#define LECHO(message_number, messagedef_and_params) { \
-    LogParams log_params(0x4543484f, message_number); \
-    log_params << messagedef_and_params; \
-    log4cxx_from_c("root", DIE, log_params.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-}
-
-#define DIE2(category, message) { \
-    LoggerString logger_string; \
-    logger_string << message; \
-    log4cxx_from_c(category, DIE, logger_string.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-    shutdown_log_system(); \
-    ::abort(); \
-}
-
-#define LDIE2(category, message_number, messagedef_and_params) { \
+#define LDIE(message_number, messagedef_and_params) { \
     LogParams log_params(0x4c444945, message_number); \
     log_params << messagedef_and_params; \
-    log4cxx_from_c(category, DIE, log_params.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-    shutdown_log_system(); \
-    ::abort(); \
+    log_printf(log_params.release()); \
+    log_abort(); \
 }
 
-#define WARN2(category, message) { \
-    if (is_warn_enabled(category)) { \
-    LoggerString logger_string; \
-    logger_string << message; \
-    log4cxx_from_c(category, WARN, logger_string.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-    } \
-}
-
-#define LWARN2(category, message_number, messagedef_and_params) { \
-    if (is_warn_enabled(category)) { \
-    LogParams log_params(0x5741524e, message_number); \
-    log_params << messagedef_and_params; \
-    log4cxx_from_c(category, WARN, log_params.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-    } \
-}
-
-#define INFO2(category, message) { \
-    if (is_info_enabled(category)) { \
-    LoggerString logger_string; \
-    logger_string << message; \
-    log4cxx_from_c(category, INFO, logger_string.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-    } \
-}
-
-#ifdef NDEBUG
+#define LWARN(message_number, messagedef_and_params) \
+    if (log_is_warn_enabled()) { \
+        LogParams log_params(0x5741524e, message_number); \
+        log_params << messagedef_and_params; \
+        log_printf(log_params.release()); \
+    }
 
-#if defined(_MSC_VER) && !defined (__INTEL_COMPILER) //MS compiler
-#pragma warning (disable:4390) 
-#endif
-
-#define LOG2(category, message) 
-#define TRACE2(category, message)
-
-#else // NDEBUG
-
-#define LOG2(category, message) { \
-    static LogSite logSite = {UNKNOWN, NULL}; \
-    if (logSite.state && is_log_enabled(category, &logSite)) { \
-        LoggerString logger_string; \
-        logger_string << message; \
-        log4cxx_from_c(category, LOG, logger_string.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-    } \
-}
-#define TRACE2(category, message) { \
-    static LogSite logSite = {UNKNOWN, NULL}; \
-    if (logSite.state && is_trace_enabled(category, &logSite)) { \
+#define INFO(message) INFO2(LOG_DOMAIN, message)
+#define INFO2(category, message) LOG_SITE(info, category, \
+        log_header(category, __FILELINE__, __PRETTY_FUNCTION__); \
         LoggerString logger_string; \
         logger_string << message; \
-        log4cxx_from_c(category, TRACE, logger_string.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-    } \
-}
-
-#endif // NDEBUG
-
-#ifdef LOG_DOMAIN
-
-#define DIE(message) DIE2(LOG_DOMAIN, message)
-#define LDIE(message_number, messagedef_and_params) \
-LDIE2(LOG_DOMAIN, message_number, messagedef_and_params)
-#define WARN(message) WARN2(LOG_DOMAIN, message)
-#define LWARN(message_number, messagedef_and_params) \
-LWARN2(LOG_DOMAIN, message_number, messagedef_and_params)
-#define INFO(message) INFO2(LOG_DOMAIN, message)
-#define LOG(message) LOG2(LOG_DOMAIN, message)
-#define TRACE(message) TRACE2(LOG_DOMAIN, message)
+    )
 
+#define LINFO(message_number, messagedef_and_params) \
+    LINFO2(LOG_DOMAIN, message_number, messagedef_and_params)
+#define ECHO(message) INFO2(LOG_INFO, message)
+#define LECHO(message_number, messagedef_and_params) \
+    LINFO2(LOG_INFO, message_number, messagedef_and_params)
+#define LINFO2(category, message_number, messagedef_and_params) LOG_SITE(info, category, \
+        LogParams log_params(0x4543484f, message_number); \
+        log_params << messagedef_and_params; \
+        log_printf(log_params.release()); \
+    )
+
+#define TRACE(message)  TRACE2(LOG_DOMAIN, message)
+
+/**
+ * Lightweight macro to replace a standard C <code>assert()</code>
+ * and debugging <code>printf</code>.   
+ */
 #ifdef NDEBUG
+#    define TRACE2(category, message)
+#else
+#    define TRACE2(category, message) LOG_SITE(trace, category, \
+        log_printf("[trace] "); \
+        log_header(category, __FILELINE__, __PRETTY_FUNCTION__); \
+        LoggerString logger_string; \
+        logger_string << message; \
+    )
+#endif /* NDEBUG */
 
-#define VERIFY(expr, message) { \
-    if (!(expr)) { \
-    DIE("Assertion failed: " << #expr << "\n" << message); \
-    } \
-}
-#define ASSERT(expr, message)
-
-#else //NDEBUG
-
-#define VERIFY(expr, message) { \
-    if (!(expr)) { \
-    LoggerString logger_string; \
-    logger_string << "Internal error: " << #expr << " failed\n" << message; \
-    log4cxx_from_c(LOG_DOMAIN, DIE, logger_string.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
-    shutdown_log_system(); \
-    assert(expr); \
-    } \
-}
-#define ASSERT(expr, message)  VERIFY(expr, message)
-
-#endif // NDEBUG 
-
-#endif // LOG_DOMAIN
-
-#endif // _CXX_LOG_H_
+#endif /* _CXXLOG_H */

Modified: harmony/enhanced/drlvm/trunk/vm/port/include/logger.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/logger.h?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/logger.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/logger.h Fri Apr 18 00:26:23 2008
@@ -14,137 +14,192 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
-* @author Roman S. Bushmanov, Dmitry B. Yershov
-* @version $Revision: 1.1.2.2.4.3 $
-*/  
+#ifndef _LOGGER_H
+#define _LOGGER_H
 
-#ifndef LOGGER_H
-#define LOGGER_H
-
-#define LOG4CXX
-#define LOG4CXX_STATIC 
-
-#include "open/types.h"
+#include <assert.h>
+#include <stdio.h>
+#include <apr_pools.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /**
-    * Enum of logging levels
-    */
+ * Header format mask.
+ */
+typedef int LogFormat;
+
+/**
+ * Formats.
+ */
+#define LOG_EMPTY       0
+#define LOG_TIMESTAMP   1
+#define LOG_FILELINE    2
+#define LOG_CATEGORY    4
+#define LOG_THREAD_ID   8
+#define LOG_FUNCTION    16
+#define LOG_WARN        32
+
+/**
+ * Predefined classloader filter.
+ */
+#define LOG_CLASS_INFO  "class"
+/**
+ * Predefined gc filter.
+ */
+#define LOG_GC_INFO     "gc"
+/**
+ * Predefined jni filter.
+ */
+#define LOG_JNI_INFO    "jni"
+/**
+ * A domain, which is enabled by default.
+ */
+#define LOG_INFO        "info"
+
 typedef enum {
-    DIE  = 0,
-    WARN,
-    INFO,
-    LOG,
-    TRACE
-} LoggingLevel;
-
-/**
- * Header format flags. Binary AND operation should be used to combine flags.
- */
-typedef unsigned HeaderFormat;
-#define HEADER_EMPTY 0
-#define HEADER_TIMESTAMP 1
-#define HEADER_FILELINE 2
-#define HEADER_CATEGORY 4
-#define HEADER_THREAD_ID 8
-#define HEADER_LEVEL 16
-#define HEADER_FUNCTION 32
-
-#if !defined(__LOG4CXX_FUNC__)
-#   if defined(_MSC_VER) && (defined(__INTEL_COMPILER) || _MSC_VER >= 1300)
-#       define __LOG4CXX_FUNC__ __FUNCSIG__
-#   elif defined(__GNUC__)
-#       define __LOG4CXX_FUNC__ __PRETTY_FUNCTION__
-#   else
-#       define __LOG4CXX_FUNC__ ""
-#   endif
-#endif
+    LOG_DISABLED = 0,
+    LOG_ENABLED,
+    LOG_UNKNOWN
+} LogState;
 
+struct LogSite {
+    LogState state;
+    struct LogSite *next;
+    char* log_domain;
+};
 
 /**
-* Inits log system.  
-*/
-VMEXPORT void init_log_system(void *portLib);
+ * Adds and enables an info category to log.
+ * @param category a category name
+ * @param copy true if the name should be stored internally
+ * @return true on success, false if the category already exists
+ * and is enabled, or the logger pool is not set.
+ */
+int log_enable_info_category(const char* category, int copy);
 
 /**
-* shutdown log system.  
-*/
-VMEXPORT void shutdown_log_system();
+ * Adds and enables a trace category to log.
+ * @param category a category name
+ * @param copy true if the name should be stored internally
+ * @return true on success, false if the category already exists
+ * and is enabled, or the logger pool is not set.
+ */
+int log_enable_trace_category(const char* category, int copy);
 
 /**
-* Sets loggers logging levels from file  
-*/
-VMEXPORT void set_logging_level_from_file(const char* filename);
+ * Adds and disables a given info category.
+ * @param category a category name
+ * @param copy true if the name should be stored internally
+ * @return true on success, false if the category already exists
+ * and is disabled, or the logger pool is not set.
+ */
+int log_disable_info_category(const char* category, int copy);
 
 /**
- * Passes the message specified with level assigned to the category specified for logging.  
+ * Adds and disables a given trace category.
+ * @param category a category name
+ * @param copy true if the name should be stored internally
+ * @return true on success, false if the category already exists
+ * and is disabled, or the logger pool is not set.
  */
-VMEXPORT void log4cxx_from_c(const char *category, LoggingLevel level, 
-                             const char* message, const char* file, 
-                             const char* func, int line);
+int log_disable_trace_category(const char* category, int copy);
 
 /**
- * Assigns threshold to a category. All the messages having a lower logging level will 
- * be ignored by the category.   
+ * Inits log system. Allows further dynamic configuration of categories.
  */
-VMEXPORT void set_threshold(const char *category, LoggingLevel level);
+void log_init(apr_pool_t* parent_pool);
 
 /**
- * Checks if the logging level specified is enabled for the category given. 
+ * Frees dynamic memory associated with the logger.
  */
-VMEXPORT unsigned is_enabled(const char *category, LoggingLevel level);
+void log_shutdown();
 
-VMEXPORT unsigned is_warn_enabled(const char *category);
-VMEXPORT unsigned is_info_enabled(const char *category);
+/**
+ * A native porting layer.
+ */
+struct HyPortLibrary;
 
-typedef enum {
-    DISABLED  = 0,
-    ENABLED,
-    UNKNOWN
-} CachedState;
+/**
+ * Sets a porting library for log system localization.
+ */
+void log_set_portlib(struct HyPortLibrary* portlib);
 
-struct LogSite {
-    CachedState state;
-    struct LogSite *next;
-};
+/**
+ * Sets a porting library for log system localization.
+ */
+struct HyPortLibrary* log_get_portlib();
 
-typedef struct LogSite LogSite;
+/**
+ * Sets a <code>vfprintf</code> hook.
+ */
+void log_set_vfprintf(void* p_vfprintf);
 
-VMEXPORT unsigned is_log_enabled(const char *category, LogSite *site);
-VMEXPORT unsigned is_trace_enabled(const char *category, LogSite *site);
+/**
+ * Sets a <code>exit</code> hook.
+ */
+void log_set_exit(void* p_exit);
 
 /**
-* Redirects category (and all subcategories) output to a file. 
-* If the file is <code>NULL</code>, removes previously assigned redirection (if any).
-*/
-VMEXPORT void set_out(const char *category, const char* file);
+ * Sets a <code>abort</code> hook.
+ */
+void log_set_abort(void* p_abort);
+
+/**
+ * Sets the header format for the logger.
+ */
+void log_set_header_format(LogFormat format);
+
+/**
+ * Redirects output to a file. 
+ */
+void log_set_out(FILE* file);
+
+/**
+ * Terminates the program using specified return code.
+ */
+APR_DECLARE(void) log_exit(int code);
+
+/**
+ * Terminates the program abnormally.
+ */
+APR_DECLARE(void) log_abort();
+
+/**
+ * Writes formatted data to stdout via specified vfprinf function.
+ */
+APR_DECLARE(int) log_printf(const char* format, ...);
+
+/**
+ * Writes formatted header to stdout via specified vfprinf function.
+ */
+APR_DECLARE(void) log_header(const char* category, const char* file_line, const char* function_name);
+
+/**
+ * Checks if the warnings are enabled. 
+ */
+APR_DECLARE(LogState) log_is_warn_enabled();
 
 /**
- * Sets the header format for the category specified. Use <code>HeaderFormat</code>
- * flags combined by AND operation to configure format.
+ * Checks if the info domain is enabled for the given category. 
  */
-VMEXPORT void set_header_format(const char *category, HeaderFormat format);
+APR_DECLARE(LogState) log_is_info_enabled(const char *category);
 
 /**
- * Sets the log file path pattern to use for thread specific logging.
- * Specify <code>NULL</code> pattern to turn off per-thread output.
- * Use %t specifier to be replaced by a thread id.
+ * Checks if the trace is enabled for the given category. 
  */
-VMEXPORT void set_thread_specific_out(const char* category, const char* pattern);    
+APR_DECLARE(LogState) log_is_trace_enabled(const char *category);
 
 /**
- * Write formatted data to a newly allocated string. 
- * Use STD_FREE to release allocated memory.
+ * Caches a check in the corresponding log site.
+ * @return enabled
  */
-VMEXPORT const char* log_printf(const char* format, ...);
+APR_DECLARE(LogState) log_cache(LogState enabled, struct LogSite* p_log_site);
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif // LOGGER_H
+#endif /* _LOGGER_H */
 

Modified: harmony/enhanced/drlvm/trunk/vm/port/include/loggerstring.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/loggerstring.h?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/loggerstring.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/loggerstring.h Fri Apr 18 00:26:23 2008
@@ -14,137 +14,64 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
-* @author Dmitry B. Yershov
-* @version $Revision: 1.1.2.1.4.3 $
-*/  
+#ifndef _LOGGER_STRING_H
+#define _LOGGER_STRING_H
 
-#ifndef LOGGER_STRING_H
-#define LOGGER_STRING_H
-
-#include <iostream>
-#include "port_malloc.h"
-
-using std::string;
+#include "logger.h"
+#include "open/platform_types.h"
 
 class LoggerString {
-private:
-    string logger_string;
 public:
-    const char* release() {
-        return (const char*)logger_string.c_str();
-    }
-
     LoggerString& operator<<(const char* message) {
-        logger_string += message;
-        return *this;
-    }
-
-    LoggerString& operator<<(char* message) {
-        logger_string += message;
-        return *this;
-    }
-
-    LoggerString& operator<<(volatile void* pointer) {
-        char* buf = (char*)STD_MALLOC(21);
-        sprintf(buf, "%p", pointer);
-        logger_string += buf;
-        STD_FREE(buf);
+        log_printf("%s", message);
         return *this;
     }
 
     LoggerString& operator<<(const void* pointer) {
-        char* buf = (char*)STD_MALLOC(21);
-        sprintf(buf, "%p", pointer);
-        logger_string += buf;
-        STD_FREE(buf);
-        return *this;
-    }
-
-    LoggerString& operator<<(void *pointer) {
-        char* buf = (char*)STD_MALLOC(21);
-        sprintf(buf, "%p", pointer);
-        logger_string += buf;
-        STD_FREE(buf);
+        log_printf("%p", pointer);
         return *this;
     }
 
     LoggerString& operator<<(char c) {
-        char* buf = (char*)STD_MALLOC(2*sizeof(char));
-        sprintf(buf, "%c", c);
-        logger_string += buf;
-        STD_FREE(buf);
+        log_printf("%c", c);
         return *this;
     }
 
     LoggerString& operator<<(int i) {
-        char* buf = (char*)STD_MALLOC(21);
-        sprintf(buf, "%d", i);
-        logger_string += buf;
-        STD_FREE(buf);
+        log_printf("%d", i);
         return *this;
     }
 
     LoggerString& operator<<(long i) {
-        char* buf = (char*)STD_MALLOC(50);
-        sprintf(buf, "%ld", i);
-        logger_string += buf;
-        STD_FREE(buf);
+        log_printf("%ld", i);
         return *this;
     }
 
     LoggerString& operator<<(unsigned i) {
-        char* buf = (char*)STD_MALLOC(50);
-        sprintf(buf, "%u", i);
-        logger_string += buf;
-        STD_FREE(buf);
+        log_printf("%u", i);
         return *this;
     }
 
     LoggerString& operator<<(unsigned long i) {
-        char* buf = (char*)STD_MALLOC(100);
-        sprintf(buf, "%lu", i);
-        logger_string += buf;
-        STD_FREE(buf);
+        log_printf("%lu", i);
         return *this;
     }
 
     LoggerString& operator<<(int64 i) {
-        char* buf = (char*)STD_MALLOC(100);
-        sprintf(buf, "%" FMT64 "d", i);
-        logger_string += buf;
-        STD_FREE(buf);
+        log_printf("%" FMT64 "d", i);
         return *this;
     }
 
     LoggerString& operator<<(uint64 i) {
-        char* buf = (char*)STD_MALLOC(100);
-        sprintf(buf, "%" FMT64 "u", i);
-        logger_string += buf;
-        STD_FREE(buf);
+        log_printf("%" FMT64 "u", i);
         return *this;
     }
 
     LoggerString& operator<<(double d) {
-        char* buf = (char*)STD_MALLOC(100);
-        sprintf(buf, "%lf", d);
-        logger_string += buf;
-        STD_FREE(buf);
-        return *this;
-    }
-
-    typedef std::ios_base& (*iomanip)(std::ios_base&);
-    LoggerString& operator<<(iomanip UNREF i) {
-        //FIXME: NYI
-        return *this;
-    }
-
-    typedef std::ostream& (*iomanip2)(std::ostream&);
-    LoggerString& operator<<(iomanip2 UNREF i) {
-        //FIXME: NYI
+        log_printf("%lf", d);
         return *this;
     }
 };
 
-#endif //LOGGER_STRING_H
+#endif /* _LOGGER_STRING_H */
  



Mime
View raw message