search for: instanceof

Displaying 20 results from an estimated 41 matches for "instanceof".

2009 Nov 19
1
[LLVMdev] Removing instanceof tests
Hi all, I wrote you some days ago about one project that I want to do on vmkit: I want to remove redundant instanceof tests. I am right now looking at the LLVM code that vmkit produces for java files, but I am finding it very difficult to identify the code that is produced by each instanceof. Would it be possible for you guys to give me some pointers on how to attack this problem? Should I focus on the vmkit front...
2007 Oct 26
0
2 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.h test/trace
...-o implements-7.swf implements.as + +trace ("Test Implements ActionScript action"); + + +trace ("A implements Array, XML"); + +var A = function () { + return { + constructor: A, + __proto__: A.prototype + }; +}; + +trace ("Before"); +var o = new A (); +trace (o instanceOf A); +trace (o instanceOf Array); +trace (o instanceOf XML); +trace (o instanceOf String); + +asm { + push "test" + push "Array" + getvariable + push "XML" + getvariable + push 2 + push "A" + getvariable + implements + trace +}; + +trace ("After...
2009 Sep 21
1
[LLVMdev] Removing redundant type checks from Java
...and I would like to use LLVM in my final course project. So, I just download LLVM and VMKit, and I have been playing with both. I can produce llvm bytecodes from java programs, and now my idea is to remove redundant type checks from the code. For instance, if we consider a program like this: if (o instanceof A) { A a = (A) o; // do something with a } we see that Java will put a type test before the cast, but this test is unnecessary, as we already know that we have passed the instanceof test. So, as my project I would like to remove these redundant tests. My questions: 1) Has this already been do...
2015 Dec 15
2
How to efficiently share data (a dataframe) between R and Java
Dear all, thank you for your hints. I would prefer to do not use Rserve as Dirk mentioned. @Simon I have full control over the Java implementation - I can adapt the code that I use for the communication R <-> Java. > You can natively access structures on each side. The fastest way is to > use R representation (column-oriented) in Java - that is much faster > than any kind of
2015 Dec 15
0
How to efficiently share data (a dataframe) between R and Java
...] [3]: double[150] [4]: int[150] [5]: String[150] Java code: public class C { static void df(Object df[]) { int n; System.out.println("df, " + (n = df.length) + " variables"); int i = 0; while (i < n) { if (df[i] instanceof double[]) { double d[] = (double[]) df[i]; System.out.println("["+i+"]: double["+d.length+"]"); } else if (df[i] instanceof int[]) { int d[] = (int[]) df[i]; System.out.println("["+i+"]: int["+d.length+"]...
2007 Oct 25
0
12 commits - libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c test/trace
...iffer diff --git a/test/trace/prototype-handling-5.swf.trace b/test/trace/prototype-handling-5.swf.trace new file mode 100644 index 0000000..e7dab0c --- /dev/null +++ b/test/trace/prototype-handling-5.swf.trace @@ -0,0 +1,127 @@ +Test how different functions handle __proto__ and it's propflags +instanceOf: +true +o.__proto__: 2 +true +o.__proto__: 4 +true +o.__proto__: 8 +true +o.__proto__: 16 +true +o.__proto__: 32 +true +o.__proto__: 64 +true +o.__proto__: 128 +false +o.__proto__: 256 +true +o.__proto__: 512 +true +o.__proto__: 1024 +false +o.__proto__: 2048 +true +o.__proto__: 4096 +false +o.__pr...
2009 Nov 09
0
[LLVMdev] Optimizing class casts away
Dear all, I am trying to remove some instanceof tests from bc code that is produced by vmkit. For instance: 1 if (o instanceof String) { 2 String s = (String)o; 3 } Vmkit seems to be inserting two tests into the bc code: one for the test in line 1, and another, implicit, that would lunch perhaps JavaClassCastException if the cast fails at ru...
2013 Jan 10
1
[LLVMdev] LLVM Instruction to ICmpInst conversion
...led method is bool ifChecker::operEquiv(Instruction *I1, Instruction *I2) { ... } BUT I want to use the methods from class ICmpInst : clasa http://llvm.org/doxygen/classllvm_1_1ICmpInst.html inside operEquiv. I cannot do something like ICmpInst** II1 = dyn_cast<ICmpInst*>(I1); (a kind of instanceOf() from Java), having casting compilation problems. The ICmpInst class is defined at line 913 from http://llvm.org/doxygen/Instructions_8h_source.html The inheritance diagram is at http://llvm.org/doxygen/classllvm_1_1ICmpInst.html I want to use the ICmpInst methods for objects of type Instruction...
2009 Sep 17
0
web-meetme cbEnd.php not running - error
...from incompatible context in /usr/share/php5/PEAR/DB.php on line 965 PHP Strict Standards: Non-static method DB::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php5/PEAR/DB.php on line 688 PHP Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php5/PEAR/DB.php on line 594 PHP Strict Standards: Non-static method PEAR::getStaticProperty() should not be called statically, assuming $this from incompatible context in /usr/share/php5/PEAR/PEAR.php on line 867 PHP Strict Standards: Non-static method DB::isError() should...
2006 Mar 21
5
Programming the Manager API
I just started poking around with writing a python module to interface to the Manager API, and it suddenly hit me... how the heck are you supposed to program this thing? All the events seem to be dumped to all the open connections. If I send a command, such as a login, there seems to me to be no way to determine which response are intended for me, and which may be intended for another open
2017 Apr 06
3
Dereferenceable load semantics & LICM
I left a comment on https://reviews.llvm.org/D18738 earlier which I feel is related to this discussion, so I'm reproducing it here: I wonder though if what we want to express isn't some sort of "type-based dereferencability annotations". For example the semantics I care about are essentially, "if you know you have a defereferencable pointer, you can go and dereference any
2007 Oct 25
0
6 commits - libswfdec/swfdec_as_interpret.c test/trace
...quot;o" + getvariable + cast + trace +}; + +loadMovie ("FSCommand:quit", ""); commit 85b0e8b36a6ccadd5bd54dbd9e384bc5fa73292d Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Thu Oct 25 20:06:08 2007 +0300 Cast takes the arguments in opposite order than instanceOf diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index b18ddbf..5224538 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -2239,19 +2239,18 @@ swfdec_action_cast (SwfdecAsContext *cx, guint action, const guint8 *data, val = swf...
2007 Apr 16
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
..._action_equals2, swfdec_action_equals2 } }, @@ -2220,9 +2240,11 @@ const SwfdecActionSpec swfdec_as_actions #if 0 [0x53] = { "NewMethod", NULL, -1, 1, { NULL, NULL, swfdec_action_new_method, swfdec_action_new_method, swfdec_action_new_method } }, /* version 6 */ - [0x54] = { "InstanceOf", NULL }, - [0x55] = { "Enumerate2", NULL, 1, -1, { NULL, NULL, NULL, swfdec_action_enumerate2, swfdec_action_enumerate2 } }, +#endif + [SWFDEC_AS_ACTION_INSTANCE_OF] = { "InstanceOf", NULL }, + [SWFDEC_AS_ACTION_ENUMERATE2] = { "Enumerate2", NULL, 1, -1, { NUL...
2011 May 23
2
[Cortado] How to support seeking in on-the-fly generated Theora stream?
...xt buffer begins with OggS pattern and calls the notifyAll() method: protected void taskFunc() { boolean runSeekIfWanted = false; synchronized (queue) { /* ... */ if (playPosition+1 < queue.size()) { obj = queue.elementAt(playPosition+1); if (obj instanceof Buffer) { Buffer bb = (Buffer) obj; if (bb.data[0] == 'O' && bb.data[1] == 'g' && bb.data[2] == 'g' && bb.data[3] == 'S') { runSeek...
2019 Nov 12
0
class(<matrix>) |--> c("matrix", "arrary") [was "head.matrix ..."]
...subclasses. What could be more natural and readable than using inherits(x, "<someclass>") for that? What's unusual or intimidating about its syntax? OK I could see that maybe some people would like to be able to use a binary operator instead of a function call for this (a la instanceof in Java): `%inherits%` <- inherits library(data.table) x <- data.table() x %inherits% "data.frame" [1] TRUE which would be a reasonable request (looks cute). But trying to make the case for "<someclass>" %in% class(x) on Twitter??! %-/ </ra...
2007 Jan 31
0
Branch 'interpreter' - 3 commits - libswfdec/js libswfdec/swfdec_script.c
...InitArray", NULL }, [0x43] = { "InitObject", NULL, -1, 1, { NULL, NULL, swfdec_action_init_object, swfdec_action_init_object, swfdec_action_init_object } }, [0x44] = { "Typeof", NULL }, @@ -1731,9 +1808,9 @@ static const SwfdecActionSpec actions[25 [0x54] = { "InstanceOf", NULL }, [0x55] = { "Enumerate2", NULL }, /* version 5 */ - [0x60] = { "BitAnd", NULL }, - [0x61] = { "BitOr", NULL }, - [0x62] = { "BitXor", NULL }, + [0x60] = { "BitAnd", NULL, 2, 1, { NULL, NULL, swfdec_action_bitwise, swfdec_acti...
2006 Mar 24
7
Polymorphic associations?
I''ve read the stuff about polymorphic associations here: http://wiki.rubyonrails.org/rails/pages/UnderstandingPolymorphicAssociations But I''m not sure what exactly they are and what their advantage is. Are they the same as HABTM, but they''re "two-way"? Joe -- Posted via http://www.ruby-forum.com/.
2009 Sep 15
0
[LLVMdev] My LLVM Project
2009/9/15 Talin <talin at acm.org>: > For example, here's what the "Iterator" interface looks like: > >   interface Iterator[%T] { >     def next -> T or void; >   } So this would be something like: template <class T> virtual class Iterator { T next(); // or void? }; So the power of having two types of return parameters is that you save function
2016 Jul 12
2
RFC: Strong GC References in LLVM
...6 also } void f(A a) { Object o = a; // Since a is of type A, we know that it is dereferenceable up to // 16+8 == 24 bytes, but it does not mean that we can speculate // the load of objField. // This is kind of silly as written, but this does happen after // inlining. if (o instanceof B) { // This is dead code, and we will often DCE it away, but we're // not allowed to rely on that happening (before hoisting) for // correctness. Object obj = ((B) o).objField; print(obj.hashCode()); } } > It is definitely important to speculate these loads, bu...
2007 Nov 15
2
Changes to 'refs/tags/0.5.4'
Tag '0.5.4' created by Benjamin Otte <otte at gnome.org> at 2007-11-15 10:12 -0800 release 0.5.4 ("Turkish Cycling Federation") -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBHPBurvMv5VCdLq8QRAj1KAJ40NHRRS3gKyJjSjyyoH7gDaGi/tQCeOha/ R5PF4bZQqmSdJ64t8EbD4cA= =8qBy -----END PGP SIGNATURE----- Changes since the dawn of time: Benjamin Otte (40):