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/heap/heap.h" | 5 #include "src/heap/heap.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 2676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2687 { \ | 2687 { \ |
2688 Handle<String> name##d = factory->NewStringFromStaticChars(#name); \ | 2688 Handle<String> name##d = factory->NewStringFromStaticChars(#name); \ |
2689 Handle<Symbol> symbol(isolate()->factory()->NewPrivateSymbol()); \ | 2689 Handle<Symbol> symbol(isolate()->factory()->NewPrivateSymbol()); \ |
2690 symbol->set_name(*name##d); \ | 2690 symbol->set_name(*name##d); \ |
2691 roots_[k##name##RootIndex] = *symbol; \ | 2691 roots_[k##name##RootIndex] = *symbol; \ |
2692 } | 2692 } |
2693 PRIVATE_SYMBOL_LIST(SYMBOL_INIT) | 2693 PRIVATE_SYMBOL_LIST(SYMBOL_INIT) |
2694 #undef SYMBOL_INIT | 2694 #undef SYMBOL_INIT |
2695 } | 2695 } |
2696 | 2696 |
2697 // The {hidden_properties_symbol} is special because it is the only name with | |
2698 // hash code zero. This ensures that it will always be the first entry as | |
2699 // sorted by hash code in descriptor arrays. It is used to identify the hidden | |
2700 // properties in JSObjects. | |
2701 // kIsNotArrayIndexMask is a computed hash with value zero. | |
2702 Symbol::cast(roots_[khidden_properties_symbolRootIndex]) | |
2703 ->set_hash_field(Name::kIsNotArrayIndexMask); | |
2704 | |
2705 { | 2697 { |
2706 HandleScope scope(isolate()); | 2698 HandleScope scope(isolate()); |
2707 #define SYMBOL_INIT(name, description) \ | 2699 #define SYMBOL_INIT(name, description) \ |
2708 Handle<Symbol> name = factory->NewSymbol(); \ | 2700 Handle<Symbol> name = factory->NewSymbol(); \ |
2709 Handle<String> name##d = factory->NewStringFromStaticChars(#description); \ | 2701 Handle<String> name##d = factory->NewStringFromStaticChars(#description); \ |
2710 name->set_name(*name##d); \ | 2702 name->set_name(*name##d); \ |
2711 roots_[k##name##RootIndex] = *name; | 2703 roots_[k##name##RootIndex] = *name; |
2712 PUBLIC_SYMBOL_LIST(SYMBOL_INIT) | 2704 PUBLIC_SYMBOL_LIST(SYMBOL_INIT) |
2713 #undef SYMBOL_INIT | 2705 #undef SYMBOL_INIT |
2714 | 2706 |
(...skipping 3640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6355 } | 6347 } |
6356 | 6348 |
6357 | 6349 |
6358 // static | 6350 // static |
6359 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6351 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6360 return StaticVisitorBase::GetVisitorId(map); | 6352 return StaticVisitorBase::GetVisitorId(map); |
6361 } | 6353 } |
6362 | 6354 |
6363 } // namespace internal | 6355 } // namespace internal |
6364 } // namespace v8 | 6356 } // namespace v8 |
OLD | NEW |