1849 Commits

Author SHA1 Message Date
fur
90721aa429 + Fixed heap corruption caused by free'ing of an uninitialized pointer.
+ Changed the way JS wrapper functions for Java instance methods are constructed.

  Previously, these were computed the first time that an instance method was
  accessed for a particular JavaObject and cached in the native, private portion
  of that JavaObject.  However, the required call to JS_AddRoot() causes an root
  to appear as a link in a cyclical graph, leading to uncollectible objects, i.e.
  the JavaObject has a root pointer to the function object and the function has
  a parent that points back to the JavaObject.  Now, we compute the functions
  at the time a class is reflected and use JS_CloneFunctionObject() each time
  a JS wrapper function is needed, which is slower, but avoids this GC problem.


git-svn-id: svn://10.0.0.236/trunk@5005 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-03 15:50:16 +00:00
fur
5d2426cebb Tweaked comment.
git-svn-id: svn://10.0.0.236/trunk@4985 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-03 02:43:34 +00:00
fur
c583e2e8f7 Fix Win32 warnings that were introduced as a result of curing Mac warnings.
git-svn-id: svn://10.0.0.236/trunk@4984 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-03 02:42:16 +00:00
fur
0318d6d143 Got rid of debug printf().
git-svn-id: svn://10.0.0.236/trunk@4983 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-03 02:41:31 +00:00
fur
cf3292cbf7 Added Compatibility discussion.
Tweaked Mac build instructions.


git-svn-id: svn://10.0.0.236/trunk@4982 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-03 02:40:48 +00:00
fur
e121f64e4f Fixed incorect argument type in jlong_to_jdouble() which was causing Java long values to get mangled.
git-svn-id: svn://10.0.0.236/trunk@4964 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-03 00:00:15 +00:00
fur
b601507a5e Use Types.h instead of more modern MacTypes.h so that we can build with CodeWarrior 2 on the Mac.
git-svn-id: svn://10.0.0.236/trunk@4891 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-02 04:11:53 +00:00
montulli
20e270f2b3 merge montulli1 branch with tip
git-svn-id: svn://10.0.0.236/trunk@4889 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-02 02:41:04 +00:00
shaver
c00692bd31 forgot the NPL
git-svn-id: svn://10.0.0.236/trunk@4824 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 19:59:06 +00:00
beard
feeaf633f6 Fixed unintended assignment warning in lookup_member_by_id.
git-svn-id: svn://10.0.0.236/trunk@4823 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 18:58:29 +00:00
beard
546d7d594b Fixed unintended assignment warning in access_java_array_element.
git-svn-id: svn://10.0.0.236/trunk@4822 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 18:55:49 +00:00
beard
9d8774e021 Added prototype for jsj_ConvertJavaStringToJSString.
git-svn-id: svn://10.0.0.236/trunk@4820 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 18:48:12 +00:00
beard
87f6d6e462 enter_js now static, since it had no external prototype.
git-svn-id: svn://10.0.0.236/trunk@4819 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 18:47:26 +00:00
beard
93f8eb2a1a define_JavaPackage now static since it had no external prototype.
git-svn-id: svn://10.0.0.236/trunk@4818 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 18:46:23 +00:00
beard
2a4bff8f61 JavaObject_getObjectOps now static since it had no external prototype.
git-svn-id: svn://10.0.0.236/trunk@4817 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 18:45:32 +00:00
beard
65dfe85d74 JavaClass_getObjectOps, jsj_new_JavaClass now static, since they had no external prototypes anyway.
git-svn-id: svn://10.0.0.236/trunk@4816 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 18:44:50 +00:00
beard
10021cd9dc Made JavaArray_getObjectOps static to fix no prototype warning.
git-svn-id: svn://10.0.0.236/trunk@4814 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 18:43:16 +00:00
beard
f56b7bed0f Fixed unintended assignment warnings, made default_map_java_object_to_js_object static to fix no prototype warning.
git-svn-id: svn://10.0.0.236/trunk@4813 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 18:42:27 +00:00
beard
618e21bd13 Removed some dead code.
git-svn-id: svn://10.0.0.236/trunk@4811 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 18:37:43 +00:00
shaver
d72485a1e5 adding XPCOM interface support (non-functional) -- not part of Gromit
git-svn-id: svn://10.0.0.236/trunk@4808 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 18:18:00 +00:00
fur
d4018e3656 If the same JSObject is reflected into Java more than once then we should
return the same Java object, both for efficiency and so that the '=='
operator works as expected in Java when comparing two JSObjects.
However, it is not possible to hold a reference to a Java object without
inhibiting GC of that object, at least not in a way that is portable
to all vendor's JVMs, i.e. a weak reference. So, for now, JSObject identity
is broken.


