Граф коммитов

1095 Коммитов

Автор SHA1 Сообщение Дата
igor%mir2.org 9cde635841 IdScriptable.nextInstanceCheck is replaced by IdScriptable.incompatibleCallError to reflect proper semantic and simplify id-related code. 2003-04-28 16:27:57 +00:00
igor%mir2.org 5dc7316f87 Replacing protected by private/package private to allow for better optimization. 2003-04-28 12:54:59 +00:00
igor%mir2.org 9e9fa17082 Removal of unused private static SEAL_FUNCTIONS_FLAG 2003-04-28 12:53:15 +00:00
igor%mir2.org 9cf97b6988 Replacing prototypePropertyAttrs by simple boolean flag isPrototypePropertyImmune for simpler code. 2003-04-28 12:52:21 +00:00
igor%mir2.org 65790b9103 Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=203402 :
In Codegen do not pass trueLabel, falseLabel to recursive
generateCodeFromNode from ADD node and use -1 , -1 instead to indicate non-jump node.
2003-04-28 09:50:56 +00:00
igor%mir2.org 03ffd6752b Restoring toStringTreeHelper functionality to print nested functions as a part of the tree. The regression was caused by changes to store function reference as index and not function node. 2003-04-28 09:44:19 +00:00
igor%mir2.org d6cb9bf88b In debug mode print instruction names, not their bytecode values. 2003-04-27 08:12:18 +00:00
igor%mir2.org 3aafae2f86 1. Consistently use ScriptRutime.<ClassName>Class instead of Classname.class to decrease code size and loading time
2. Small optimization in ScriptRuntime.toNuber
2003-04-26 12:01:38 +00:00
igor%mir2.org 8113ba21d9 Deprecation of toObject in Context and ScriptRuntime forms that takes a static type argument.
The static type argument to toObject is effectively never used since it always assumes that instances of String, Number and Boolean represent primitive JS values and handled via ScriptRuntime.newObject and in the rest of cases static type was not checked by WrapFactory.
2003-04-25 10:08:44 +00:00
igor%mir2.org 38b60c25d7 More comments about NativeJavaMethod.findFunction requirements 2003-04-24 17:16:21 +00:00
igor%mir2.org f87766bec4 Changing NativeJavaClass.construct and NativeJavaMethod.call not to modify passed argument array with unwrapped values. Instead a new array is allocated if any unwrapped value would be different from the original JS argument. 2003-04-24 17:13:57 +00:00
nboyd%atg.com 4b1dee847c Add new document on scripting java. 2003-04-24 13:14:00 +00:00
igor%mir2.org adbcef8ac9 Resolving http://bugzilla.mozilla.org/show_bug.cgi?id=203013 :
Changing semantics of a sealed object to mean that all its properties are ReadOnly in addition to DontDelete.
2003-04-24 12:15:30 +00:00
igor%mir2.org b2420d4dec Resolving http://bugzilla.mozilla.org/show_bug.cgi?id=202872 :
public static Method[] findMethods(Class clazz, String name)

is replaced by

static Method findSingleMethod(Method[] methods, String name)
2003-04-24 12:08:23 +00:00
igor%mir2.org 3f7db604b7 Replacing try { cast } catch (ClassCastException ex) { action if not instance } by if (instanceof) { } else { action if not instance }.
Such optimization wins very little with modern JVMs if cast succeeds and produces very big overhead if cast fails. Moreover, it may prevent jits from doing more aggressive optimizations and makes class files bigger.

