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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 } | 361 } |
362 | 362 |
363 // Add name, value pair to the fixed array. | 363 // Add name, value pair to the fixed array. |
364 constant_properties->set(position++, *key); | 364 constant_properties->set(position++, *key); |
365 constant_properties->set(position++, *value); | 365 constant_properties->set(position++, *value); |
366 } | 366 } |
367 | 367 |
368 constant_properties_ = constant_properties; | 368 constant_properties_ = constant_properties; |
369 fast_elements_ = | 369 fast_elements_ = |
370 (max_element_index <= 32) || ((2 * elements) >= max_element_index); | 370 (max_element_index <= 32) || ((2 * elements) >= max_element_index); |
| 371 has_elements_ = elements > 0; |
371 set_is_simple(is_simple); | 372 set_is_simple(is_simple); |
372 set_depth(depth_acc); | 373 set_depth(depth_acc); |
373 } | 374 } |
374 | 375 |
375 | 376 |
376 void ArrayLiteral::BuildConstantElements(Isolate* isolate) { | 377 void ArrayLiteral::BuildConstantElements(Isolate* isolate) { |
377 if (!constant_elements_.is_null()) return; | 378 if (!constant_elements_.is_null()) return; |
378 | 379 |
379 // Allocate a fixed array to hold all the object literals. | 380 // Allocate a fixed array to hold all the object literals. |
380 Handle<JSArray> array = | 381 Handle<JSArray> array = |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 // static | 1003 // static |
1003 bool Literal::Match(void* literal1, void* literal2) { | 1004 bool Literal::Match(void* literal1, void* literal2) { |
1004 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1005 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1005 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1006 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1006 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || | 1007 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || |
1007 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1008 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1008 } | 1009 } |
1009 | 1010 |
1010 | 1011 |
1011 } } // namespace v8::internal | 1012 } } // namespace v8::internal |
OLD | NEW |