git-svn-id: svn://10.0.0.236/trunk@4782 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 06:11:39 +00:00
fur
fe603e369e Added equals() method to override java.lang.Object.equals(). This is
necessary because the '==' operator won't work with LC2.


git-svn-id: svn://10.0.0.236/trunk@4781 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 06:00:10 +00:00
brendan
cc6ce74501 - Remove duplicate error fprintf from js.c:Load.
- Revise exception handling runtime info (now called trynotes a la srcnotes)
  for more efficient loop control under JSOP_THROW.  Avoid all uses of catch
  and throw while at it, to make C++ lusers happy.
- Combine JSStackFrame.exception with rval, and rename
  JSStackFrame.exceptPending to be ...throwing.
- Optimize JS_TypeOfValue a bit.
- Name, control flow, whitespace, etc. cleanup.


git-svn-id: svn://10.0.0.236/trunk@4772 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 02:12:45 +00:00
beard
69e8927cbd Changed jsj_HashJavaObject to conform to JSJHashFunction.
git-svn-id: svn://10.0.0.236/trunk@4766 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-01 00:21:18 +00:00
beard
5959c9b500 #defined PR_IMPLEMENT for XP_MAC/XP_UNIX cases.
git-svn-id: svn://10.0.0.236/trunk@4744 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-30 22:18:23 +00:00
beard
35cfe6062d Fixed JSVAL_TO_JLONG_JVALUE macro for XP_MAC -- can't assign 0 directly to a jlong.
git-svn-id: svn://10.0.0.236/trunk@4743 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-30 22:17:19 +00:00
beard
16ea61e480 Added jsj_hash.c, turned on debugging by default.
git-svn-id: svn://10.0.0.236/trunk@4741 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-30 22:15:38 +00:00
fur
09fea5f8fe = Replicate the JS engine machinery that gives the appearance of converting
all element access expressions to strings, e.g. so that obj["3"] and
  obj[3] refer to the same property for a JavaArray object.

= Return false when using 'delete' operator on JavaArray objects.


git-svn-id: svn://10.0.0.236/trunk@4714 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-30 18:18:03 +00:00
fur
88bc9aaf64 Return false when using the 'delete' operator on JavaClass or JavaObject objects.
git-svn-id: svn://10.0.0.236/trunk@4711 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-30 18:10:14 +00:00
fur
5bc94271e8 Eliminated the last uses of the JNIEnv global variable. Unfortunately, this
means that we had to switch from using NSPR hash tables to a private version.
The new jsj_hash.c file is derived from plhash.c, but it provides for an additional
argument to be passed to the hash key comparison function.  This capability
is used to pass in the JNIEnv pointer.

On shutdown, LiveConnect now removes all references to Java objects and classes,
so that the JVM might be able to GC them.


git-svn-id: svn://10.0.0.236/trunk@4706 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-30 10:04:32 +00:00
norris
8c66cb57c2 (Not part of Communicator build.)
fur's fix for repeating properties in enumeration bug.


git-svn-id: svn://10.0.0.236/trunk@4675 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-29 22:01:22 +00:00
norris
efab4ced7d (Not part of Communicator build.)
Handle NaNs better for non-PC platforms as well.


git-svn-id: svn://10.0.0.236/trunk@4674 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-29 22:00:11 +00:00
fur
eab84ce532 Aggressively track and release JNI local references to constructed
Java objects, because otherwise at least one JVM is reticent about
GC'ing them.


git-svn-id: svn://10.0.0.236/trunk@4656 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-28 07:53:04 +00:00
fur
4afcf18993 = Force result to zero when converting JS NaN to Java integral types.
= Aggressively track and release JNI local references to constructed
  Java objects, because otherwise at least one JVM is reticent about
  GC'ing them.