The change also made code in many places smaller since insanceof check take ensure that object is not null as well and with ClassCastException such check had to be done explicitly.
2003-04-23 14:47:09 +00:00
igor%mir2.org 27f1930196 Removal of support for special handling of this for read-only methods exposed by IdScriptable under dynamic scoping. It was never used and its semantic had little to do with dynamic scoping itself. 2003-04-22 16:09:40 +00:00
nboyd%atg.com 6dad9c8e6d Update for 1.5R4.1. 2003-04-22 00:27:10 +00:00
igor%mir2.org d7e2bd92bd Resolving http://bugzilla.mozilla.org/show_bug.cgi?id=202255 :
Support for pre 1.5R1 rules for defining JS classes by ScriptableObject.defineClass is removed.
2003-04-21 23:53:24 +00:00
nboyd%atg.com a35bc69e51 Fix bug 202344 (which was not fully fixed by the previous change.) 2003-04-21 19:43:45 +00:00
nboyd%atg.com 9bf962a79e Fix bug 202344. 2003-04-21 14:59:22 +00:00
nboyd%atg.com 13da7c74ae Restore method used by Batik. 2003-04-21 13:38:49 +00:00
igor%mir2.org 393606bb3f FunctionObject changes:
1. Disable invoker optimization for methods with variable number of arguments since currently to call optimized invoker a new argument array has to be allocated in any case which makes the optimization irrelevant.

2. Never modify elements of the args array in constructor, instead avoid allocation of the new argument array iff all js argument can be passed to java without type conversion.
2003-04-16 13:05:48 +00:00
igor%mir2.org d37001ed6e In NativeString.js_concat in the case of single argument call target.concat(arg) to avoid allocating StringBuffer instance. 2003-04-16 12:51:20 +00:00
igor%mir2.org f5bea75e19 In callVarargs to test if it is called from construct use thisObj==null condition instead of using separated flag. 2003-04-15 18:45:57 +00:00
igor%mir2.org fe0dcfe65f Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=200551 :
I added Context.getApplicationClassLoader() that is now used in all
cases as a parent loader for generated classes and as the default class loader
for NativeJavaPackage. The default implementation tries to use
Thread.getContextClassLoader, but only when it is available and if Rhino
classes is available through it. Otherwise the loader for Context instance is
used. In this way if Rhino is loaded through a custom loader, it will be used,
and if Rhino classes are placed in lib/ext,  Thread.getContextClassLoader still
give the application loader.

And if this default policy would not work in a particular application,
Context.getApplicationClassLoader() can be overridden to in that application.
2003-04-15 07:48:18 +00:00
igor%mir2.org 8c7fe87c7e Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=201989 :
use IdFunction.initAsConstructor to initialize Error constructors in
NativeGlobal.init and remove setFunctionType and corresponding getFunctionType in IdFunction and use a simple private boolean field there to mark functions that can be called as constructors since NativeGlobal.init was the only place that used that.
2003-04-15 07:43:30 +00:00
igor%mir2.org 99d83af296 Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=201987 :
Use toObject() in ScriptRuntime.delete to convert non-Scriptable delete target to Object which required to pass Context and scope to the method and update Interpreter and optimizer/Codegen accordingly.
2003-04-15 07:33:17 +00:00
igor%mir2.org fedeaf5b90 Duplicated code from IdFunction and FunctionObject to initialize prototype and scope of the result of call invocation when it is used as a part of constructor code is moved to a utility method initCallResultAsNewObject in BaseFunction. 2003-04-14 14:38:04 +00:00
igor%mir2.org 1771cf5e7c Replace code to generate:
if (val != null && val != Undefined.instance && val instanceof Scriptable) ...

by code to generate:

if (val instanceof Scriptable && val != Undefined.instance) ...

