Removed return value from descriptor_params_from_paramtypes.
[cacao.git] / src / vm / jit / optimizing / bytecode_escape.c
index 326f65f08015460cafe41aac7424c7c05fab5d82..0ee6d19b5b8a6eff77961ec879e48b94aeb65c33 100644 (file)
@@ -1,6 +1,6 @@
 /* src/vm/optimizing/bytecode_escape.c
 
-   Copyright (C) 2008
+   Copyright (C) 1996-2011
    CACAOVM - Verein zu Foerderung der freien virtuellen Machine CACAO
 
    This file is part of CACAO.
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
+
 */
 
-#include "mm/dumpmemory.h"
-#include "mm/memory.h"
+
+#include "config.h"
+
+#include <stdint.h>
+
+#include "mm/dumpmemory.hpp"
+#include "mm/memory.hpp"
 
 #include "toolbox/bitvector.h"
 
+#include "vm/class.hpp"
+#include "vm/descriptor.hpp"
 #include "vm/global.h"
+#include "vm/references.h"
+#include "vm/resolve.hpp"
+
 #include "vm/jit/ir/bytecode.h"
 #include "vm/jit/optimizing/escape.h"
-#include "vm/resolve.h"
-
-#include "vmcore/class.h"
-#include "vmcore/descriptor.h"
-#include "vmcore/references.h"
 
 #include <assert.h>
 #include <stdarg.h>
@@ -769,12 +775,8 @@ static void bc_escape_analysis_parse_invoke(bc_escape_analysis_t *be, jcode_t *j
 
        /* Parse parameters if not done yet. */
 
-       if (md->params == NULL) {
-               if (! descriptor_params_from_paramtypes(md, opc == BC_invokestatic ? ACC_STATIC : 0)) {
-                       /* TODO */
-                       assert(0);
-               }
-       }
+       if (md->params == NULL)
+               descriptor_params_from_paramtypes(md, opc == BC_invokestatic ? ACC_STATIC : 0);
 
        /* Try to lazyly resolve method. */
 
@@ -811,7 +813,7 @@ static void bc_escape_analysis_parse_invoke(bc_escape_analysis_t *be, jcode_t *j
           or recurse into callee. 
           Otherwise we must assume, that all parameters escape. */
 
-       if (mi != NULL && method_profile_is_monomorphic(mi)) {
+       if (mi != NULL && escape_is_monomorphic(be->method, mi)) {
 
                if (mi->paramescape == NULL) {
                        bc_escape_analysis_perform_intern(mi, be->depth + 1);
@@ -1794,6 +1796,10 @@ static void bc_escape_analysis_perform_intern(methodinfo *m, int depth) {
        }
 #endif
 
+       if (depth >= 3) {
+               return;
+       }
+
        if (m->paramescape != NULL) {
 #if BC_ESCAPE_VERBOSE
                if (verbose) {  
@@ -1821,7 +1827,14 @@ static void bc_escape_analysis_perform_intern(methodinfo *m, int depth) {
                return;
        }
 
-       /* TODO threshold */
+       if (m->jcodelength > 250) {
+#if BC_ESCAPE_VERBOSE
+               if (verbose) {
+                       dprintf(depth, "Bytecode too long: %d.\n", m->jcodelength);
+               }
+#endif
+               return;
+       }
 
        be = DNEW(bc_escape_analysis_t);
        bc_escape_analysis_init(be, m, verbose, depth);
@@ -1850,3 +1863,18 @@ void bc_escape_analysis_perform(methodinfo *m) {
 }
 
 
+
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ * vim:noexpandtab:sw=4:ts=4:
+ */
+