Implement JSOP_VOID. No bug, r=dvander
authorHannes Verschore <hverschore@mozilla.com>
Fri, 12 Aug 2011 11:05:40 -0700
changeset 108715 6c99b3ba5423e8c9d316aaf9a10a08628416f13f
parent 108714 9a7208406f77e5c058c10706715f9014f945f27e
child 108716 0988a70d95be51559fb2556af191efc93b404197
push id2248
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 19:23:44 +0000
treeherdermozilla-aurora@118a3b748323 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
milestone8.0a1
Implement JSOP_VOID. No bug, r=dvander
js/src/ion/IonBuilder.cpp
js/src/jit-test/tests/ion/void.js
--- a/js/src/ion/IonBuilder.cpp
+++ b/js/src/ion/IonBuilder.cpp
@@ -398,16 +398,20 @@ IonBuilder::inspectOpcode(JSOp op)
         return pushConstant(Int32Value(0));
 
       case JSOP_ONE:
         return pushConstant(Int32Value(1));
 
       case JSOP_NULL:
         return pushConstant(NullValue());
 
+      case JSOP_VOID:
+        current->pop();
+        return pushConstant(UndefinedValue());
+
       case JSOP_FALSE:
         return pushConstant(BooleanValue(false));
 
       case JSOP_TRUE:
         return pushConstant(BooleanValue(true));
 
       case JSOP_GETARG:
         current->pushArg(GET_SLOTNO(pc));
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/void.js
@@ -0,0 +1,6 @@
+function f() {
+    var b, c;
+    var a = void ( b = 5, c = 7 );    
+    return a;
+}
+assertEq(typeof f(), "undefined")