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/ast.h" | 5 #include "src/ast/ast.h" |
6 | 6 |
7 #include <cmath> // For isfinite. | 7 #include <cmath> // For isfinite. |
8 | 8 |
9 #include "src/ast/compile-time-value.h" | 9 #include "src/ast/compile-time-value.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 int depth_acc = 1; | 504 int depth_acc = 1; |
505 uint32_t max_element_index = 0; | 505 uint32_t max_element_index = 0; |
506 uint32_t elements = 0; | 506 uint32_t elements = 0; |
507 for (int i = 0; i < properties()->length(); i++) { | 507 for (int i = 0; i < properties()->length(); i++) { |
508 ObjectLiteral::Property* property = properties()->at(i); | 508 ObjectLiteral::Property* property = properties()->at(i); |
509 if (!IsBoilerplateProperty(property)) { | 509 if (!IsBoilerplateProperty(property)) { |
510 is_simple = false; | 510 is_simple = false; |
511 continue; | 511 continue; |
512 } | 512 } |
513 | 513 |
514 if (position == boilerplate_properties_ * 2) { | 514 if (static_cast<uint32_t>(position) == boilerplate_properties_ * 2) { |
515 DCHECK(property->is_computed_name()); | 515 DCHECK(property->is_computed_name()); |
516 is_simple = false; | 516 is_simple = false; |
517 break; | 517 break; |
518 } | 518 } |
519 DCHECK(!property->is_computed_name()); | 519 DCHECK(!property->is_computed_name()); |
520 | 520 |
521 MaterializedLiteral* m_literal = property->value()->AsMaterializedLiteral(); | 521 MaterializedLiteral* m_literal = property->value()->AsMaterializedLiteral(); |
522 if (m_literal != NULL) { | 522 if (m_literal != NULL) { |
523 m_literal->BuildConstants(isolate); | 523 m_literal->BuildConstants(isolate); |
524 if (m_literal->depth() >= depth_acc) depth_acc = m_literal->depth() + 1; | 524 if (m_literal->depth() >= depth_acc) depth_acc = m_literal->depth() + 1; |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 // static | 943 // static |
944 bool Literal::Match(void* literal1, void* literal2) { | 944 bool Literal::Match(void* literal1, void* literal2) { |
945 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 945 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
946 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 946 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
947 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 947 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
948 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 948 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
949 } | 949 } |
950 | 950 |
951 } // namespace internal | 951 } // namespace internal |
952 } // namespace v8 | 952 } // namespace v8 |
OLD | NEW |