OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/ast.h" | 5 #include "src/ast.h" |
6 | 6 |
7 #include <cmath> // For isfinite. | 7 #include <cmath> // For isfinite. |
8 #include "src/builtins.h" | 8 #include "src/builtins.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/contexts.h" | 10 #include "src/contexts.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 } | 327 } |
328 | 328 |
329 // Add name, value pair to the fixed array. | 329 // Add name, value pair to the fixed array. |
330 constant_properties->set(position++, *key); | 330 constant_properties->set(position++, *key); |
331 constant_properties->set(position++, *value); | 331 constant_properties->set(position++, *value); |
332 } | 332 } |
333 | 333 |
334 constant_properties_ = constant_properties; | 334 constant_properties_ = constant_properties; |
335 fast_elements_ = | 335 fast_elements_ = |
336 (max_element_index <= 32) || ((2 * elements) >= max_element_index); | 336 (max_element_index <= 32) || ((2 * elements) >= max_element_index); |
| 337 has_elements_ = elements > 0; |
337 set_is_simple(is_simple); | 338 set_is_simple(is_simple); |
338 set_depth(depth_acc); | 339 set_depth(depth_acc); |
339 } | 340 } |
340 | 341 |
341 | 342 |
342 void ArrayLiteral::BuildConstantElements(Isolate* isolate) { | 343 void ArrayLiteral::BuildConstantElements(Isolate* isolate) { |
343 if (!constant_elements_.is_null()) return; | 344 if (!constant_elements_.is_null()) return; |
344 | 345 |
345 // Allocate a fixed array to hold all the object literals. | 346 // Allocate a fixed array to hold all the object literals. |
346 Handle<JSArray> array = | 347 Handle<JSArray> array = |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 // static | 1010 // static |
1010 bool Literal::Match(void* literal1, void* literal2) { | 1011 bool Literal::Match(void* literal1, void* literal2) { |
1011 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1012 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1012 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1013 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1013 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || | 1014 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || |
1014 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1015 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1015 } | 1016 } |
1016 | 1017 |
1017 | 1018 |
1018 } } // namespace v8::internal | 1019 } } // namespace v8::internal |
OLD | NEW |