public
Rubygem
Description: Johnson wraps JavaScript in a loving Ruby embrace.
Homepage: http://github.com/jbarnette/johnson/wikis
Clone URL: git://github.com/jbarnette/johnson.git
Search Repo:
Updating SpiderMonkey.
jbarnette (author)
Sun Jul 06 03:03:57 -0700 2008
commit  eb003e58b22a30591c9b2ed0eedc172ee837ae25
tree    f951a16c909bdde81462ee45b98e0e804fe84f5d
parent  5c40882c3aba3ce1f26bb07fee4593cc1199888b
...
30
31
32
33
34
35
36
...
60
61
62
63
64
65
66
...
98
99
100
101
102
103
104
...
119
120
121
 
 
 
...
30
31
32
 
33
34
35
...
59
60
61
 
62
63
64
...
96
97
98
 
99
100
101
...
116
117
118
119
120
121
0
@@ -30,7 +30,6 @@ D/fdlibm////
0
 /jsbool.h/3.11/Tue Jun 24 17:39:41 2008//
0
 /jsclist.h/3.8/Tue Jun 24 17:39:41 2008//
0
 /jscntxt.c/3.136/Tue Jun 24 17:39:41 2008//
0
-/jscntxt.h/3.204/Tue Jun 24 17:39:41 2008//
0
 /jscompat.h/3.9/Tue Jun 24 17:39:41 2008//
0
 /jsconfig.h/3.46/Tue Jun 24 17:39:41 2008//
0
 /jsconfig.mk/3.9/Tue Jun 24 17:39:41 2008//
0
@@ -60,7 +59,6 @@ D/fdlibm////
0
 /jshash.c/3.20/Tue Jun 24 17:39:41 2008//
0
 /jshash.h/3.11/Tue Jun 24 17:39:41 2008//
0
 /jsify.pl/3.1/Tue Jun 24 17:39:41 2008//
0
-/jsinterp.c/3.498/Tue Jun 24 17:39:41 2008//
0
 /jsinterp.h/3.93/Tue Jun 24 17:39:41 2008//
0
 /jsinvoke.c/3.1/Tue Jun 24 17:39:41 2008//
0
 /jsiter.c/3.102/Tue Jun 24 17:39:41 2008//
0
@@ -98,7 +96,6 @@ D/fdlibm////
0
 /jsscan.h/3.53/Tue Jun 24 17:39:41 2008//
0
 /jsscope.c/3.87/Tue Jun 24 17:39:41 2008//
0
 /jsscope.h/3.59/Tue Jun 24 17:39:41 2008//
0
-/jsscript.c/3.180/Tue Jun 24 17:39:41 2008//
0
 /jsscript.h/3.45/Tue Jun 24 17:39:41 2008//
0
 /jsshell.msg/3.6/Tue Jun 24 17:39:41 2008//
0
 /jsstddef.h/1.8/Tue Jun 24 17:39:41 2008//
0
@@ -119,3 +116,6 @@ D/fdlibm////
0
 /resource.h/3.2/Tue Jun 24 17:39:41 2008//
0
 /rules.mk/3.16/Tue Jun 24 17:39:41 2008//
0
 /win32.order/1.6/Tue Jun 24 17:39:41 2008//
0
+/jscntxt.h/3.205/Sun Jul 6 10:03:00 2008//
0
+/jsinterp.c/3.499/Sun Jul 6 10:03:00 2008//
0
+/jsscript.c/3.181/Sun Jul 6 10:03:00 2008//
...
61
62
63
64
 
 
 
65
66
67
 
68
69
70
...
79
80
81
82
 
83
84
85
...
61
62
63
 
64
65
66
67
68
 
69
70
71
72
...
81
82
83
 
84
85
86
87
0
@@ -61,10 +61,12 @@ JS_BEGIN_EXTERN_C
0
 
0
 /*
0
  * js_GetSrcNote cache to avoid O(n^2) growth in finding a source note for a
0
- * given pc in a script.
0
+ * given pc in a script. We use the script->code pointer to tag the cache,
0
+ * instead of the script address itself, so that source notes are always found
0
+ * by offset from the bytecode with which they were generated.
0
  */
