OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "accessors.h" | 7 #include "accessors.h" |
8 #include "allocation-site-scopes.h" | 8 #include "allocation-site-scopes.h" |
9 #include "api.h" | 9 #include "api.h" |
10 #include "arguments.h" | 10 #include "arguments.h" |
(...skipping 16082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16093 for (int i = 0; i < capacity; i++) { | 16093 for (int i = 0; i < capacity; i++) { |
16094 Object* k = KeyAt(i); | 16094 Object* k = KeyAt(i); |
16095 if (IsKey(k) && !k->IsSymbol()) { | 16095 if (IsKey(k) && !k->IsSymbol()) { |
16096 PropertyDetails details = DetailsAt(i); | 16096 PropertyDetails details = DetailsAt(i); |
16097 if (details.IsDeleted() || details.IsDontEnum()) continue; | 16097 if (details.IsDeleted() || details.IsDontEnum()) continue; |
16098 storage->set(properties, Smi::FromInt(i)); | 16098 storage->set(properties, Smi::FromInt(i)); |
16099 properties++; | 16099 properties++; |
16100 if (properties == length) break; | 16100 if (properties == length) break; |
16101 } | 16101 } |
16102 } | 16102 } |
| 16103 CHECK_EQ(length, properties); |
16103 EnumIndexComparator cmp(this); | 16104 EnumIndexComparator cmp(this); |
16104 Smi** start = reinterpret_cast<Smi**>(storage->GetFirstElementAddress()); | 16105 Smi** start = reinterpret_cast<Smi**>(storage->GetFirstElementAddress()); |
16105 std::sort(start, start + length, cmp); | 16106 std::sort(start, start + length, cmp); |
16106 for (int i = 0; i < length; i++) { | 16107 for (int i = 0; i < length; i++) { |
16107 int index = Smi::cast(storage->get(i))->value(); | 16108 int index = Smi::cast(storage->get(i))->value(); |
16108 storage->set(i, KeyAt(index)); | 16109 storage->set(i, KeyAt(index)); |
16109 } | 16110 } |
16110 } | 16111 } |
16111 | 16112 |
16112 | 16113 |
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17295 #define ERROR_MESSAGES_TEXTS(C, T) T, | 17296 #define ERROR_MESSAGES_TEXTS(C, T) T, |
17296 static const char* error_messages_[] = { | 17297 static const char* error_messages_[] = { |
17297 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 17298 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
17298 }; | 17299 }; |
17299 #undef ERROR_MESSAGES_TEXTS | 17300 #undef ERROR_MESSAGES_TEXTS |
17300 return error_messages_[reason]; | 17301 return error_messages_[reason]; |
17301 } | 17302 } |
17302 | 17303 |
17303 | 17304 |
17304 } } // namespace v8::internal | 17305 } } // namespace v8::internal |
OLD | NEW |