OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 150 matching lines...) Loading... |
161 int FunctionLiteral::end_position() const { | 161 int FunctionLiteral::end_position() const { |
162 return scope()->end_position(); | 162 return scope()->end_position(); |
163 } | 163 } |
164 | 164 |
165 | 165 |
166 LanguageMode FunctionLiteral::language_mode() const { | 166 LanguageMode FunctionLiteral::language_mode() const { |
167 return scope()->language_mode(); | 167 return scope()->language_mode(); |
168 } | 168 } |
169 | 169 |
170 | 170 |
171 bool FunctionLiteral::ShouldSelfOptimize() { | |
172 return !flags()->Contains(kDontSelfOptimize); | |
173 } | |
174 | |
175 | |
176 ObjectLiteral::Property::Property(Literal* key, Expression* value) { | 171 ObjectLiteral::Property::Property(Literal* key, Expression* value) { |
177 emit_store_ = true; | 172 emit_store_ = true; |
178 key_ = key; | 173 key_ = key; |
179 value_ = value; | 174 value_ = value; |
180 Object* k = *key->handle(); | 175 Object* k = *key->handle(); |
181 if (k->IsSymbol() && HEAP->Proto_symbol()->Equals(String::cast(k))) { | 176 if (k->IsSymbol() && HEAP->Proto_symbol()->Equals(String::cast(k))) { |
182 kind_ = PROTOTYPE; | 177 kind_ = PROTOTYPE; |
183 } else if (value_->AsMaterializedLiteral() != NULL) { | 178 } else if (value_->AsMaterializedLiteral() != NULL) { |
184 kind_ = MATERIALIZED_LITERAL; | 179 kind_ = MATERIALIZED_LITERAL; |
185 } else if (value_->AsLiteral() != NULL) { | 180 } else if (value_->AsLiteral() != NULL) { |
(...skipping 957 matching lines...) Loading... |
1143 (node->name()->IsEqualTo(CStrVector("_ArgumentsLength")) || | 1138 (node->name()->IsEqualTo(CStrVector("_ArgumentsLength")) || |
1144 node->name()->IsEqualTo(CStrVector("_Arguments")))) { | 1139 node->name()->IsEqualTo(CStrVector("_Arguments")))) { |
1145 // Don't inline the %_ArgumentsLength or %_Arguments because their | 1140 // Don't inline the %_ArgumentsLength or %_Arguments because their |
1146 // implementation will not work. There is no stack frame to get them | 1141 // implementation will not work. There is no stack frame to get them |
1147 // from. | 1142 // from. |
1148 add_flag(kDontInline); | 1143 add_flag(kDontInline); |
1149 } | 1144 } |
1150 } | 1145 } |
1151 | 1146 |
1152 } } // namespace v8::internal | 1147 } } // namespace v8::internal |
OLD | NEW |