Eliminating this stack will be really, really nice. It's just a waste of cycles right now, and we keep having to switch code to CRef anyway.

I think there's gotta be some heuristic for the blasted constant logic. We just need to figure out what that is and wire it together the right way. I know Ruby doesn't maintain two separate stacks of classes, so there's gotta be a way.

On 7/11/06, Thomas E Enebo <[EMAIL PROTECTED]> wrote:
  I tried to eliminate getRubyClass() from ThreadContext tonight.
It almost worked.  The single point of failure seems to be in
block behavior.  Consider:

module Foo; end

Foo.module_eval {
  # (Ruby) Defined within Foo
  def abc; end

  # (Ruby) Defined within Object
  XYZ = 10
}

p defined? XYZ
p defined? abc

Ruby can be wild stuff sometimes...

In our code when in yield we are calling getRubyClass() for
defnNode visitor (which would return Foo since we pushed it there
during TC.yield.  ConstDecl visitor will use getCRef() and that
would end up being Object (which we also set somewhere in the
tangle on TC.yield ).

I can see one obvious issue with removing getRubyClass and it's stack.
At least I need to figure out how to get Foo in some cases and Object
in others without needing to maintain a second stack.

Decent speed gain since we constantly smack these stacks

-Tom

--
+ http://www.tc.umn.edu/~enebo +---- mailto:[EMAIL PROTECTED] ----+
| Thomas E Enebo, Protagonist  | "Luck favors the prepared    |
|                              |  mind." -Louis Pasteur       |


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel



--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ www.jruby.org
Application Architect @ www.ventera.com
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to