Unable to encrypt data and then decrypt it in MRI Ruby It appears that we were not setting up the initial IV properly. In MRI, if you specify parameters to #encrypt, it will initialize IV using a substring of "OpenSSL for Ruby rulez!". We had two issues: 1. In some places, we used "OpenSSL for JRuby rulez!" 2. If the initialization did not happen in #encrypt, we tried again to do it on first update. My fix was to use a blank IV (all zeros) if none is set up in does not appear to break any other tests we run.
With this commit, scopes that have classes, methods, constants, and cvars no longer have a requirement that a dummy scope be pushed. The scope is loaded from the same cache as other values, and as a result those methods have no implicit cost over the same code with no scope access.
* For initial Script execution via __file__, must setRootScope * Script.load impl will setRootScope * All other method forms will receive scope index from parent compiler
This helps decouple class/module creation from StaticScope init, allowing us to move closer to getting the current scope from cache in all cases.
* Compiled setConstant calls work against StaticScope * Getting the namespace in which to define class/module uses StaticScope
* Const lookup and defined pass in StaticScope * AbstractScript/RuntimeCache receive StaticScope * Compiled code uses context.getCurrentStaticScope for now
* setConstantInCurrent moved to StaticScope * setConstantInModule moved to RuntimeHelpers * setConstantInObject moved to RuntimeHelpers * getConstantDefined moved to StaticScope#isConstantDefined * A few more ThreadContext#getConstant calls eliminated
In an effort to eliminate the deopt caused by const access from Ruby code, I'm working toward making all constant access work against StaticScope rather than against ThreadContext and the current DynamicScope (which forces us to push dummy scopes where we don't really need any). This commit starts pulling out calls to ThreadContext.getConstant, which requires a DynamicScope to be present, and also removes some unused or rarely-used arguments from the const lookup call chain to simplify the transition.
…dge or vertex
This fixes #367.