OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 30 matching lines...) Expand all Loading... |
41 identifier_proxy_(Isolate::Current(), false), | 41 identifier_proxy_(Isolate::Current(), false), |
42 valid_left_hand_side_sentinel_(Isolate::Current()), | 42 valid_left_hand_side_sentinel_(Isolate::Current()), |
43 this_property_(Isolate::Current(), &this_proxy_, NULL, 0), | 43 this_property_(Isolate::Current(), &this_proxy_, NULL, 0), |
44 call_sentinel_(Isolate::Current(), NULL, NULL, 0) { | 44 call_sentinel_(Isolate::Current(), NULL, NULL, 0) { |
45 } | 45 } |
46 | 46 |
47 | 47 |
48 // ---------------------------------------------------------------------------- | 48 // ---------------------------------------------------------------------------- |
49 // All the Accept member functions for each syntax tree node type. | 49 // All the Accept member functions for each syntax tree node type. |
50 | 50 |
51 void Slot::Accept(AstVisitor* v) { v->VisitSlot(this); } | |
52 | |
53 #define DECL_ACCEPT(type) \ | 51 #define DECL_ACCEPT(type) \ |
54 void type::Accept(AstVisitor* v) { v->Visit##type(this); } | 52 void type::Accept(AstVisitor* v) { v->Visit##type(this); } |
55 AST_NODE_LIST(DECL_ACCEPT) | 53 AST_NODE_LIST(DECL_ACCEPT) |
56 #undef DECL_ACCEPT | 54 #undef DECL_ACCEPT |
57 | 55 |
58 | 56 |
59 // ---------------------------------------------------------------------------- | 57 // ---------------------------------------------------------------------------- |
60 // Implementation of other node functionality. | 58 // Implementation of other node functionality. |
61 | 59 |
62 Assignment* ExpressionStatement::StatementAsSimpleAssignment() { | 60 Assignment* ExpressionStatement::StatementAsSimpleAssignment() { |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 return proxy()->var()->IsStackAllocated() && fun() == NULL; | 405 return proxy()->var()->IsStackAllocated() && fun() == NULL; |
408 } | 406 } |
409 | 407 |
410 | 408 |
411 bool TargetCollector::IsInlineable() const { | 409 bool TargetCollector::IsInlineable() const { |
412 UNREACHABLE(); | 410 UNREACHABLE(); |
413 return false; | 411 return false; |
414 } | 412 } |
415 | 413 |
416 | 414 |
417 bool Slot::IsInlineable() const { | |
418 UNREACHABLE(); | |
419 return false; | |
420 } | |
421 | |
422 | |
423 bool ForInStatement::IsInlineable() const { | 415 bool ForInStatement::IsInlineable() const { |
424 return false; | 416 return false; |
425 } | 417 } |
426 | 418 |
427 | 419 |
428 bool WithStatement::IsInlineable() const { | 420 bool WithStatement::IsInlineable() const { |
429 return false; | 421 return false; |
430 } | 422 } |
431 | 423 |
432 | 424 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 } | 551 } |
560 | 552 |
561 | 553 |
562 bool Conditional::IsInlineable() const { | 554 bool Conditional::IsInlineable() const { |
563 return condition()->IsInlineable() && then_expression()->IsInlineable() && | 555 return condition()->IsInlineable() && then_expression()->IsInlineable() && |
564 else_expression()->IsInlineable(); | 556 else_expression()->IsInlineable(); |
565 } | 557 } |
566 | 558 |
567 | 559 |
568 bool VariableProxy::IsInlineable() const { | 560 bool VariableProxy::IsInlineable() const { |
569 return var()->is_global() || var()->IsStackAllocated(); | 561 return var()->IsUnallocated() || var()->IsStackAllocated(); |
570 } | 562 } |
571 | 563 |
572 | 564 |
573 bool Assignment::IsInlineable() const { | 565 bool Assignment::IsInlineable() const { |
574 return target()->IsInlineable() && value()->IsInlineable(); | 566 return target()->IsInlineable() && value()->IsInlineable(); |
575 } | 567 } |
576 | 568 |
577 | 569 |
578 bool Property::IsInlineable() const { | 570 bool Property::IsInlineable() const { |
579 return obj()->IsInlineable() && key()->IsInlineable(); | 571 return obj()->IsInlineable() && key()->IsInlineable(); |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 int pos) | 1198 int pos) |
1207 : label_(label), | 1199 : label_(label), |
1208 statements_(statements), | 1200 statements_(statements), |
1209 position_(pos), | 1201 position_(pos), |
1210 compare_type_(NONE), | 1202 compare_type_(NONE), |
1211 compare_id_(AstNode::GetNextId(isolate)), | 1203 compare_id_(AstNode::GetNextId(isolate)), |
1212 entry_id_(AstNode::GetNextId(isolate)) { | 1204 entry_id_(AstNode::GetNextId(isolate)) { |
1213 } | 1205 } |
1214 | 1206 |
1215 } } // namespace v8::internal | 1207 } } // namespace v8::internal |
OLD | NEW |