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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 | 596 |
597 Handle<Object> key = property->key()->AsLiteral()->value(); | 597 Handle<Object> key = property->key()->AsLiteral()->value(); |
598 | 598 |
599 uint32_t element_index = 0; | 599 uint32_t element_index = 0; |
600 if (key->ToArrayIndex(&element_index)) { | 600 if (key->ToArrayIndex(&element_index)) { |
601 index_keys++; | 601 index_keys++; |
602 } | 602 } |
603 } | 603 } |
604 | 604 |
605 Handle<BoilerplateDescription> constant_properties = | 605 Handle<BoilerplateDescription> constant_properties = |
606 isolate->factory()->NewBoilerplateDescription( | 606 isolate->factory()->NewBoilerplateDescription(boilerplate_properties_, |
607 boilerplate_properties_, properties()->length() - index_keys, | 607 properties()->length(), |
608 has_seen_proto); | 608 index_keys, has_seen_proto); |
609 | 609 |
610 int position = 0; | 610 int position = 0; |
611 for (int i = 0; i < properties()->length(); i++) { | 611 for (int i = 0; i < properties()->length(); i++) { |
612 ObjectLiteral::Property* property = properties()->at(i); | 612 ObjectLiteral::Property* property = properties()->at(i); |
613 if (!IsBoilerplateProperty(property)) { | 613 if (!IsBoilerplateProperty(property)) { |
614 continue; | 614 continue; |
615 } | 615 } |
616 | 616 |
617 if (static_cast<uint32_t>(position) == boilerplate_properties_ * 2) { | 617 if (static_cast<uint32_t>(position) == boilerplate_properties_ * 2) { |
618 DCHECK(property->is_computed_name()); | 618 DCHECK(property->is_computed_name()); |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 // static | 1058 // static |
1059 bool Literal::Match(void* literal1, void* literal2) { | 1059 bool Literal::Match(void* literal1, void* literal2) { |
1060 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1060 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1061 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1061 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1062 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 1062 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
1063 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1063 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1064 } | 1064 } |
1065 | 1065 |
1066 } // namespace internal | 1066 } // namespace internal |
1067 } // namespace v8 | 1067 } // namespace v8 |
OLD | NEW |