0
 typedef struct JSGSNCache {
0
- JSScript *script;
0
+ jsbytecode *code;
0
     JSDHashTable table;
0
 #ifdef JS_GSNMETER
0
     uint32 hits;
0
@@ -79,7 +81,7 @@ typedef struct JSGSNCache {
0
 
0
 #define GSN_CACHE_CLEAR(cache) \
0
     JS_BEGIN_MACRO \
0
- (cache)->script = NULL; \
0
+ (cache)->code = NULL; \
0
         if ((cache)->table.ops) { \
0
             JS_DHashTableFinish(&(cache)->table); \
0
             (cache)->table.ops = NULL; \
...
3688
3689
3690
3691
3692
 
3693
3694
 
3695
3696
3697
...
3688
3689
3690
 
3691
3692
3693
 
3694
3695
3696
3697
0
@@ -3688,10 +3688,10 @@ interrupt:
0
 
0
 #define BINARY_OP(OP) \
0
     JS_BEGIN_MACRO \
0
- FETCH_NUMBER(cx, -1, d2); \
0
         FETCH_NUMBER(cx, -2, d); \
0
+ FETCH_NUMBER(cx, -1, d2); \
0
         d = d OP d2; \
0
- regs.sp--; \
0
+ regs.sp--; \
0
         STORE_NUMBER(cx, -1, d); \
0
     JS_END_MACRO
0
 
...
1532
1533
1534
1535
 
1536
1537
1538
...
1633
1634
1635
1636
 
1637
1638
1639
...
1655
1656
1657
1658
 
1659
1660
1661
...
1681
1682
1683
1684
 
1685
1686
1687
...
1532
1533
1534
 
1535
1536
1537
1538
...
1633
1634
1635
 
1636
1637
1638
1639
...
1655
1656
1657
 
1658
1659
1660
1661
...
1681
1682
1683
 
1684
1685
1686
1687
0
@@ -1532,7 +1532,7 @@ js_DestroyScript(JSContext *cx, JSScript *script)
0
     if (script->principals)
0
         JSPRINCIPALS_DROP(cx, script->principals);
0
 
0
- if (JS_GSN_CACHE(cx).script == script)
0
+ if (JS_GSN_CACHE(cx).code == script->code)
0
         JS_CLEAR_GSN_CACHE(cx);
0
 
0
     /*
0
@@ -1633,7 +1633,7 @@ js_GetSrcNoteCached(JSContext *cx, JSScript *script, jsbytecode *pc)
0
     if ((uint32)target >= script->length)
0
         return NULL;
0
 
0
- if (JS_GSN_CACHE(cx).script == script) {
0
+ if (JS_GSN_CACHE(cx).code == script->code) {
0
         JS_METER_GSN_CACHE(cx, hits);
0
         entry = (GSNCacheEntry *)
0
                 JS_DHashTableOperate(&JS_GSN_CACHE(cx).table, pc,
0
@@ -1655,7 +1655,7 @@ js_GetSrcNoteCached(JSContext *cx, JSScript *script, jsbytecode *pc)
0
         }
0
     }
0
 
0
- if (JS_GSN_CACHE(cx).script != script &&
0
+ if (JS_GSN_CACHE(cx).code != script->code &&
0
         script->length >= GSN_CACHE_THRESHOLD) {
0
         JS_CLEAR_GSN_CACHE(cx);
0
         nsrcnotes = 0;
0
@@ -1681,7 +1681,7 @@ js_GetSrcNoteCached(JSContext *cx, JSScript *script, jsbytecode *pc)
0
                     entry->sn = sn;
0
                 }
0
             }
0
- JS_GSN_CACHE(cx).script = script;
0
+ JS_GSN_CACHE(cx).code = script->code;
0
             JS_METER_GSN_CACHE(cx, fills);
0
         }
0
     }

Comments

    No one has commented yet.