You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ivashin Sergey (JIRA)" <ji...@apache.org> on 2007/05/28 14:12:16 UTC
[jira] Updated: (HARMONY-3955) [drlvm][jit][opt] graph coloring
register allocator uses too much memory
[ https://issues.apache.org/jira/browse/HARMONY-3955?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ivashin Sergey updated HARMONY-3955:
------------------------------------
Attachment: regalloc0.patch
This patch implements both suggested improvements.
1. To represent elements of operand interference matrix, bit is used instead of byte. Also, only N*(N-1)/2 elements of the matrix are stored instead of N*N, because matrix is symmetrical. So, memory footprint is significantly reduced (16 times less).
2. New wrapper action transformer (regalloc) is introduced, which select RA (bin-pack or color-graph) to be called. Selection depends on actual number of operands in the method compiled. By default, threshold is set to 2000, but it can be changed in .emconf fille ("regalloc.opands=1000", for example).
> [drlvm][jit][opt] graph coloring register allocator uses too much memory
> ------------------------------------------------------------------------
>
> Key: HARMONY-3955
> URL: https://issues.apache.org/jira/browse/HARMONY-3955
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Environment: any
> Reporter: Pavel Ozhdikhin
> Attachments: regalloc0.patch
>
>
> Dacapo xalan bechmark fails with the assertion on DRLVM run in '-Xem:server' mode because C heap is exhausted. The assertion fires compiling the following method:
> org/apache/xalan/processor/XSLTSchema::build()
> The method contains ~35000 operands and the graph coloring register allocator needs ~35000^2 bytes to compose an internal data structure. 2 improvements could be made here:
> 1. Change byte usage to BitSet.
> 2. Fall back to binpack RA when compiling methods with many operands.
> This is a strightforward approach, probably there can be a more elegant solution.
> The log for the failure is following:
> Windows reported exception: 0xc0000005
> Registers:
> EAX: 0x00000000, EBX: 0x1b17c4b8, ECX: 0x054c2028, EDX: 0x00000000
> ESI: 0x00008c6b, EDI: 0x0013e708, ESP: 0x0013e528, EBP: 0x0013e52c
> EIP: 0x018c1033
> Stack trace:
> 0: Jitrino::init_arena (c:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\shared\arena.cpp:39)
> 1: Jitrino::alloc_arena (c:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\shared\arena.cpp:58)
> 2: Jitrino::MemoryManager::_alloc_arena (c:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\shared\memorymanager.cpp:123)
> 3: Jitrino::MemoryManager::alloc (c:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\shared\memorymanager.cpp:223)
> 4: operator new (c:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\shared\memorymanager.h:74)
> 5: Jitrino::Ia32::RegAlloc3::BoolMatrix::BoolMatrix (c:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\codegenerator\ia32\ia32regalloc3.cpp:350)
> 6: Jitrino::Ia32::RegAlloc3::buildGraph (c:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\codegenerator\ia32\ia32regalloc3.cpp:679)
> 7: Jitrino::Ia32::RegAlloc3::runImpl (c:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\codegenerator\ia32\ia32regalloc3.cpp:538)
> 8: Jitrino::Ia32::SessionAction::run (c:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\codegenerator\ia32\ia32irmanager.cpp:2269)
> 9: Jitrino::runPipeline (c:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\main\jitrino.cpp:230)
> 10: Jitrino::compileMethod (c:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\main\jitrino.cpp:265)
> 11: Jitrino::Jitrino::CompileMethod (c:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\main\jitrino.cpp:290)
> 12: JIT_compile_method_with_params (c:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\vm\drl\drljitinterface.cpp:287)
> 13: Dll_JIT::compile_method_with_params (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\include\dll_jit_intf.h:86)
> 14: compile_do_compilation_jit (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jit\compile.cpp:658)
> 15: vm_compile_method (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\class_support\c_interface.cpp:2572)
> 16: DrlEMImpl::compileMethod (c:\users\pozhdikh\harmony\trunk\working_vm\vm\em\src\drlemimpl.cpp:540)
> 17: CompileMethod (c:\users\pozhdikh\harmony\trunk\working_vm\vm\em\src\em_intf.cpp:49)
> 18: compile_do_compilation (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jit\compile.cpp:774)
> 19: compile_me (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jit\compile.cpp:794)
> 20: 0x013B0162 <Generated stub>
> 21: ?? (??:-1)
> 22: org/apache/xalan/processor/XSLTSchema.<init>()V (XSLTSchema.java:-1)
> 23: org/apache/xalan/processor/StylesheetHandler.<init>(Lorg/apache/xalan/processor/TransformerFactoryImpl;)V (StylesheetHandler.java:1326)
> 24: org/apache/xalan/processor/TransformerFactoryImpl.newTemplatesHandler()Ljavax/xml/transform/sax/TemplatesHandler; (TransformerFactoryImpl.java:457)
> 25: org/apache/xalan/processor/TransformerFactoryImpl.newTemplates(Ljavax/xml/transform/Source;)Ljavax/xml/transform/Templates; (TransformerFactoryImpl.java:-1)
> 26: vm_invoke_native_array_stub (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\util\ia32\base\ini_ia32.cpp:77)
> 27: JIT_execute_method_default (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\util\ia32\base\ini_ia32.cpp:200)
> 28: DrlEMImpl::executeMethod (c:\users\pozhdikh\harmony\trunk\working_vm\vm\em\src\drlemimpl.cpp:509)
> 29: ExecuteMethod (c:\users\pozhdikh\harmony\trunk\working_vm\vm\em\src\em_intf.cpp:43)
> 30: vm_execute_java_method_array (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jit\ini.cpp:60)
> 31: call_method_no_ref_result (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jni\jni_method.cpp:187)
> 32: CallNonvirtualVoidMethodA (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jni\jni_method.cpp:676)
> 33: NewObjectA (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jni\jni.cpp:1026)
> 34: dacapo/xalan/XalanHarness.<init>(Ldacapo/parser/Config;Ljava/io/File;)V (XalanHarness.java:-1)
> 35: 0x040A2376 <Generated stub>
> 36: ?? (??:-1)
> 37: java/lang/reflect/Constructor.newInstance([Ljava/lang/Object;)Ljava/lang/Object; (Constructor.java:299)
> 38: dacapo/TestHarness.runBenchmark(Ljava/io/File;Ljava/lang/String;Ldacapo/TestHarness;)V (TestHarness.java:268)
> 39: dacapo/TestHarness.main([Ljava/lang/String;)V (TestHarness.java:240)
> 40: vm_invoke_native_array_stub (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\util\ia32\base\ini_ia32.cpp:77)
> 41: JIT_execute_method_default (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\util\ia32\base\ini_ia32.cpp:200)
> 42: DrlEMImpl::executeMethod (c:\users\pozhdikh\harmony\trunk\working_vm\vm\em\src\drlemimpl.cpp:509)
> 43: ExecuteMethod (c:\users\pozhdikh\harmony\trunk\working_vm\vm\em\src\em_intf.cpp:43)
> 44: vm_execute_java_method_array (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jit\ini.cpp:60)
> 45: call_static_method_no_ref_result (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jni\jni_method.cpp:1154)
> 46: CallStaticVoidMethodA (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jni\jni_method.cpp:1562)
> 47: invoke_primitive_method (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\kernel_classes\native\java_lang_reflect_vmreflection.cpp:185)
> 48: Harness.main([Ljava/lang/String;)V (Harness.java:5)
> 49: 0x040C81C3 <Generated stub>
> 50: ?? (??:-1)
> 51: java/lang/reflect/Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Method.java:382)
> 52: vm_invoke_native_array_stub (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\util\ia32\base\ini_ia32.cpp:77)
> 53: JIT_execute_method_default (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\util\ia32\base\ini_ia32.cpp:200)
> 54: DrlEMImpl::executeMethod (c:\users\pozhdikh\harmony\trunk\working_vm\vm\em\src\drlemimpl.cpp:509)
> 55: ExecuteMethod (c:\users\pozhdikh\harmony\trunk\working_vm\vm\em\src\em_intf.cpp:43)
> 56: vm_execute_java_method_array (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jit\ini.cpp:60)
> 57: call_static_method_no_ref_result (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jni\jni_method.cpp:1154)
> 58: CallStaticVoidMethodA (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jni\jni_method.cpp:1562)
> 59: CallStaticVoidMethodV (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jni\jni_method.cpp:1547)
> 60: CallStaticVoidMethod (c:\users\pozhdikh\harmony\trunk\working_vm\vm\vmcore\src\jni\jni_method.cpp:1537)
> 61: main_runJavaMain (c:\users\pozhdikh\harmony\trunk\working_classlib\modules\luni\src\main\native\launcher\shared\main.c:1314)
> 62: invocation (c:\users\pozhdikh\harmony\trunk\working_classlib\modules\luni\src\main\native\launcher\shared\main.c:734)
> 63: gpProtectedMain (c:\users\pozhdikh\harmony\trunk\working_classlib\modules\luni\src\main\native\launcher\shared\main.c:383)
> 64: main (c:\users\pozhdikh\harmony\trunk\working_classlib\modules\luni\src\main\native\launcher\shared\cmain.c:147)
> 65: mainCRTStartup (f:\vs70builds\3077\vc\crtbld\crt\src\crtexe.c:398)
> 66: IsProcessorFeaturePresent (??:-1)
> 67: org/apache/harmony/vm/JarRunner.main([Ljava/lang/String;)V (JarRunner.java:80)
> <end of stack trace>
> Assertion failed: depth == 0, file C:\users\pozhdikh\harmony\trunk\working_vm\vm\jitrino\src\main\PMF.cpp, line 708
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.