OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_FACTORY_H_ | 5 #ifndef V8_FACTORY_H_ |
6 #define V8_FACTORY_H_ | 6 #define V8_FACTORY_H_ |
7 | 7 |
8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 #undef STRUCT_MAP_ACCESSOR | 581 #undef STRUCT_MAP_ACCESSOR |
582 | 582 |
583 #define STRING_ACCESSOR(name, str) \ | 583 #define STRING_ACCESSOR(name, str) \ |
584 inline Handle<String> name() { \ | 584 inline Handle<String> name() { \ |
585 return Handle<String>(bit_cast<String**>( \ | 585 return Handle<String>(bit_cast<String**>( \ |
586 &isolate()->heap()->roots_[Heap::k##name##RootIndex])); \ | 586 &isolate()->heap()->roots_[Heap::k##name##RootIndex])); \ |
587 } | 587 } |
588 INTERNALIZED_STRING_LIST(STRING_ACCESSOR) | 588 INTERNALIZED_STRING_LIST(STRING_ACCESSOR) |
589 #undef STRING_ACCESSOR | 589 #undef STRING_ACCESSOR |
590 | 590 |
591 #define SYMBOL_ACCESSOR(name) \ | |
592 inline Handle<Symbol> name() { \ | |
593 return Handle<Symbol>(bit_cast<Symbol**>( \ | |
594 &isolate()->heap()->roots_[Heap::k##name##RootIndex])); \ | |
595 } | |
596 PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR) | |
597 #undef SYMBOL_ACCESSOR | |
598 | |
599 inline void set_string_table(Handle<StringTable> table) { | 591 inline void set_string_table(Handle<StringTable> table) { |
600 isolate()->heap()->set_string_table(*table); | 592 isolate()->heap()->set_string_table(*table); |
601 } | 593 } |
602 | 594 |
603 Handle<String> hidden_string() { | 595 Handle<String> hidden_string() { |
604 return Handle<String>(&isolate()->heap()->hidden_string_); | 596 return Handle<String>(&isolate()->heap()->hidden_string_); |
605 } | 597 } |
606 | 598 |
607 // Allocates a new SharedFunctionInfo object. | 599 // Allocates a new SharedFunctionInfo object. |
608 Handle<SharedFunctionInfo> NewSharedFunctionInfo( | 600 Handle<SharedFunctionInfo> NewSharedFunctionInfo( |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 // Reinitialize a JSProxy into an (empty) JS object of respective type and | 700 // Reinitialize a JSProxy into an (empty) JS object of respective type and |
709 // size, but keeping the original prototype. The receiver must have at least | 701 // size, but keeping the original prototype. The receiver must have at least |
710 // the size of the new object. The object is reinitialized and behaves as an | 702 // the size of the new object. The object is reinitialized and behaves as an |
711 // object that has been freshly allocated. | 703 // object that has been freshly allocated. |
712 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); | 704 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); |
713 }; | 705 }; |
714 | 706 |
715 } } // namespace v8::internal | 707 } } // namespace v8::internal |
716 | 708 |
717 #endif // V8_FACTORY_H_ | 709 #endif // V8_FACTORY_H_ |
OLD | NEW |