since (val instanceof Scriptable) => (val != null)
2003-04-14 13:53:18 +00:00
igor%mir2.org a29c7a81fa Instead of using the special _packages_ properties to store imported packages, use a field in ImporterTopLevel for simpler code. 2003-04-13 10:57:06 +00:00
igor%mir2.org c012edd6f6 Switch to use IdFunction to define ImporterTopLevel script methods. A separated class is used to implement IdFunctionMaster interface to avoid interface clashes with possible ImporterTopLevel subclasses implementing the same interface. 2003-04-13 08:57:57 +00:00
igor%mir2.org ca7b131ae5 1. In NativeJavaPackage.init define global properties only when NativeJavaPackage instance is fully initialized.
2. Memory optimization: instead of string array for predefined known packages, use single string which is split into substrings when necessary.
2003-04-13 08:54:09 +00:00
igor%mir2.org ef61833bb1 Switch to use the new utility IdFunction.define() method to define function properties instead of explicit code for function initialization and inlining of getMethod call since it is used only once to make code smaller. 2003-04-13 08:47:19 +00:00
igor%mir2.org b0a14f7279 I added static IdFunction.define utility method to define IdFunction instances as properties in the given scope. 2003-04-13 08:40:43 +00:00
igor%mir2.org 8b1123e397 Switch to use ClassFileWriter.addInvoke() taking full method signature including the result part as a single argument instead of deprecated 4-argument ClassFileWriter.add(). 2003-04-13 08:38:52 +00:00
igor%mir2.org f426f26c1d Commiting Hannes Wallnoefer patch to allow LiveConnect to convert JS Date to Java Data, see http://bugzilla.mozilla.org/show_bug.cgi?id=201326 2003-04-12 10:48:39 +00:00
igor%mir2.org 729a139dc3 Working on http://bugzilla.mozilla.org/show_bug.cgi?id=198208 :
I removed deprecated methods to access ClassNameHelper functionality through Context instance.
2003-04-01 14:52:27 +00:00
igor%mir2.org 64af9c759b Work for http://bugzilla.mozilla.org/show_bug.cgi?id=198208 :
I removed deprecated since 1.5R3 omj.ClassOutput and moved some of code from omj/ClassNameHelper.java to omj/optimizer/OptClassNameHelper so if one does not need the optimizer package, the jar will be smaller.
2003-04-01 11:39:08 +00:00
igor%mir2.org 9e16916a56 Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=199051 :
Initialize invoker in FunctionObject constructor, not during first call and catch possible SecurityException. In this way initialization will happen without script code on java stack which may not have permissions to create class loaders.
2003-03-31 13:18:04 +00:00
igor%mir2.org 2c0d284a12 Removal of deprecated SecuritySupport as a part of work on 198208. 2003-03-31 08:43:40 +00:00
nboyd%atg.com 0d0a9b51e2 change to 1.5R5 prerelease 2003-03-25 19:13:29 +00:00
nboyd%atg.com 3532c8b351 Switch to 1.5R5pre. 2003-03-25 19:11:58 +00:00
igor%mir2.org 9a1096723f Added ScriptRuntime.newInstanceOrNull to call class.newInstance() and return null if it fails. It allows to replace in few places try/3 different catch by a simple method call. 2003-03-20 15:46:37 +00:00
igor%mir2.org 591352c0ed Make ScriptRuntime.getClassOrNull() package private and use it in place of Class.forName() to avoid ever catching ClassNotFind and Security exceptions. 2003-03-19 19:04:24 +00:00
igor%mir2.org 071e6626a2 Removal of deprecated classes from the list of API docs 2003-03-19 14:14:29 +00:00
igor%mir2.org d8a4f2b19c Fixing JavaSoc documentation tag usage 2003-03-19 14:13:41 +00:00
igor%mir2.org cdf7a42c64 For concatenation of 2 strings that are not null use str1.concat(str2) instead of str1+str2 to avoid construction of temporary StringBuffer all together. 2003-03-19 12:36:48 +00:00
igor%mir2.org ec1028b7f8 Use ClassFileWriter.addInvoke to add method invocation code instead of deprecated 4-argument ClassFileWriter.add() to avoid unnecessary string concatenation to build full method signature from parameter and result signatures. 2003-03-19 11:19:21 +00:00
igor%mir2.org fde8484707 Use ClassFileWriter.addInvoke() instead of ClassFileWriter.add() to add method calls to avoid string concatenation when constructing full method signature from separated parameter and return signatures. 2003-03-17 12:39:19 +00:00
igor%mir2.org 11821416bb A version of the add method to add an invoke bytecode is deprectaed in favor of addInvoke that takes a full method signature in place of separated parameter and result signatures. It allow not use a string concatenination to build a full signature. 2003-03-16 17:45:34 +00:00