Changeset 34593 in webkit for trunk/JavaScriptCore/kjs/nodes.h
- Timestamp:
- Jun 16, 2008, 1:19:17 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.h
r34581 r34593 1133 1133 }; 1134 1134 1135 class UnaryPlusNode : public ExpressionNode { 1135 class UnaryOpNode : public ExpressionNode { 1136 public: 1137 UnaryOpNode(ExpressionNode* expr) 1138 : m_expr(expr) 1139 { 1140 } 1141 1142 UnaryOpNode(JSType type, ExpressionNode* expr) 1143 : ExpressionNode(type) 1144 , m_expr(expr) 1145 { 1146 } 1147 1148 virtual RegisterID* emitCode(CodeGenerator&, RegisterID* = 0) KJS_FAST_CALL; 1149 virtual OpcodeID opcode() const KJS_FAST_CALL = 0; 1150 1151 protected: 1152 RefPtr<ExpressionNode> m_expr; 1153 }; 1154 1155 class UnaryPlusNode : public UnaryOpNode { 1136 1156 public: 1137 1157 UnaryPlusNode(ExpressionNode* expr) KJS_FAST_CALL 1138 : ExpressionNode(NumberType) 1139 , m_expr(expr) 1140 { 1141 } 1142 1143 virtual RegisterID* emitCode(CodeGenerator&, RegisterID* = 0) KJS_FAST_CALL; 1158 : UnaryOpNode(NumberType, expr) 1159 { 1160 } 1161 1162 virtual OpcodeID opcode() const KJS_FAST_CALL { return op_to_jsnumber; } 1144 1163 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1145 1164 virtual Precedence precedence() const { return PrecUnary; } 1146 1147 private: 1148 RefPtr<ExpressionNode> m_expr; 1149 }; 1150 1151 class NegateNode : public ExpressionNode { 1165 }; 1166 1167 class NegateNode : public UnaryOpNode { 1152 1168 public: 1153 1169 NegateNode(ExpressionNode* expr) KJS_FAST_CALL 1154 : ExpressionNode(NumberType) 1155 , m_expr(expr) 1156 { 1157 } 1158 1159 virtual RegisterID* emitCode(CodeGenerator&, RegisterID* = 0) KJS_FAST_CALL; 1170 : UnaryOpNode(NumberType, expr) 1171 { 1172 } 1173 1174 virtual OpcodeID opcode() const KJS_FAST_CALL { return op_negate; } 1160 1175 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1161 1176 virtual Precedence precedence() const { return PrecUnary; } 1162 1163 private: 1164 RefPtr<ExpressionNode> m_expr; 1165 }; 1166 1167 class BitwiseNotNode : public ExpressionNode { 1177 }; 1178 1179 class BitwiseNotNode : public UnaryOpNode { 1168 1180 public: 1169 1181 BitwiseNotNode(ExpressionNode* expr) KJS_FAST_CALL 1170 : ExpressionNode(NumberType) 1171 , m_expr(expr) 1172 { 1173 } 1174 1175 virtual RegisterID* emitCode(CodeGenerator&, RegisterID* = 0) KJS_FAST_CALL; 1182 : UnaryOpNode(NumberType, expr) 1183 { 1184 } 1185 1186 virtual OpcodeID opcode() const KJS_FAST_CALL { return op_bitnot; } 1176 1187 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1177 1188 virtual Precedence precedence() const { return PrecUnary; } 1178 1179 private: 1180 RefPtr<ExpressionNode> m_expr; 1181 }; 1182 1183 class LogicalNotNode : public ExpressionNode { 1189 }; 1190 1191 class LogicalNotNode : public UnaryOpNode { 1184 1192 public: 1185 1193 LogicalNotNode(ExpressionNode* expr) KJS_FAST_CALL 1186 : ExpressionNode(BooleanType) 1187 , m_expr(expr) 1188 { 1189 } 1190 1191 virtual RegisterID* emitCode(CodeGenerator&, RegisterID* = 0) KJS_FAST_CALL; 1194 : UnaryOpNode(BooleanType, expr) 1195 { 1196 } 1197 1198 virtual OpcodeID opcode() const KJS_FAST_CALL { return op_not; } 1192 1199 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1193 1200 virtual Precedence precedence() const { return PrecUnary; } 1194 1195 private:1196 RefPtr<ExpressionNode> m_expr;1197 1201 }; 1198 1202
Note:
See TracChangeset
for help on using the changeset viewer.