Bug 810962 - Add some simple ops. r=djvj
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 13 Nov 2012 15:16:21 +0100
changeset 112747 c0bf33b15e636bcc94e35fafc2525172677d583a
parent 112746 7c9cfaafa4a18647049e356e5404195b61a3f17f
child 112748 cf5360804074249dc1de3e022a678adf2924e82f
push id1353
push userjandemooij@gmail.com
push dateTue, 13 Nov 2012 14:16:43 +0000
reviewersdjvj
bugs810962
milestone19.0a1
Bug 810962 - Add some simple ops. r=djvj
js/src/ion/BaselineCompiler.cpp
js/src/ion/BaselineCompiler.h
--- a/js/src/ion/BaselineCompiler.cpp
+++ b/js/src/ion/BaselineCompiler.cpp
@@ -185,16 +185,22 @@ OPCODE_LIST(EMIT_OP)
 
 bool
 BaselineCompiler::emit_JSOP_NOP()
 {
     return true;
 }
 
 bool
+BaselineCompiler::emit_JSOP_LABEL()
+{
+    return true;
+}
+
+bool
 BaselineCompiler::emit_JSOP_POP()
 {
     frame.pop();
     return true;
 }
 
 bool
 BaselineCompiler::emit_JSOP_DUP()
@@ -284,16 +290,59 @@ BaselineCompiler::emit_JSOP_LOOPHEAD()
 
 bool
 BaselineCompiler::emit_JSOP_LOOPENTRY()
 {
     return true;
 }
 
 bool
+BaselineCompiler::emit_JSOP_VOID()
+{
+    frame.pop();
+    frame.push(UndefinedValue());
+    return true;
+}
+
+bool
+BaselineCompiler::emit_JSOP_UNDEFINED()
+{
+    frame.push(UndefinedValue());
+    return true;
+}
+
+bool
+BaselineCompiler::emit_JSOP_HOLE()
+{
+    frame.push(MagicValue(JS_ARRAY_HOLE));
+    return true;
+}
+
+bool
+BaselineCompiler::emit_JSOP_NULL()
+{
+    frame.push(NullValue());
+    return true;
+}
+
+bool
+BaselineCompiler::emit_JSOP_TRUE()
+{
+    frame.push(BooleanValue(true));
+    return true;
+}
+
+bool
+BaselineCompiler::emit_JSOP_FALSE()
+{
+    frame.push(BooleanValue(false));
+    return true;
+}
+
+bool
 BaselineCompiler::emit_JSOP_ZERO()
 {
     frame.push(Int32Value(0));
     return true;
 }
 
 bool
 BaselineCompiler::emit_JSOP_ONE()
@@ -325,16 +374,30 @@ BaselineCompiler::emit_JSOP_UINT16()
 
 bool
 BaselineCompiler::emit_JSOP_UINT24()
 {
     frame.push(Int32Value(GET_UINT24(pc)));
     return true;
 }
 
+bool
+BaselineCompiler::emit_JSOP_DOUBLE()
+{
+    frame.push(script->getConst(GET_UINT32_INDEX(pc)));
+    return true;
+}
+
+bool
+BaselineCompiler::emit_JSOP_STRING()
+{
+    frame.push(StringValue(script->getAtom(GET_UINT32_INDEX(pc))));
+    return true;
+}
+
 void
 BaselineCompiler::storeValue(const StackValue *source, const Address &dest,
                              const ValueOperand &scratch)
 {
     switch (source->kind()) {
       case StackValue::Constant:
         masm.storeValue(source->constant(), dest);
         break;
--- a/js/src/ion/BaselineCompiler.h
+++ b/js/src/ion/BaselineCompiler.h
@@ -26,29 +26,38 @@
 #error "CPU Not Supported"
 #endif
 
 namespace js {
 namespace ion {
 
 #define OPCODE_LIST(_)         \
     _(JSOP_NOP)                \
+    _(JSOP_LABEL)              \
     _(JSOP_POP)                \
     _(JSOP_DUP)                \
     _(JSOP_GOTO)               \
     _(JSOP_IFNE)               \
     _(JSOP_POS)                \
     _(JSOP_LOOPHEAD)           \
     _(JSOP_LOOPENTRY)          \
+    _(JSOP_VOID)               \
+    _(JSOP_UNDEFINED)          \
+    _(JSOP_HOLE)               \
+    _(JSOP_NULL)               \
+    _(JSOP_TRUE)               \
+    _(JSOP_FALSE)              \
     _(JSOP_ZERO)               \
     _(JSOP_ONE)                \
     _(JSOP_INT8)               \
     _(JSOP_INT32)              \
     _(JSOP_UINT16)             \
     _(JSOP_UINT24)             \
+    _(JSOP_DOUBLE)             \
+    _(JSOP_STRING)             \
     _(JSOP_ADD)                \
     _(JSOP_LT)                 \
     _(JSOP_GT)                 \
     _(JSOP_GETLOCAL)           \
     _(JSOP_SETLOCAL)           \
     _(JSOP_GETARG)             \
     _(JSOP_SETARG)             \
     _(JSOP_RETURN)             \