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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 ApiInstanceType type = JavaScriptObjectType); | 561 ApiInstanceType type = JavaScriptObjectType); |
562 | 562 |
563 Handle<JSFunction> InstallMembers(Handle<JSFunction> function); | 563 Handle<JSFunction> InstallMembers(Handle<JSFunction> function); |
564 | 564 |
565 // Installs interceptors on the instance. 'desc' is a function template, | 565 // Installs interceptors on the instance. 'desc' is a function template, |
566 // and instance is an object instance created by the function of this | 566 // and instance is an object instance created by the function of this |
567 // function template. | 567 // function template. |
568 MUST_USE_RESULT MaybeHandle<FunctionTemplateInfo> ConfigureInstance( | 568 MUST_USE_RESULT MaybeHandle<FunctionTemplateInfo> ConfigureInstance( |
569 Handle<FunctionTemplateInfo> desc, Handle<JSObject> instance); | 569 Handle<FunctionTemplateInfo> desc, Handle<JSObject> instance); |
570 | 570 |
571 #define ROOT_ACCESSOR(type, name, camel_name) \ | 571 #define ROOT_ACCESSOR(type, name, camel_name) \ |
572 inline Handle<type> name() { \ | 572 inline Handle<type> name() { \ |
573 return Handle<type>(BitCast<type**>( \ | 573 return Handle<type>(bit_cast<type**>( \ |
574 &isolate()->heap()->roots_[Heap::k##camel_name##RootIndex])); \ | 574 &isolate()->heap()->roots_[Heap::k##camel_name##RootIndex])); \ |
575 } | 575 } |
576 ROOT_LIST(ROOT_ACCESSOR) | 576 ROOT_LIST(ROOT_ACCESSOR) |
577 #undef ROOT_ACCESSOR | 577 #undef ROOT_ACCESSOR |
578 | 578 |
579 #define STRUCT_MAP_ACCESSOR(NAME, Name, name) \ | 579 #define STRUCT_MAP_ACCESSOR(NAME, Name, name) \ |
580 inline Handle<Map> name##_map() { \ | 580 inline Handle<Map> name##_map() { \ |
581 return Handle<Map>(BitCast<Map**>( \ | 581 return Handle<Map>(bit_cast<Map**>( \ |
582 &isolate()->heap()->roots_[Heap::k##Name##MapRootIndex])); \ | 582 &isolate()->heap()->roots_[Heap::k##Name##MapRootIndex])); \ |
583 } | 583 } |
584 STRUCT_LIST(STRUCT_MAP_ACCESSOR) | 584 STRUCT_LIST(STRUCT_MAP_ACCESSOR) |
585 #undef STRUCT_MAP_ACCESSOR | 585 #undef STRUCT_MAP_ACCESSOR |
586 | 586 |
587 #define STRING_ACCESSOR(name, str) \ | 587 #define STRING_ACCESSOR(name, str) \ |
588 inline Handle<String> name() { \ | 588 inline Handle<String> name() { \ |
589 return Handle<String>(BitCast<String**>( \ | 589 return Handle<String>(bit_cast<String**>( \ |
590 &isolate()->heap()->roots_[Heap::k##name##RootIndex])); \ | 590 &isolate()->heap()->roots_[Heap::k##name##RootIndex])); \ |
591 } | 591 } |
592 INTERNALIZED_STRING_LIST(STRING_ACCESSOR) | 592 INTERNALIZED_STRING_LIST(STRING_ACCESSOR) |
593 #undef STRING_ACCESSOR | 593 #undef STRING_ACCESSOR |
594 | 594 |
595 inline void set_string_table(Handle<StringTable> table) { | 595 inline void set_string_table(Handle<StringTable> table) { |
596 isolate()->heap()->set_string_table(*table); | 596 isolate()->heap()->set_string_table(*table); |
597 } | 597 } |
598 | 598 |
599 Handle<String> hidden_string() { | 599 Handle<String> hidden_string() { |
600 return Handle<String>(&isolate()->heap()->hidden_string_); | 600 return Handle<String>(&isolate()->heap()->hidden_string_); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 // Reinitialize a JSProxy into an (empty) JS object of respective type and | 704 // Reinitialize a JSProxy into an (empty) JS object of respective type and |
705 // size, but keeping the original prototype. The receiver must have at least | 705 // size, but keeping the original prototype. The receiver must have at least |
706 // the size of the new object. The object is reinitialized and behaves as an | 706 // the size of the new object. The object is reinitialized and behaves as an |
707 // object that has been freshly allocated. | 707 // object that has been freshly allocated. |
708 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); | 708 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); |
709 }; | 709 }; |
710 | 710 |
711 } } // namespace v8::internal | 711 } } // namespace v8::internal |
712 | 712 |
713 #endif // V8_FACTORY_H_ | 713 #endif // V8_FACTORY_H_ |
OLD | NEW |