| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "v8.h" | 31 #include "v8.h" |
| 32 | 32 |
| 33 #include "ast.h" | 33 #include "ast.h" |
| 34 #include "scopes.h" | 34 #include "scopes.h" |
| 35 | 35 |
| 36 namespace v8 { | 36 namespace v8 { |
| 37 namespace internal { | 37 namespace internal { |
| 38 | 38 |
| 39 | 39 |
| 40 SwitchStatement::SwitchStatement(ZoneStringList* labels) | 40 SwitchStatement::SwitchStatement(Isolate* isolate, |
| 41 : BreakableStatement(labels, TARGET_FOR_ANONYMOUS), | 41 ZoneStringList* labels) |
| 42 : BreakableStatement(isolate, labels, TARGET_FOR_ANONYMOUS), |
| 42 tag_(NULL), cases_(NULL) { | 43 tag_(NULL), cases_(NULL) { |
| 43 } | 44 } |
| 44 | 45 |
| 45 | 46 |
| 46 Block::Block(ZoneStringList* labels, int capacity, bool is_initializer_block) | 47 Block::Block(Isolate* isolate, |
| 47 : BreakableStatement(labels, TARGET_FOR_NAMED_ONLY), | 48 ZoneStringList* labels, |
| 49 int capacity, |
| 50 bool is_initializer_block) |
| 51 : BreakableStatement(isolate, labels, TARGET_FOR_NAMED_ONLY), |
| 48 statements_(capacity), | 52 statements_(capacity), |
| 49 is_initializer_block_(is_initializer_block) { | 53 is_initializer_block_(is_initializer_block) { |
| 50 } | 54 } |
| 51 | 55 |
| 52 | 56 |
| 53 BreakableStatement::BreakableStatement(ZoneStringList* labels, Type type) | 57 BreakableStatement::BreakableStatement(Isolate* isolate, |
| 58 ZoneStringList* labels, |
| 59 Type type) |
| 54 : labels_(labels), | 60 : labels_(labels), |
| 55 type_(type), | 61 type_(type), |
| 56 entry_id_(GetNextId()), | 62 entry_id_(GetNextId(isolate)), |
| 57 exit_id_(GetNextId()) { | 63 exit_id_(GetNextId(isolate)) { |
| 58 ASSERT(labels == NULL || labels->length() > 0); | 64 ASSERT(labels == NULL || labels->length() > 0); |
| 59 } | 65 } |
| 60 | 66 |
| 61 | 67 |
| 62 IterationStatement::IterationStatement(ZoneStringList* labels) | 68 IterationStatement::IterationStatement(Isolate* isolate, ZoneStringList* labels) |
| 63 : BreakableStatement(labels, TARGET_FOR_ANONYMOUS), | 69 : BreakableStatement(isolate, labels, TARGET_FOR_ANONYMOUS), |
| 64 body_(NULL), | 70 body_(NULL), |
| 65 continue_target_(), | 71 continue_target_(), |
| 66 osr_entry_id_(GetNextId()) { | 72 osr_entry_id_(GetNextId(isolate)) { |
| 67 } | 73 } |
| 68 | 74 |
| 69 | 75 |
| 70 DoWhileStatement::DoWhileStatement(ZoneStringList* labels) | 76 DoWhileStatement::DoWhileStatement(Isolate* isolate, ZoneStringList* labels) |
| 71 : IterationStatement(labels), | 77 : IterationStatement(isolate, labels), |
| 72 cond_(NULL), | 78 cond_(NULL), |
| 73 condition_position_(-1), | 79 condition_position_(-1), |
| 74 continue_id_(GetNextId()), | 80 continue_id_(GetNextId(isolate)), |
| 75 back_edge_id_(GetNextId()) { | 81 back_edge_id_(GetNextId(isolate)) { |
| 76 } | 82 } |
| 77 | 83 |
| 78 | 84 |
| 79 WhileStatement::WhileStatement(ZoneStringList* labels) | 85 WhileStatement::WhileStatement(Isolate* isolate, ZoneStringList* labels) |
| 80 : IterationStatement(labels), | 86 : IterationStatement(isolate, labels), |
| 81 cond_(NULL), | 87 cond_(NULL), |
| 82 may_have_function_literal_(true), | 88 may_have_function_literal_(true), |
| 83 body_id_(GetNextId()) { | 89 body_id_(GetNextId(isolate)) { |
| 84 } | 90 } |
| 85 | 91 |
| 86 | 92 |
| 87 ForStatement::ForStatement(ZoneStringList* labels) | 93 ForStatement::ForStatement(Isolate* isolate, ZoneStringList* labels) |
| 88 : IterationStatement(labels), | 94 : IterationStatement(isolate, labels), |
| 89 init_(NULL), | 95 init_(NULL), |
| 90 cond_(NULL), | 96 cond_(NULL), |
| 91 next_(NULL), | 97 next_(NULL), |
| 92 may_have_function_literal_(true), | 98 may_have_function_literal_(true), |
| 93 loop_variable_(NULL), | 99 loop_variable_(NULL), |
| 94 continue_id_(GetNextId()), | 100 continue_id_(GetNextId(isolate)), |
| 95 body_id_(GetNextId()) { | 101 body_id_(GetNextId(isolate)) { |
| 96 } | 102 } |
| 97 | 103 |
| 98 | 104 |
| 99 ForInStatement::ForInStatement(ZoneStringList* labels) | 105 ForInStatement::ForInStatement(Isolate* isolate, ZoneStringList* labels) |
| 100 : IterationStatement(labels), each_(NULL), enumerable_(NULL), | 106 : IterationStatement(isolate, labels), |
| 101 assignment_id_(GetNextId()) { | 107 each_(NULL), |
| 108 enumerable_(NULL), |
| 109 assignment_id_(GetNextId(isolate)) { |
| 102 } | 110 } |
| 103 | 111 |
| 104 | 112 |
| 105 bool FunctionLiteral::strict_mode() const { | 113 bool FunctionLiteral::strict_mode() const { |
| 106 return scope()->is_strict_mode(); | 114 return scope()->is_strict_mode(); |
| 107 } | 115 } |
| 108 | 116 |
| 109 | 117 |
| 110 } } // namespace v8::internal | 118 } } // namespace v8::internal |
| 111 | 119 |
| 112 #endif // V8_AST_INL_H_ | 120 #endif // V8_AST_INL_H_ |
| OLD | NEW |