git-svn-id: svn://10.0.0.236/trunk@4655 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-28 07:52:23 +00:00
fur
60abeb293c Added toString() method for JavaPackage objects.
git-svn-id: svn://10.0.0.236/trunk@4654 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-28 07:51:27 +00:00
fur
64ba961948 Property deletion should be silent for ECMA-conformant versions of JS.
git-svn-id: svn://10.0.0.236/trunk@4653 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-28 07:50:47 +00:00
fur
94fedc809c Property deletion should be silent for ECMA-conformant versions of JS.
git-svn-id: svn://10.0.0.236/trunk@4652 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-28 07:39:58 +00:00
beard
bfa75471f4 Added code that guarantees MRJ will be shutdown when the program exits.
git-svn-id: svn://10.0.0.236/trunk@4646 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-27 18:24:26 +00:00
atotic
2f3828e7a8 Remove NavigatorStubs dependency
Added new targets (JavaScriptNoJSJ$D) to build JavaScript without JSJ dependency.


git-svn-id: svn://10.0.0.236/trunk@4611 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-26 23:37:04 +00:00
atotic
8b49e55a21 Implemented MyReadLocation inline to remove the NavigatorStubs dependency
git-svn-id: svn://10.0.0.236/trunk@4610 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-26 23:35:01 +00:00
fur
38185cca7b Tweaked error messages and comments.
git-svn-id: svn://10.0.0.236/trunk@4562 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-26 06:46:15 +00:00
fur
c74bb371ca Store overloaded methods in the same order as they arrive from the JVM, so
that overloaded method resolution works the same as before, although probably
only with the Sun JVM, because this order isn't specified anywhere.


git-svn-id: svn://10.0.0.236/trunk@4561 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-26 06:45:04 +00:00
fur
b2ea090c2b When running in ECMA-compatibility mode, silently ignore attempts to delete
properties of JavaArray objects.


git-svn-id: svn://10.0.0.236/trunk@4556 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-26 05:44:02 +00:00
mccabe
4722c241c8 (Not part of the client build.)
Parenthesized assignment-in-conditional to quiet gcc compiler warning.


git-svn-id: svn://10.0.0.236/trunk@4513 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-25 18:36:53 +00:00
mccabe
3a9f94eeae Extend #ifdef SHELL_HACK from recent fix to 187538 (mistakenly 187537)
to avoid compiler warning on defined-but-unused 'Exec'.


git-svn-id: svn://10.0.0.236/trunk@4512 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-25 18:34:13 +00:00
norris
d1f93f089d (Not part of Communicator build.)
Fix GC bug involving load().


git-svn-id: svn://10.0.0.236/trunk@4493 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-25 15:56:19 +00:00
spider
d56dcfe52f NORMANDY_DDAY merge...
git-svn-id: svn://10.0.0.236/trunk@4478 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-25 05:50:45 +00:00
mccabe
d40b3992ac Fix to 187537. The 'assign' hack was interacting with the 'shell
command' hack - the resolver defined by js.c would get called to look
up 'assign' - and on Irix systems, it would find the 'assign' command
in the current path, and decide to define a function called 'assign'
in the global object that would run the assign command.  Then when an
attempt was made to assign a property to the global object, the assign
command would get run, and unexpected behavior followed.


git-svn-id: svn://10.0.0.236/trunk@4461 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-25 02:07:13 +00:00
fur
d322c107cd Conversion to a primitive now results in a string value, even with a
hint of JSTYPE_NUMBER.  This is a case that nobody cares about, but it's
used in a LiveConnect test case.

Added more registered Java packages for reduced server-roundtrips.  Also,
loosened restrictions on accessing unregistered packages under "java" and
some of the other packages, in case Sun or somebody adds a "java.fooBar"
package.


git-svn-id: svn://10.0.0.236/trunk@4398 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-24 05:47:46 +00:00
fur
a572d8d419 Allow closures when the JS version is JSVERSION_DEFAULT.
git-svn-id: svn://10.0.0.236/trunk@4395 18797224-902f-48f8-a5cc-f745e15eee43
1998-06-24 05:37:44 +00:00