Changeset 21080 in webkit for trunk/JavaScriptCore/kjs/nodes.h
- Timestamp:
- Apr 24, 2007, 7:11:33 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.h
r21032 r21080 30 30 #include <wtf/ListRefPtr.h> 31 31 #include <wtf/Vector.h> 32 33 #if PLATFORM(X86) && COMPILER(GCC) 34 #define KJS_FAST_CALL __attribute__((regparm(3))) 35 #else 36 #define KJS_FAST_CALL 37 #endif 32 38 33 39 namespace KJS { … … 73 79 class Node { 74 80 public: 75 Node() ;81 Node() KJS_FAST_CALL; 76 82 virtual ~Node(); 77 83 78 virtual JSValue *evaluate(ExecState *exec) = 0;79 UString toString() const ;80 virtual void streamTo(SourceStream&) const = 0;81 virtual void processVarDecls(ExecState*) {}82 int lineNo() const { return m_line; }83 84 void ref() ;85 void deref() ;86 unsigned refcount() ;87 static void clearNewNodes() ;88 89 virtual Node *nodeInsideAllParens() ;90 91 virtual bool isLocation() const { return false; }92 virtual bool isResolveNode() const { return false; }93 virtual bool isBracketAccessorNode() const { return false; }94 virtual bool isDotAccessorNode() const { return false; }95 virtual bool isGroupNode() const { return false; }96 97 virtual void breakCycle() { }84 virtual JSValue *evaluate(ExecState *exec) KJS_FAST_CALL = 0; 85 UString toString() const KJS_FAST_CALL; 86 virtual void streamTo(SourceStream&) const KJS_FAST_CALL = 0; 87 virtual void processVarDecls(ExecState*) KJS_FAST_CALL {} 88 int lineNo() const KJS_FAST_CALL { return m_line; } 89 90 void ref() KJS_FAST_CALL; 91 void deref() KJS_FAST_CALL; 92 unsigned refcount() KJS_FAST_CALL; 93 static void clearNewNodes() KJS_FAST_CALL; 94 95 virtual Node *nodeInsideAllParens() KJS_FAST_CALL; 96 97 virtual bool isLocation() const KJS_FAST_CALL { return false; } 98 virtual bool isResolveNode() const KJS_FAST_CALL { return false; } 99 virtual bool isBracketAccessorNode() const KJS_FAST_CALL { return false; } 100 virtual bool isDotAccessorNode() const KJS_FAST_CALL { return false; } 101 virtual bool isGroupNode() const KJS_FAST_CALL { return false; } 102 103 virtual void breakCycle() KJS_FAST_CALL { } 98 104 99 105 protected: 100 Completion createErrorCompletion(ExecState *, ErrorType, const char *msg) ;101 Completion createErrorCompletion(ExecState *, ErrorType, const char *msg, const Identifier &) ;102 103 JSValue *throwError(ExecState *, ErrorType, const char *msg) ;104 JSValue* throwError(ExecState *, ErrorType, const char* msg, const char*) ;105 JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, Node *) ;106 JSValue *throwError(ExecState *, ErrorType, const char *msg, const Identifier &) ;107 JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, const Identifier &) ;108 JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, Node *, Node *) ;109 JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, Node *, const Identifier &) ;110 111 JSValue *throwUndefinedVariableError(ExecState *, const Identifier &) ;112 113 void handleException(ExecState*) ;114 void handleException(ExecState*, JSValue*) ;106 Completion createErrorCompletion(ExecState *, ErrorType, const char *msg) KJS_FAST_CALL; 107 Completion createErrorCompletion(ExecState *, ErrorType, const char *msg, const Identifier &) KJS_FAST_CALL; 108 109 JSValue *throwError(ExecState *, ErrorType, const char *msg) KJS_FAST_CALL; 110 JSValue* throwError(ExecState *, ErrorType, const char* msg, const char*) KJS_FAST_CALL; 111 JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, Node *) KJS_FAST_CALL; 112 JSValue *throwError(ExecState *, ErrorType, const char *msg, const Identifier &) KJS_FAST_CALL; 113 JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, const Identifier &) KJS_FAST_CALL; 114 JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, Node *, Node *) KJS_FAST_CALL; 115 JSValue *throwError(ExecState *, ErrorType, const char *msg, JSValue *, Node *, const Identifier &) KJS_FAST_CALL; 116 117 JSValue *throwUndefinedVariableError(ExecState *, const Identifier &) KJS_FAST_CALL; 118 119 void handleException(ExecState*) KJS_FAST_CALL; 120 void handleException(ExecState*, JSValue*) KJS_FAST_CALL; 115 121 116 122 int m_line; 117 123 private: 118 124 // disallow assignment 119 Node& operator=(const Node&) ;120 Node(const Node &other) ;125 Node& operator=(const Node&) KJS_FAST_CALL; 126 Node(const Node &other) KJS_FAST_CALL; 121 127 }; 122 128 123 129 class StatementNode : public Node { 124 130 public: 125 StatementNode() ;126 void setLoc(int line0, int line1) ;127 int firstLine() const { return lineNo(); }128 int lastLine() const { return m_lastLine; }129 bool hitStatement(ExecState*) ;130 virtual Completion execute(ExecState *exec) = 0;131 void pushLabel(const Identifier &id) { ls.push(id); }132 virtual void processFuncDecl(ExecState*) ;131 StatementNode() KJS_FAST_CALL; 132 void setLoc(int line0, int line1) KJS_FAST_CALL; 133 int firstLine() const KJS_FAST_CALL { return lineNo(); } 134 int lastLine() const KJS_FAST_CALL { return m_lastLine; } 135 bool hitStatement(ExecState*) KJS_FAST_CALL; 136 virtual Completion execute(ExecState *exec) KJS_FAST_CALL = 0; 137 void pushLabel(const Identifier &id) KJS_FAST_CALL { ls.push(id); } 138 virtual void processFuncDecl(ExecState*) KJS_FAST_CALL; 133 139 protected: 134 140 LabelStack ls; 135 141 private: 136 JSValue *evaluate(ExecState*) { return jsUndefined(); }142 JSValue *evaluate(ExecState*) KJS_FAST_CALL { return jsUndefined(); } 137 143 int m_lastLine; 138 144 }; … … 140 146 class NullNode : public Node { 141 147 public: 142 NullNode() {}143 JSValue* evaluate(ExecState*) ;144 virtual void streamTo(SourceStream&) const ;148 NullNode() KJS_FAST_CALL {} 149 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 150 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 145 151 }; 146 152 147 153 class BooleanNode : public Node { 148 154 public: 149 BooleanNode(bool v) : value(v) {}150 JSValue* evaluate(ExecState*) ;151 virtual void streamTo(SourceStream&) const ;155 BooleanNode(bool v) KJS_FAST_CALL : value(v) {} 156 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 157 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 152 158 private: 153 159 bool value; … … 156 162 class NumberNode : public Node { 157 163 public: 158 NumberNode(double v) : value(v) {}159 JSValue* evaluate(ExecState*) ;160 virtual void streamTo(SourceStream&) const ;164 NumberNode(double v) KJS_FAST_CALL : value(v) {} 165 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 166 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 161 167 private: 162 168 double value; … … 165 171 class StringNode : public Node { 166 172 public: 167 StringNode(const UString *v) { value = *v; }168 JSValue* evaluate(ExecState*) ;169 virtual void streamTo(SourceStream&) const ;173 StringNode(const UString *v) KJS_FAST_CALL { value = *v; } 174 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 175 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 170 176 private: 171 177 UString value; … … 174 180 class RegExpNode : public Node { 175 181 public: 176 RegExpNode(const UString &p, const UString &f) 182 RegExpNode(const UString &p, const UString &f) KJS_FAST_CALL 177 183 : pattern(p), flags(f) { } 178 JSValue* evaluate(ExecState*) ;179 virtual void streamTo(SourceStream&) const ;184 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 185 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 180 186 private: 181 187 UString pattern, flags; … … 184 190 class ThisNode : public Node { 185 191 public: 186 ThisNode() {}187 JSValue* evaluate(ExecState*) ;188 virtual void streamTo(SourceStream&) const ;192 ThisNode() KJS_FAST_CALL {} 193 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 194 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 189 195 }; 190 196 191 197 class ResolveNode : public Node { 192 198 public: 193 ResolveNode(const Identifier &s) : ident(s) { }194 JSValue* evaluate(ExecState*) ;195 virtual void streamTo(SourceStream&) const ;196 197 virtual bool isLocation() const { return true; }198 virtual bool isResolveNode() const { return true; }199 const Identifier& identifier() const { return ident; }199 ResolveNode(const Identifier &s) KJS_FAST_CALL : ident(s) { } 200 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 201 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 202 203 virtual bool isLocation() const KJS_FAST_CALL { return true; } 204 virtual bool isResolveNode() const KJS_FAST_CALL { return true; } 205 const Identifier& identifier() const KJS_FAST_CALL { return ident; } 200 206 201 207 private: … … 205 211 class GroupNode : public Node { 206 212 public: 207 GroupNode(Node *g) : group(g) { }208 virtual JSValue* evaluate(ExecState*) ;209 virtual Node *nodeInsideAllParens() ;210 virtual void streamTo(SourceStream&) const ;211 virtual bool isGroupNode() const { return true; }213 GroupNode(Node *g) KJS_FAST_CALL : group(g) { } 214 virtual JSValue* evaluate(ExecState*) KJS_FAST_CALL; 215 virtual Node *nodeInsideAllParens() KJS_FAST_CALL; 216 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 217 virtual bool isGroupNode() const KJS_FAST_CALL { return true; } 212 218 private: 213 219 RefPtr<Node> group; … … 217 223 public: 218 224 // list pointer is tail of a circular list, cracked in the ArrayNode ctor 219 ElementNode(int e, Node *n) : next(this), elision(e), node(n) { Parser::noteNodeCycle(this); }220 ElementNode(ElementNode *l, int e, Node *n) 225 ElementNode(int e, Node *n) KJS_FAST_CALL : next(this), elision(e), node(n) { Parser::noteNodeCycle(this); } 226 ElementNode(ElementNode *l, int e, Node *n) KJS_FAST_CALL 221 227 : next(l->next), elision(e), node(n) { l->next = this; } 222 JSValue* evaluate(ExecState*) ;223 virtual void streamTo(SourceStream&) const ;224 PassRefPtr<ElementNode> releaseNext() { return next.release(); }225 virtual void breakCycle() ;228 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 229 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 230 PassRefPtr<ElementNode> releaseNext() KJS_FAST_CALL { return next.release(); } 231 virtual void breakCycle() KJS_FAST_CALL; 226 232 private: 227 233 friend class ArrayNode; … … 233 239 class ArrayNode : public Node { 234 240 public: 235 ArrayNode(int e) : elision(e), opt(true) { }236 ArrayNode(ElementNode *ele) 241 ArrayNode(int e) KJS_FAST_CALL : elision(e), opt(true) { } 242 ArrayNode(ElementNode *ele) KJS_FAST_CALL 237 243 : element(ele->next.release()), elision(0), opt(false) { Parser::removeNodeCycle(element.get()); } 238 ArrayNode(int eli, ElementNode *ele) 244 ArrayNode(int eli, ElementNode *ele) KJS_FAST_CALL 239 245 : element(ele->next.release()), elision(eli), opt(true) { Parser::removeNodeCycle(element.get()); } 240 JSValue* evaluate(ExecState*) ;241 virtual void streamTo(SourceStream&) const ;246 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 247 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 242 248 private: 243 249 RefPtr<ElementNode> element; … … 248 254 class PropertyNameNode : public Node { 249 255 public: 250 PropertyNameNode(double d) : numeric(d) { }251 PropertyNameNode(const Identifier &s) : str(s) { }252 JSValue* evaluate(ExecState*) ;253 virtual void streamTo(SourceStream&) const ;256 PropertyNameNode(double d) KJS_FAST_CALL : numeric(d) { } 257 PropertyNameNode(const Identifier &s) KJS_FAST_CALL : str(s) { } 258 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 259 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 254 260 private: 255 261 double numeric; … … 260 266 public: 261 267 enum Type { Constant, Getter, Setter }; 262 PropertyNode(PropertyNameNode *n, Node *a, Type t) 268 PropertyNode(PropertyNameNode *n, Node *a, Type t) KJS_FAST_CALL 263 269 : name(n), assign(a), type(t) { } 264 JSValue* evaluate(ExecState*) ;265 virtual void streamTo(SourceStream&) const ;270 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 271 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 266 272 friend class PropertyListNode; 267 273 private: … … 274 280 public: 275 281 // list pointer is tail of a circular list, cracked in the ObjectLiteralNode ctor 276 PropertyListNode(PropertyNode *n) 282 PropertyListNode(PropertyNode *n) KJS_FAST_CALL 277 283 : node(n), next(this) { Parser::noteNodeCycle(this); } 278 PropertyListNode(PropertyNode *n, PropertyListNode *l) 284 PropertyListNode(PropertyNode *n, PropertyListNode *l) KJS_FAST_CALL 279 285 : node(n), next(l->next) { l->next = this; } 280 JSValue* evaluate(ExecState*) ;281 virtual void streamTo(SourceStream&) const ;282 PassRefPtr<PropertyListNode> releaseNext() { return next.release(); }283 virtual void breakCycle() ;286 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 287 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 288 PassRefPtr<PropertyListNode> releaseNext() KJS_FAST_CALL { return next.release(); } 289 virtual void breakCycle() KJS_FAST_CALL; 284 290 private: 285 291 friend class ObjectLiteralNode; … … 290 296 class ObjectLiteralNode : public Node { 291 297 public: 292 ObjectLiteralNode() { }293 ObjectLiteralNode(PropertyListNode *l) : list(l->next.release()) { Parser::removeNodeCycle(list.get()); }294 JSValue* evaluate(ExecState*) ;295 virtual void streamTo(SourceStream&) const ;298 ObjectLiteralNode() KJS_FAST_CALL { } 299 ObjectLiteralNode(PropertyListNode *l) KJS_FAST_CALL : list(l->next.release()) { Parser::removeNodeCycle(list.get()); } 300 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 301 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 296 302 private: 297 303 RefPtr<PropertyListNode> list; … … 300 306 class BracketAccessorNode : public Node { 301 307 public: 302 BracketAccessorNode(Node *e1, Node *e2) : expr1(e1), expr2(e2) {}303 JSValue* evaluate(ExecState*) ;304 virtual void streamTo(SourceStream&) const ;305 306 virtual bool isLocation() const { return true; }307 virtual bool isBracketAccessorNode() const { return true; }308 Node *base() { return expr1.get(); }309 Node *subscript() { return expr2.get(); }308 BracketAccessorNode(Node *e1, Node *e2) KJS_FAST_CALL : expr1(e1), expr2(e2) {} 309 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 310 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 311 312 virtual bool isLocation() const KJS_FAST_CALL { return true; } 313 virtual bool isBracketAccessorNode() const KJS_FAST_CALL { return true; } 314 Node *base() KJS_FAST_CALL { return expr1.get(); } 315 Node *subscript() KJS_FAST_CALL { return expr2.get(); } 310 316 311 317 private: … … 316 322 class DotAccessorNode : public Node { 317 323 public: 318 DotAccessorNode(Node *e, const Identifier &s) : expr(e), ident(s) { }319 JSValue* evaluate(ExecState*) ;320 virtual void streamTo(SourceStream&) const ;321 322 virtual bool isLocation() const { return true; }323 virtual bool isDotAccessorNode() const { return true; }324 Node *base() const { return expr.get(); }325 const Identifier& identifier() const { return ident; }324 DotAccessorNode(Node *e, const Identifier &s) KJS_FAST_CALL : expr(e), ident(s) { } 325 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 326 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 327 328 virtual bool isLocation() const KJS_FAST_CALL { return true; } 329 virtual bool isDotAccessorNode() const KJS_FAST_CALL { return true; } 330 Node *base() const KJS_FAST_CALL { return expr.get(); } 331 const Identifier& identifier() const KJS_FAST_CALL { return ident; } 326 332 327 333 private: … … 333 339 public: 334 340 // list pointer is tail of a circular list, cracked in the ArgumentsNode ctor 335 ArgumentListNode(Node *e) : next(this), expr(e) { Parser::noteNodeCycle(this); }336 ArgumentListNode(ArgumentListNode *l, Node *e) 341 ArgumentListNode(Node *e) KJS_FAST_CALL : next(this), expr(e) { Parser::noteNodeCycle(this); } 342 ArgumentListNode(ArgumentListNode *l, Node *e) KJS_FAST_CALL 337 343 : next(l->next), expr(e) { l->next = this; } 338 JSValue* evaluate(ExecState*) ;339 List evaluateList(ExecState*) ;340 virtual void streamTo(SourceStream&) const ;341 PassRefPtr<ArgumentListNode> releaseNext() { return next.release(); }342 virtual void breakCycle() ;344 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 345 List evaluateList(ExecState*) KJS_FAST_CALL; 346 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 347 PassRefPtr<ArgumentListNode> releaseNext() KJS_FAST_CALL { return next.release(); } 348 virtual void breakCycle() KJS_FAST_CALL; 343 349 private: 344 350 friend class ArgumentsNode; … … 349 355 class ArgumentsNode : public Node { 350 356 public: 351 ArgumentsNode() { }352 ArgumentsNode(ArgumentListNode *l) 357 ArgumentsNode() KJS_FAST_CALL { } 358 ArgumentsNode(ArgumentListNode *l) KJS_FAST_CALL 353 359 : list(l->next.release()) { Parser::removeNodeCycle(list.get()); } 354 JSValue* evaluate(ExecState*) ;355 List evaluateList(ExecState *exec) { return list ? list->evaluateList(exec) : List(); }356 virtual void streamTo(SourceStream&) const ;360 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 361 List evaluateList(ExecState *exec) KJS_FAST_CALL { return list ? list->evaluateList(exec) : List(); } 362 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 357 363 private: 358 364 RefPtr<ArgumentListNode> list; … … 361 367 class NewExprNode : public Node { 362 368 public: 363 NewExprNode(Node *e) : expr(e) {}364 NewExprNode(Node *e, ArgumentsNode *a) : expr(e), args(a) {}365 JSValue* evaluate(ExecState*) ;366 virtual void streamTo(SourceStream&) const ;369 NewExprNode(Node *e) KJS_FAST_CALL : expr(e) {} 370 NewExprNode(Node *e, ArgumentsNode *a) KJS_FAST_CALL : expr(e), args(a) {} 371 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 372 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 367 373 private: 368 374 RefPtr<Node> expr; … … 372 378 class FunctionCallValueNode : public Node { 373 379 public: 374 FunctionCallValueNode(Node *e, ArgumentsNode *a) : expr(e), args(a) {}375 JSValue* evaluate(ExecState*) ;376 virtual void streamTo(SourceStream&) const ;380 FunctionCallValueNode(Node *e, ArgumentsNode *a) KJS_FAST_CALL : expr(e), args(a) {} 381 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 382 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 377 383 private: 378 384 RefPtr<Node> expr; … … 382 388 class FunctionCallResolveNode : public Node { 383 389 public: 384 FunctionCallResolveNode(const Identifier& i, ArgumentsNode *a) : ident(i), args(a) {}385 JSValue* evaluate(ExecState*) ;386 virtual void streamTo(SourceStream&) const ;390 FunctionCallResolveNode(const Identifier& i, ArgumentsNode *a) KJS_FAST_CALL : ident(i), args(a) {} 391 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 392 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 387 393 private: 388 394 Identifier ident; … … 392 398 class FunctionCallBracketNode : public Node { 393 399 public: 394 FunctionCallBracketNode(Node *b, Node *s, ArgumentsNode *a) : base(b), subscript(s), args(a) {}395 JSValue* evaluate(ExecState*) ;396 virtual void streamTo(SourceStream&) const ;400 FunctionCallBracketNode(Node *b, Node *s, ArgumentsNode *a) KJS_FAST_CALL : base(b), subscript(s), args(a) {} 401 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 402 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 397 403 protected: 398 404 RefPtr<Node> base; … … 403 409 class FunctionCallParenBracketNode : public FunctionCallBracketNode { 404 410 public: 405 FunctionCallParenBracketNode(Node *b, Node *s, ArgumentsNode *a) : FunctionCallBracketNode(b, s, a) {}406 virtual void streamTo(SourceStream&) const ;411 FunctionCallParenBracketNode(Node *b, Node *s, ArgumentsNode *a) KJS_FAST_CALL : FunctionCallBracketNode(b, s, a) {} 412 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 407 413 }; 408 414 409 415 class FunctionCallDotNode : public Node { 410 416 public: 411 FunctionCallDotNode(Node *b, const Identifier &i, ArgumentsNode *a) : base(b), ident(i), args(a) {}412 JSValue* evaluate(ExecState*) ;413 virtual void streamTo(SourceStream&) const ;417 FunctionCallDotNode(Node *b, const Identifier &i, ArgumentsNode *a) KJS_FAST_CALL : base(b), ident(i), args(a) {} 418 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 419 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 414 420 protected: 415 421 RefPtr<Node> base; … … 420 426 class FunctionCallParenDotNode : public FunctionCallDotNode { 421 427 public: 422 FunctionCallParenDotNode(Node *b, const Identifier &i, ArgumentsNode *a) : FunctionCallDotNode(b, i, a) {}423 virtual void streamTo(SourceStream&) const ;428 FunctionCallParenDotNode(Node *b, const Identifier &i, ArgumentsNode *a) KJS_FAST_CALL : FunctionCallDotNode(b, i, a) {} 429 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 424 430 }; 425 431 426 432 class PostfixResolveNode : public Node { 427 433 public: 428 PostfixResolveNode(const Identifier& i, Operator o) : m_ident(i), m_oper(o) {}429 JSValue* evaluate(ExecState*) ;430 virtual void streamTo(SourceStream&) const ;434 PostfixResolveNode(const Identifier& i, Operator o) KJS_FAST_CALL : m_ident(i), m_oper(o) {} 435 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 436 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 431 437 private: 432 438 Identifier m_ident; … … 436 442 class PostfixBracketNode : public Node { 437 443 public: 438 PostfixBracketNode(Node *b, Node *s, Operator o) : m_base(b), m_subscript(s), m_oper(o) {}439 JSValue* evaluate(ExecState*) ;440 virtual void streamTo(SourceStream&) const ;444 PostfixBracketNode(Node *b, Node *s, Operator o) KJS_FAST_CALL : m_base(b), m_subscript(s), m_oper(o) {} 445 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 446 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 441 447 private: 442 448 RefPtr<Node> m_base; … … 447 453 class PostfixDotNode : public Node { 448 454 public: 449 PostfixDotNode(Node *b, const Identifier& i, Operator o) : m_base(b), m_ident(i), m_oper(o) {}450 JSValue* evaluate(ExecState*) ;451 virtual void streamTo(SourceStream&) const ;455 PostfixDotNode(Node *b, const Identifier& i, Operator o) KJS_FAST_CALL : m_base(b), m_ident(i), m_oper(o) {} 456 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 457 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 452 458 private: 453 459 RefPtr<Node> m_base; … … 458 464 class PostfixErrorNode : public Node { 459 465 public: 460 PostfixErrorNode(Node* e, Operator o) : m_expr(e), m_oper(o) {}461 JSValue* evaluate(ExecState*) ;462 virtual void streamTo(SourceStream&) const ;466 PostfixErrorNode(Node* e, Operator o) KJS_FAST_CALL : m_expr(e), m_oper(o) {} 467 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 468 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 463 469 private: 464 470 RefPtr<Node> m_expr; … … 468 474 class DeleteResolveNode : public Node { 469 475 public: 470 DeleteResolveNode(const Identifier& i) : m_ident(i) {}471 JSValue* evaluate(ExecState*) ;472 virtual void streamTo(SourceStream&) const ;476 DeleteResolveNode(const Identifier& i) KJS_FAST_CALL : m_ident(i) {} 477 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 478 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 473 479 private: 474 480 Identifier m_ident; … … 477 483 class DeleteBracketNode : public Node { 478 484 public: 479 DeleteBracketNode(Node *base, Node *subscript) : m_base(base), m_subscript(subscript) {}480 JSValue* evaluate(ExecState*) ;481 virtual void streamTo(SourceStream&) const ;485 DeleteBracketNode(Node *base, Node *subscript) KJS_FAST_CALL : m_base(base), m_subscript(subscript) {} 486 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 487 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 482 488 private: 483 489 RefPtr<Node> m_base; … … 487 493 class DeleteDotNode : public Node { 488 494 public: 489 DeleteDotNode(Node *base, const Identifier& i) : m_base(base), m_ident(i) {}490 JSValue* evaluate(ExecState*) ;491 virtual void streamTo(SourceStream&) const ;495 DeleteDotNode(Node *base, const Identifier& i) KJS_FAST_CALL : m_base(base), m_ident(i) {} 496 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 497 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 492 498 private: 493 499 RefPtr<Node> m_base; … … 497 503 class DeleteValueNode : public Node { 498 504 public: 499 DeleteValueNode(Node *e) : m_expr(e) {}500 JSValue* evaluate(ExecState*) ;501 virtual void streamTo(SourceStream&) const ;505 DeleteValueNode(Node *e) KJS_FAST_CALL : m_expr(e) {} 506 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 507 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 502 508 private: 503 509 RefPtr<Node> m_expr; … … 506 512 class VoidNode : public Node { 507 513 public: 508 VoidNode(Node *e) : expr(e) {}509 JSValue* evaluate(ExecState*) ;510 virtual void streamTo(SourceStream&) const ;514 VoidNode(Node *e) KJS_FAST_CALL : expr(e) {} 515 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 516 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 511 517 private: 512 518 RefPtr<Node> expr; … … 515 521 class TypeOfResolveNode : public Node { 516 522 public: 517 TypeOfResolveNode(const Identifier& i) : m_ident(i) {}518 JSValue* evaluate(ExecState*) ;519 virtual void streamTo(SourceStream&) const ;523 TypeOfResolveNode(const Identifier& i) KJS_FAST_CALL : m_ident(i) {} 524 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 525 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 520 526 private: 521 527 Identifier m_ident; … … 524 530 class TypeOfValueNode : public Node { 525 531 public: 526 TypeOfValueNode(Node *e) : m_expr(e) {}527 JSValue* evaluate(ExecState*) ;528 virtual void streamTo(SourceStream&) const ;532 TypeOfValueNode(Node *e) KJS_FAST_CALL : m_expr(e) {} 533 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 534 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 529 535 private: 530 536 RefPtr<Node> m_expr; … … 533 539 class PrefixResolveNode : public Node { 534 540 public: 535 PrefixResolveNode(const Identifier& i, Operator o) : m_ident(i), m_oper(o) {}536 JSValue* evaluate(ExecState*) ;537 virtual void streamTo(SourceStream&) const ;541 PrefixResolveNode(const Identifier& i, Operator o) KJS_FAST_CALL : m_ident(i), m_oper(o) {} 542 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 543 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 538 544 private: 539 545 Identifier m_ident; … … 543 549 class PrefixBracketNode : public Node { 544 550 public: 545 PrefixBracketNode(Node *b, Node *s, Operator o) : m_base(b), m_subscript(s), m_oper(o) {}546 JSValue* evaluate(ExecState*) ;547 virtual void streamTo(SourceStream&) const ;551 PrefixBracketNode(Node *b, Node *s, Operator o) KJS_FAST_CALL : m_base(b), m_subscript(s), m_oper(o) {} 552 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 553 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 548 554 private: 549 555 RefPtr<Node> m_base; … … 554 560 class PrefixDotNode : public Node { 555 561 public: 556 PrefixDotNode(Node *b, const Identifier& i, Operator o) : m_base(b), m_ident(i), m_oper(o) {}557 JSValue* evaluate(ExecState*) ;558 virtual void streamTo(SourceStream&) const ;562 PrefixDotNode(Node *b, const Identifier& i, Operator o) KJS_FAST_CALL : m_base(b), m_ident(i), m_oper(o) {} 563 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 564 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 559 565 private: 560 566 RefPtr<Node> m_base; … … 565 571 class PrefixErrorNode : public Node { 566 572 public: 567 PrefixErrorNode(Node* e, Operator o) : m_expr(e), m_oper(o) {}568 JSValue* evaluate(ExecState*) ;569 virtual void streamTo(SourceStream&) const ;573 PrefixErrorNode(Node* e, Operator o) KJS_FAST_CALL : m_expr(e), m_oper(o) {} 574 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 575 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 570 576 private: 571 577 RefPtr<Node> m_expr; … … 575 581 class UnaryPlusNode : public Node { 576 582 public: 577 UnaryPlusNode(Node *e) : expr(e) {}578 JSValue* evaluate(ExecState*) ;579 virtual void streamTo(SourceStream&) const ;583 UnaryPlusNode(Node *e) KJS_FAST_CALL : expr(e) {} 584 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 585 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 580 586 private: 581 587 RefPtr<Node> expr; … … 584 590 class NegateNode : public Node { 585 591 public: 586 NegateNode(Node *e) : expr(e) {}587 JSValue* evaluate(ExecState*) ;588 virtual void streamTo(SourceStream&) const ;592 NegateNode(Node *e) KJS_FAST_CALL : expr(e) {} 593 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 594 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 589 595 private: 590 596 RefPtr<Node> expr; … … 593 599 class BitwiseNotNode : public Node { 594 600 public: 595 BitwiseNotNode(Node *e) : expr(e) {}596 JSValue* evaluate(ExecState*) ;597 virtual void streamTo(SourceStream&) const ;601 BitwiseNotNode(Node *e) KJS_FAST_CALL : expr(e) {} 602 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 603 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 598 604 private: 599 605 RefPtr<Node> expr; … … 602 608 class LogicalNotNode : public Node { 603 609 public: 604 LogicalNotNode(Node *e) : expr(e) {}605 JSValue* evaluate(ExecState*) ;606 virtual void streamTo(SourceStream&) const ;610 LogicalNotNode(Node *e) KJS_FAST_CALL : expr(e) {} 611 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 612 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 607 613 private: 608 614 RefPtr<Node> expr; … … 611 617 class MultNode : public Node { 612 618 public: 613 MultNode(Node *t1, Node *t2, char op) : term1(t1), term2(t2), oper(op) {}614 JSValue* evaluate(ExecState*) ;615 virtual void streamTo(SourceStream&) const ;619 MultNode(Node *t1, Node *t2, char op) KJS_FAST_CALL : term1(t1), term2(t2), oper(op) {} 620 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 621 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 616 622 private: 617 623 RefPtr<Node> term1; … … 622 628 class AddNode : public Node { 623 629 public: 624 AddNode(Node *t1, Node *t2, char op) : term1(t1), term2(t2), oper(op) {}625 JSValue* evaluate(ExecState*) ;626 virtual void streamTo(SourceStream&) const ;630 AddNode(Node *t1, Node *t2, char op) KJS_FAST_CALL : term1(t1), term2(t2), oper(op) {} 631 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 632 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 627 633 private: 628 634 RefPtr<Node> term1; … … 633 639 class ShiftNode : public Node { 634 640 public: 635 ShiftNode(Node *t1, Operator o, Node *t2) 641 ShiftNode(Node *t1, Operator o, Node *t2) KJS_FAST_CALL 636 642 : term1(t1), term2(t2), oper(o) {} 637 JSValue* evaluate(ExecState*) ;638 virtual void streamTo(SourceStream&) const ;643 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 644 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 639 645 private: 640 646 RefPtr<Node> term1; … … 645 651 class RelationalNode : public Node { 646 652 public: 647 RelationalNode(Node *e1, Operator o, Node *e2) :653 RelationalNode(Node *e1, Operator o, Node *e2) KJS_FAST_CALL : 648 654 expr1(e1), expr2(e2), oper(o) {} 649 JSValue* evaluate(ExecState*) ;650 virtual void streamTo(SourceStream&) const ;655 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 656 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 651 657 private: 652 658 RefPtr<Node> expr1; … … 657 663 class EqualNode : public Node { 658 664 public: 659 EqualNode(Node *e1, Operator o, Node *e2) 665 EqualNode(Node *e1, Operator o, Node *e2) KJS_FAST_CALL 660 666 : expr1(e1), expr2(e2), oper(o) {} 661 JSValue* evaluate(ExecState*) ;662 virtual void streamTo(SourceStream&) const ;667 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 668 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 663 669 private: 664 670 RefPtr<Node> expr1; … … 669 675 class BitOperNode : public Node { 670 676 public: 671 BitOperNode(Node *e1, Operator o, Node *e2) :677 BitOperNode(Node *e1, Operator o, Node *e2) KJS_FAST_CALL : 672 678 expr1(e1), expr2(e2), oper(o) {} 673 JSValue* evaluate(ExecState*) ;674 virtual void streamTo(SourceStream&) const ;679 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 680 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 675 681 private: 676 682 RefPtr<Node> expr1; … … 684 690 class BinaryLogicalNode : public Node { 685 691 public: 686 BinaryLogicalNode(Node *e1, Operator o, Node *e2) :692 BinaryLogicalNode(Node *e1, Operator o, Node *e2) KJS_FAST_CALL : 687 693 expr1(e1), expr2(e2), oper(o) {} 688 JSValue* evaluate(ExecState*) ;689 virtual void streamTo(SourceStream&) const ;694 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 695 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 690 696 private: 691 697 RefPtr<Node> expr1; … … 699 705 class ConditionalNode : public Node { 700 706 public: 701 ConditionalNode(Node *l, Node *e1, Node *e2) :707 ConditionalNode(Node *l, Node *e1, Node *e2) KJS_FAST_CALL : 702 708 logical(l), expr1(e1), expr2(e2) {} 703 JSValue* evaluate(ExecState*) ;704 virtual void streamTo(SourceStream&) const ;709 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 710 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 705 711 private: 706 712 RefPtr<Node> logical; … … 711 717 class AssignResolveNode : public Node { 712 718 public: 713 AssignResolveNode(const Identifier &ident, Operator oper, Node *right) 719 AssignResolveNode(const Identifier &ident, Operator oper, Node *right) KJS_FAST_CALL 714 720 : m_ident(ident), m_oper(oper), m_right(right) {} 715 JSValue* evaluate(ExecState*) ;716 virtual void streamTo(SourceStream&) const ;721 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 722 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 717 723 protected: 718 724 Identifier m_ident; … … 723 729 class AssignBracketNode : public Node { 724 730 public: 725 AssignBracketNode(Node *base, Node *subscript, Operator oper, Node *right) 731 AssignBracketNode(Node *base, Node *subscript, Operator oper, Node *right) KJS_FAST_CALL 726 732 : m_base(base), m_subscript(subscript), m_oper(oper), m_right(right) {} 727 JSValue* evaluate(ExecState*) ;728 virtual void streamTo(SourceStream&) const ;733 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 734 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 729 735 protected: 730 736 RefPtr<Node> m_base; … … 736 742 class AssignDotNode : public Node { 737 743 public: 738 AssignDotNode(Node *base, const Identifier& ident, Operator oper, Node *right) 744 AssignDotNode(Node *base, const Identifier& ident, Operator oper, Node *right) KJS_FAST_CALL 739 745 : m_base(base), m_ident(ident), m_oper(oper), m_right(right) {} 740 JSValue* evaluate(ExecState*) ;741 virtual void streamTo(SourceStream&) const ;746 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 747 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 742 748 protected: 743 749 RefPtr<Node> m_base; … … 749 755 class AssignErrorNode : public Node { 750 756 public: 751 AssignErrorNode(Node* left, Operator oper, Node* right) 757 AssignErrorNode(Node* left, Operator oper, Node* right) KJS_FAST_CALL 752 758 : m_left(left), m_oper(oper), m_right(right) {} 753 JSValue* evaluate(ExecState*) ;754 virtual void streamTo(SourceStream&) const ;759 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 760 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 755 761 protected: 756 762 RefPtr<Node> m_left; … … 761 767 class CommaNode : public Node { 762 768 public: 763 CommaNode(Node *e1, Node *e2) : expr1(e1), expr2(e2) {}764 JSValue* evaluate(ExecState*) ;765 virtual void streamTo(SourceStream&) const ;769 CommaNode(Node *e1, Node *e2) KJS_FAST_CALL : expr1(e1), expr2(e2) {} 770 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 771 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 766 772 private: 767 773 RefPtr<Node> expr1; … … 771 777 class AssignExprNode : public Node { 772 778 public: 773 AssignExprNode(Node *e) : expr(e) {}774 JSValue* evaluate(ExecState*) ;775 virtual void streamTo(SourceStream&) const ;779 AssignExprNode(Node *e) KJS_FAST_CALL : expr(e) {} 780 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 781 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 776 782 private: 777 783 RefPtr<Node> expr; … … 781 787 public: 782 788 enum Type { Variable, Constant }; 783 VarDeclNode(const Identifier &id, AssignExprNode *in, Type t) ;784 JSValue* evaluate(ExecState*) ;785 virtual void processVarDecls(ExecState*) ;786 virtual void streamTo(SourceStream&) const ;789 VarDeclNode(const Identifier &id, AssignExprNode *in, Type t) KJS_FAST_CALL; 790 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 791 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 792 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 787 793 private: 788 794 Type varType; … … 794 800 public: 795 801 // list pointer is tail of a circular list, cracked in the ForNode/VarStatementNode ctor 796 VarDeclListNode(VarDeclNode *v) : next(this), var(v) { Parser::noteNodeCycle(this); }797 VarDeclListNode(VarDeclListNode *l, VarDeclNode *v) 802 VarDeclListNode(VarDeclNode *v) KJS_FAST_CALL : next(this), var(v) { Parser::noteNodeCycle(this); } 803 VarDeclListNode(VarDeclListNode *l, VarDeclNode *v) KJS_FAST_CALL 798 804 : next(l->next), var(v) { l->next = this; } 799 JSValue* evaluate(ExecState*) ;800 virtual void processVarDecls(ExecState*) ;801 virtual void streamTo(SourceStream&) const ;802 PassRefPtr<VarDeclListNode> releaseNext() { return next.release(); }803 virtual void breakCycle() ;805 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 806 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 807 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 808 PassRefPtr<VarDeclListNode> releaseNext() KJS_FAST_CALL { return next.release(); } 809 virtual void breakCycle() KJS_FAST_CALL; 804 810 private: 805 811 friend class ForNode; … … 811 817 class VarStatementNode : public StatementNode { 812 818 public: 813 VarStatementNode(VarDeclListNode *l) : next(l->next.release()) { Parser::removeNodeCycle(next.get()); }814 virtual Completion execute(ExecState*) ;815 virtual void processVarDecls(ExecState*) ;816 virtual void streamTo(SourceStream&) const ;819 VarStatementNode(VarDeclListNode *l) KJS_FAST_CALL : next(l->next.release()) { Parser::removeNodeCycle(next.get()); } 820 virtual Completion execute(ExecState*) KJS_FAST_CALL; 821 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 822 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 817 823 private: 818 824 RefPtr<VarDeclListNode> next; … … 821 827 class BlockNode : public StatementNode { 822 828 public: 823 BlockNode(SourceElementsNode *s) ;824 virtual Completion execute(ExecState*) ;825 virtual void processVarDecls(ExecState*) ;826 virtual void streamTo(SourceStream&) const ;829 BlockNode(SourceElementsNode *s) KJS_FAST_CALL; 830 virtual Completion execute(ExecState*) KJS_FAST_CALL; 831 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 832 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 827 833 protected: 828 834 RefPtr<SourceElementsNode> source; … … 831 837 class EmptyStatementNode : public StatementNode { 832 838 public: 833 EmptyStatementNode() { } // debug834 virtual Completion execute(ExecState*) ;835 virtual void streamTo(SourceStream&) const ;839 EmptyStatementNode() KJS_FAST_CALL { } // debug 840 virtual Completion execute(ExecState*) KJS_FAST_CALL; 841 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 836 842 }; 837 843 838 844 class ExprStatementNode : public StatementNode { 839 845 public: 840 ExprStatementNode(Node *e) : expr(e) { }841 virtual Completion execute(ExecState*) ;842 virtual void streamTo(SourceStream&) const ;846 ExprStatementNode(Node *e) KJS_FAST_CALL : expr(e) { } 847 virtual Completion execute(ExecState*) KJS_FAST_CALL; 848 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 843 849 private: 844 850 RefPtr<Node> expr; … … 847 853 class IfNode : public StatementNode { 848 854 public: 849 IfNode(Node *e, StatementNode *s1, StatementNode *s2) 855 IfNode(Node *e, StatementNode *s1, StatementNode *s2) KJS_FAST_CALL 850 856 : expr(e), statement1(s1), statement2(s2) {} 851 virtual Completion execute(ExecState*) ;852 virtual void processVarDecls(ExecState*) ;853 virtual void streamTo(SourceStream&) const ;857 virtual Completion execute(ExecState*) KJS_FAST_CALL; 858 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 859 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 854 860 private: 855 861 RefPtr<Node> expr; … … 860 866 class DoWhileNode : public StatementNode { 861 867 public: 862 DoWhileNode(StatementNode *s, Node *e) : statement(s), expr(e) {}863 virtual Completion execute(ExecState*) ;864 virtual void processVarDecls(ExecState*) ;865 virtual void streamTo(SourceStream&) const ;868 DoWhileNode(StatementNode *s, Node *e) KJS_FAST_CALL : statement(s), expr(e) {} 869 virtual Completion execute(ExecState*) KJS_FAST_CALL; 870 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 871 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 866 872 private: 867 873 RefPtr<StatementNode> statement; … … 871 877 class WhileNode : public StatementNode { 872 878 public: 873 WhileNode(Node *e, StatementNode *s) : expr(e), statement(s) {}874 virtual Completion execute(ExecState*) ;875 virtual void processVarDecls(ExecState*) ;876 virtual void streamTo(SourceStream&) const ;879 WhileNode(Node *e, StatementNode *s) KJS_FAST_CALL : expr(e), statement(s) {} 880 virtual Completion execute(ExecState*) KJS_FAST_CALL; 881 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 882 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 877 883 private: 878 884 RefPtr<Node> expr; … … 882 888 class ForNode : public StatementNode { 883 889 public: 884 ForNode(Node *e1, Node *e2, Node *e3, StatementNode *s) :890 ForNode(Node *e1, Node *e2, Node *e3, StatementNode *s) KJS_FAST_CALL : 885 891 expr1(e1), expr2(e2), expr3(e3), statement(s) {} 886 ForNode(VarDeclListNode *e1, Node *e2, Node *e3, StatementNode *s) :892 ForNode(VarDeclListNode *e1, Node *e2, Node *e3, StatementNode *s) KJS_FAST_CALL : 887 893 expr1(e1->next.release()), expr2(e2), expr3(e3), statement(s) { Parser::removeNodeCycle(expr1.get()); } 888 virtual Completion execute(ExecState*) ;889 virtual void processVarDecls(ExecState*) ;890 virtual void streamTo(SourceStream&) const ;894 virtual Completion execute(ExecState*) KJS_FAST_CALL; 895 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 896 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 891 897 private: 892 898 RefPtr<Node> expr1; … … 898 904 class ForInNode : public StatementNode { 899 905 public: 900 ForInNode(Node *l, Node *e, StatementNode *s) ;901 ForInNode(const Identifier &i, AssignExprNode *in, Node *e, StatementNode *s) ;902 virtual Completion execute(ExecState*) ;903 virtual void processVarDecls(ExecState*) ;904 virtual void streamTo(SourceStream&) const ;906 ForInNode(Node *l, Node *e, StatementNode *s) KJS_FAST_CALL; 907 ForInNode(const Identifier &i, AssignExprNode *in, Node *e, StatementNode *s) KJS_FAST_CALL; 908 virtual Completion execute(ExecState*) KJS_FAST_CALL; 909 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 910 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 905 911 private: 906 912 Identifier ident; … … 914 920 class ContinueNode : public StatementNode { 915 921 public: 916 ContinueNode() { }917 ContinueNode(const Identifier &i) : ident(i) { }918 virtual Completion execute(ExecState*) ;919 virtual void streamTo(SourceStream&) const ;922 ContinueNode() KJS_FAST_CALL { } 923 ContinueNode(const Identifier &i) KJS_FAST_CALL : ident(i) { } 924 virtual Completion execute(ExecState*) KJS_FAST_CALL; 925 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 920 926 private: 921 927 Identifier ident; … … 924 930 class BreakNode : public StatementNode { 925 931 public: 926 BreakNode() { }927 BreakNode(const Identifier &i) : ident(i) { }928 virtual Completion execute(ExecState*) ;929 virtual void streamTo(SourceStream&) const ;932 BreakNode() KJS_FAST_CALL { } 933 BreakNode(const Identifier &i) KJS_FAST_CALL : ident(i) { } 934 virtual Completion execute(ExecState*) KJS_FAST_CALL; 935 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 930 936 private: 931 937 Identifier ident; … … 934 940 class ReturnNode : public StatementNode { 935 941 public: 936 ReturnNode(Node *v) : value(v) {}937 virtual Completion execute(ExecState*) ;938 virtual void streamTo(SourceStream&) const ;942 ReturnNode(Node *v) KJS_FAST_CALL : value(v) {} 943 virtual Completion execute(ExecState*) KJS_FAST_CALL; 944 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 939 945 private: 940 946 RefPtr<Node> value; … … 943 949 class WithNode : public StatementNode { 944 950 public: 945 WithNode(Node *e, StatementNode *s) : expr(e), statement(s) {}946 virtual Completion execute(ExecState*) ;947 virtual void processVarDecls(ExecState*) ;948 virtual void streamTo(SourceStream&) const ;951 WithNode(Node *e, StatementNode *s) KJS_FAST_CALL : expr(e), statement(s) {} 952 virtual Completion execute(ExecState*) KJS_FAST_CALL; 953 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 954 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 949 955 private: 950 956 RefPtr<Node> expr; … … 954 960 class LabelNode : public StatementNode { 955 961 public: 956 LabelNode(const Identifier &l, StatementNode *s) : label(l), statement(s) { }957 virtual Completion execute(ExecState*) ;958 virtual void processVarDecls(ExecState*) ;959 virtual void streamTo(SourceStream&) const ;962 LabelNode(const Identifier &l, StatementNode *s) KJS_FAST_CALL : label(l), statement(s) { } 963 virtual Completion execute(ExecState*) KJS_FAST_CALL; 964 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 965 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 960 966 private: 961 967 Identifier label; … … 965 971 class ThrowNode : public StatementNode { 966 972 public: 967 ThrowNode(Node *e) : expr(e) {}968 virtual Completion execute(ExecState*) ;969 virtual void streamTo(SourceStream&) const ;973 ThrowNode(Node *e) KJS_FAST_CALL : expr(e) {} 974 virtual Completion execute(ExecState*) KJS_FAST_CALL; 975 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 970 976 private: 971 977 RefPtr<Node> expr; … … 974 980 class TryNode : public StatementNode { 975 981 public: 976 TryNode(StatementNode *b, const Identifier &e, StatementNode *c, StatementNode *f) 982 TryNode(StatementNode *b, const Identifier &e, StatementNode *c, StatementNode *f) KJS_FAST_CALL 977 983 : tryBlock(b), exceptionIdent(e), catchBlock(c), finallyBlock(f) { } 978 virtual Completion execute(ExecState*) ;979 virtual void processVarDecls(ExecState*) ;980 virtual void streamTo(SourceStream&) const ;984 virtual Completion execute(ExecState*) KJS_FAST_CALL; 985 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 986 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 981 987 private: 982 988 RefPtr<StatementNode> tryBlock; … … 989 995 public: 990 996 // list pointer is tail of a circular list, cracked in the FuncDeclNode/FuncExprNode ctor 991 ParameterNode(const Identifier &i) : id(i), next(this) { Parser::noteNodeCycle(this); }992 ParameterNode(ParameterNode *next, const Identifier &i) 997 ParameterNode(const Identifier &i) KJS_FAST_CALL : id(i), next(this) { Parser::noteNodeCycle(this); } 998 ParameterNode(ParameterNode *next, const Identifier &i) KJS_FAST_CALL 993 999 : id(i), next(next->next) { next->next = this; } 994 JSValue* evaluate(ExecState*) ;995 Identifier ident() { return id; }996 ParameterNode *nextParam() { return next.get(); }997 virtual void streamTo(SourceStream&) const ;998 PassRefPtr<ParameterNode> releaseNext() { return next.release(); }999 virtual void breakCycle() ;1000 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 1001 Identifier ident() KJS_FAST_CALL { return id; } 1002 ParameterNode *nextParam() KJS_FAST_CALL { return next.get(); } 1003 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1004 PassRefPtr<ParameterNode> releaseNext() KJS_FAST_CALL { return next.release(); } 1005 virtual void breakCycle() KJS_FAST_CALL; 1000 1006 private: 1001 1007 friend class FuncDeclNode; … … 1007 1013 class Parameter { 1008 1014 public: 1009 Parameter() { }1010 Parameter(const Identifier& n) : name(n) { }1015 Parameter() KJS_FAST_CALL { } 1016 Parameter(const Identifier& n) KJS_FAST_CALL : name(n) { } 1011 1017 Identifier name; 1012 1018 }; … … 1015 1021 class FunctionBodyNode : public BlockNode { 1016 1022 public: 1017 FunctionBodyNode(SourceElementsNode *) ;1018 virtual void processFuncDecl(ExecState*) ;1019 int sourceId() { return m_sourceId; }1020 const UString& sourceURL() { return m_sourceURL; }1021 1022 void addParam(const Identifier& ident) ;1023 size_t numParams() const { return m_parameters.size(); }1024 Identifier paramName(size_t pos) const { return m_parameters[pos].name; }1025 UString paramString() const ;1026 Vector<Parameter>& parameters() { return m_parameters; }1023 FunctionBodyNode(SourceElementsNode *) KJS_FAST_CALL; 1024 virtual void processFuncDecl(ExecState*) KJS_FAST_CALL; 1025 int sourceId() KJS_FAST_CALL { return m_sourceId; } 1026 const UString& sourceURL() KJS_FAST_CALL { return m_sourceURL; } 1027 1028 void addParam(const Identifier& ident) KJS_FAST_CALL; 1029 size_t numParams() const KJS_FAST_CALL { return m_parameters.size(); } 1030 Identifier paramName(size_t pos) const KJS_FAST_CALL { return m_parameters[pos].name; } 1031 UString paramString() const KJS_FAST_CALL; 1032 Vector<Parameter>& parameters() KJS_FAST_CALL { return m_parameters; } 1027 1033 private: 1028 1034 UString m_sourceURL; … … 1033 1039 class FuncExprNode : public Node { 1034 1040 public: 1035 FuncExprNode(const Identifier &i, FunctionBodyNode *b, ParameterNode *p = 0) 1041 FuncExprNode(const Identifier &i, FunctionBodyNode *b, ParameterNode *p = 0) KJS_FAST_CALL 1036 1042 : ident(i), param(p ? p->next.release() : 0), body(b) { if (p) { Parser::removeNodeCycle(param.get()); } addParams(); } 1037 virtual JSValue *evaluate(ExecState*) ;1038 virtual void streamTo(SourceStream&) const ;1039 private: 1040 void addParams() ;1043 virtual JSValue *evaluate(ExecState*) KJS_FAST_CALL; 1044 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1045 private: 1046 void addParams() KJS_FAST_CALL; 1041 1047 // Used for streamTo 1042 1048 friend class PropertyNode; … … 1048 1054 class FuncDeclNode : public StatementNode { 1049 1055 public: 1050 FuncDeclNode(const Identifier &i, FunctionBodyNode *b) 1056 FuncDeclNode(const Identifier &i, FunctionBodyNode *b) KJS_FAST_CALL 1051 1057 : ident(i), body(b) { addParams(); } 1052 FuncDeclNode(const Identifier &i, ParameterNode *p, FunctionBodyNode *b) 1058 FuncDeclNode(const Identifier &i, ParameterNode *p, FunctionBodyNode *b) KJS_FAST_CALL 1053 1059 : ident(i), param(p->next.release()), body(b) { Parser::removeNodeCycle(param.get()); addParams(); } 1054 virtual Completion execute(ExecState*) ;1055 virtual void processFuncDecl(ExecState*) ;1056 virtual void streamTo(SourceStream&) const ;1057 private: 1058 void addParams() ;1060 virtual Completion execute(ExecState*) KJS_FAST_CALL; 1061 virtual void processFuncDecl(ExecState*) KJS_FAST_CALL; 1062 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1063 private: 1064 void addParams() KJS_FAST_CALL; 1059 1065 Identifier ident; 1060 1066 RefPtr<ParameterNode> param; … … 1067 1073 static int count; 1068 1074 // list pointer is tail of a circular list, cracked in the BlockNode (or subclass) ctor 1069 SourceElementsNode(StatementNode*) ;1070 SourceElementsNode(SourceElementsNode *s1, StatementNode *s2) ;1075 SourceElementsNode(StatementNode*) KJS_FAST_CALL; 1076 SourceElementsNode(SourceElementsNode *s1, StatementNode *s2) KJS_FAST_CALL; 1071 1077 1072 Completion execute(ExecState*) ;1073 void processFuncDecl(ExecState*) ;1074 virtual void processVarDecls(ExecState*) ;1075 virtual void streamTo(SourceStream&) const ;1076 PassRefPtr<SourceElementsNode> releaseNext() { return next.release(); }1077 virtual void breakCycle() ;1078 Completion execute(ExecState*) KJS_FAST_CALL; 1079 void processFuncDecl(ExecState*) KJS_FAST_CALL; 1080 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 1081 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1082 PassRefPtr<SourceElementsNode> releaseNext() KJS_FAST_CALL { return next.release(); } 1083 virtual void breakCycle() KJS_FAST_CALL; 1078 1084 private: 1079 1085 friend class BlockNode; … … 1085 1091 class CaseClauseNode : public Node { 1086 1092 public: 1087 CaseClauseNode(Node *e) : expr(e) { }1088 CaseClauseNode(Node *e, SourceElementsNode *s) 1093 CaseClauseNode(Node *e) KJS_FAST_CALL : expr(e) { } 1094 CaseClauseNode(Node *e, SourceElementsNode *s) KJS_FAST_CALL 1089 1095 : expr(e), source(s->next.release()) { Parser::removeNodeCycle(source.get()); } 1090 JSValue* evaluate(ExecState*) ;1091 Completion evalStatements(ExecState*) ;1092 void processFuncDecl(ExecState*) ;1093 virtual void processVarDecls(ExecState*) ;1094 virtual void streamTo(SourceStream&) const ;1096 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 1097 Completion evalStatements(ExecState*) KJS_FAST_CALL; 1098 void processFuncDecl(ExecState*) KJS_FAST_CALL; 1099 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 1100 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1095 1101 private: 1096 1102 RefPtr<Node> expr; … … 1101 1107 public: 1102 1108 // list pointer is tail of a circular list, cracked in the CaseBlockNode ctor 1103 ClauseListNode(CaseClauseNode *c) : clause(c), next(this) { Parser::noteNodeCycle(this); }1104 ClauseListNode(ClauseListNode *n, CaseClauseNode *c) 1109 ClauseListNode(CaseClauseNode *c) KJS_FAST_CALL : clause(c), next(this) { Parser::noteNodeCycle(this); } 1110 ClauseListNode(ClauseListNode *n, CaseClauseNode *c) KJS_FAST_CALL 1105 1111 : clause(c), next(n->next) { n->next = this; } 1106 JSValue* evaluate(ExecState*) ;1107 CaseClauseNode *getClause() const { return clause.get(); }1108 ClauseListNode *getNext() const { return next.get(); }1109 virtual void processVarDecls(ExecState*) ;1110 void processFuncDecl(ExecState*) ;1111 virtual void streamTo(SourceStream&) const ;1112 PassRefPtr<ClauseListNode> releaseNext() { return next.release(); }1113 virtual void breakCycle() ;1112 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 1113 CaseClauseNode *getClause() const KJS_FAST_CALL { return clause.get(); } 1114 ClauseListNode *getNext() const KJS_FAST_CALL { return next.get(); } 1115 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 1116 void processFuncDecl(ExecState*) KJS_FAST_CALL; 1117 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1118 PassRefPtr<ClauseListNode> releaseNext() KJS_FAST_CALL { return next.release(); } 1119 virtual void breakCycle() KJS_FAST_CALL; 1114 1120 private: 1115 1121 friend class CaseBlockNode; … … 1120 1126 class CaseBlockNode : public Node { 1121 1127 public: 1122 CaseBlockNode(ClauseListNode *l1, CaseClauseNode *d, ClauseListNode *l2) ;1123 JSValue* evaluate(ExecState*) ;1124 Completion evalBlock(ExecState *exec, JSValue *input) ;1125 virtual void processVarDecls(ExecState*) ;1126 void processFuncDecl(ExecState*) ;1127 virtual void streamTo(SourceStream&) const ;1128 CaseBlockNode(ClauseListNode *l1, CaseClauseNode *d, ClauseListNode *l2) KJS_FAST_CALL; 1129 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 1130 Completion evalBlock(ExecState *exec, JSValue *input) KJS_FAST_CALL; 1131 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 1132 void processFuncDecl(ExecState*) KJS_FAST_CALL; 1133 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1128 1134 private: 1129 1135 RefPtr<ClauseListNode> list1; … … 1134 1140 class SwitchNode : public StatementNode { 1135 1141 public: 1136 SwitchNode(Node *e, CaseBlockNode *b) : expr(e), block(b) { }1137 virtual Completion execute(ExecState*) ;1138 virtual void processVarDecls(ExecState*) ;1139 virtual void processFuncDecl(ExecState*) ;1140 virtual void streamTo(SourceStream&) const ;1142 SwitchNode(Node *e, CaseBlockNode *b) KJS_FAST_CALL : expr(e), block(b) { } 1143 virtual Completion execute(ExecState*) KJS_FAST_CALL; 1144 virtual void processVarDecls(ExecState*) KJS_FAST_CALL; 1145 virtual void processFuncDecl(ExecState*) KJS_FAST_CALL; 1146 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1141 1147 private: 1142 1148 RefPtr<Node> expr; … … 1146 1152 class ProgramNode : public FunctionBodyNode { 1147 1153 public: 1148 ProgramNode(SourceElementsNode *s) ;1154 ProgramNode(SourceElementsNode *s) KJS_FAST_CALL; 1149 1155 }; 1150 1156
Note:
See TracChangeset
for help on using the changeset viewer.