Bug 1062473: Add 'pointer-byte-size' to getBuildConfiguration results. r=sfink
authorJim Blandy <jimb@mozilla.com>
Mon, 16 Feb 2015 14:22:44 -0800
changeset 239626 2be405299a3ab111a11110a3176c386b36a95759
parent 239625 8fcb10ac4ee5b8e2630c7eae30a8054249f05f04
child 239627 c74b408461c21ae7cbef5bed38de08a4a71b69af
push id12444
push userryanvm@gmail.com
push dateFri, 17 Apr 2015 20:04:42 +0000
treeherderfx-team@560a202db924 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1062473
milestone40.0a1
Bug 1062473: Add 'pointer-byte-size' to getBuildConfiguration results. r=sfink
js/src/builtin/TestingFunctions.cpp
js/src/jit-test/tests/heap-analysis/pointerByteSize.js
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -206,16 +206,20 @@ GetBuildConfiguration(JSContext* cx, uns
 #ifdef MOZ_MEMORY
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
     if (!JS_SetProperty(cx, info, "moz-memory", value))
         return false;
 
+    value.setInt32(sizeof(void *));
+    if (!JS_SetProperty(cx, info, "pointer-byte-size", value))
+        return false;
+
     args.rval().setObject(*info);
     return true;
 }
 
 static bool
 GC(JSContext* cx, unsigned argc, jsval* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/heap-analysis/pointerByteSize.js
@@ -0,0 +1,3 @@
+// Try out the pointerByteSize shell function.
+var size = getBuildConfiguration()["pointer-byte-size"];
+assertEq(size == 4 || size == 8, true);