Closed
Bug 461549
Opened 16 years ago
Closed 16 years ago
Traceable print and shapeOf functions for js shell
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jorendorff, Assigned: jorendorff)
Details
Attachments
(1 file, 1 obsolete file)
4.66 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
I found them useful for debugging bug 456384 (v8-richards); YMMV.
Attachment #344652 -
Flags: review?(mrbkap)
Comment 1•16 years ago
|
||
Comment on attachment 344652 [details] [diff] [review] v1 >diff --git a/js/src/js.cpp b/js/src/js.cpp >+static jsval >+Print_tn(JSContext *cx, JSString *str) This needs to be FASTCALL, right? >+static JSBool >+ShapeOf(JSContext *cx, uintN argc, jsval *vp) >+{ ... >+ JSBool ok = JS_NewNumberValue(cx, ShapeOf_tn(JSVAL_TO_OBJECT(v)), &v); >+ if (ok) >+ JS_SET_RVAL(cx, vp, v); > return ok; If we wanted to assume that we knew what's going on here (which we do), then this could just be: return JS_NewNumberValue(cx, ShapeOf_tn(JSVAL_TO_OBJECT(f)), vp); but that's your call. Holding off on stamping because of the FASTCALL thing.
Assignee | ||
Comment 2•16 years ago
|
||
OK, I'll take that. We're already breaking abstractions here, might as well be thorough. $ interdiff shapeOf-v1.patch shapeOf-v2.patch diff -u b/js/src/js.cpp b/js/src/js.cpp --- b/js/src/js.cpp +++ b/js/src/js.cpp @@ -760,7 +760,7 @@ return JS_TRUE; } -static jsval +static jsval JS_FASTCALL Print_tn(JSContext *cx, JSString *str) { char *bytes = JS_EncodeString(cx, str); @@ -2570,10 +2570,7 @@ JS_ReportError(cx, "shapeOf: object expected"); return JS_FALSE; } - JSBool ok = JS_NewNumberValue(cx, ShapeOf_tn(JSVAL_TO_OBJECT(v)), &v); - if (ok) - JS_SET_RVAL(cx, vp, v); - return ok; + return JS_NewNumberValue(cx, ShapeOf_tn(JSVAL_TO_OBJECT(v)), vp); } #ifdef JS_THREADSAFE
Assignee: general → jorendorff
Attachment #344652 -
Attachment is obsolete: true
Attachment #344666 -
Flags: review?(mrbkap)
Attachment #344652 -
Flags: review?(mrbkap)
Updated•16 years ago
|
Attachment #344666 -
Flags: review?(mrbkap) → review+
Comment 3•16 years ago
|
||
Please use "fflush(gOutFile);" in Print_tn to be consistent with Print. See bug 423042.
Assignee | ||
Comment 4•16 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/70955fd0d1ee I added a call to fflush - sorry I missed that.
Assignee | ||
Updated•16 years ago
|
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Flags: in-testsuite-
Flags: in-litmus-
You need to log in
before you can comment on or make changes to this bug.
Description
•