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 #include "bootstrapper.h" | 5 #include "bootstrapper.h" |
6 | 6 |
7 #include "accessors.h" | 7 #include "accessors.h" |
8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
9 #include "natives.h" | 9 #include "natives.h" |
10 #include "snapshot.h" | 10 #include "snapshot.h" |
(...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 isolate()->initial_object_prototype(), | 1675 isolate()->initial_object_prototype(), |
1676 Builtins::kIllegal, false, false); | 1676 Builtins::kIllegal, false, false); |
1677 Handle<JSObject> prototype = | 1677 Handle<JSObject> prototype = |
1678 factory()->NewJSObject(isolate()->object_function(), TENURED); | 1678 factory()->NewJSObject(isolate()->object_function(), TENURED); |
1679 Accessors::FunctionSetPrototype(script_fun, prototype); | 1679 Accessors::FunctionSetPrototype(script_fun, prototype); |
1680 native_context()->set_script_function(*script_fun); | 1680 native_context()->set_script_function(*script_fun); |
1681 | 1681 |
1682 Handle<Map> script_map = Handle<Map>(script_fun->initial_map()); | 1682 Handle<Map> script_map = Handle<Map>(script_fun->initial_map()); |
1683 Map::EnsureDescriptorSlack(script_map, 13); | 1683 Map::EnsureDescriptorSlack(script_map, 13); |
1684 | 1684 |
1685 Handle<Foreign> script_source( | |
1686 factory()->NewForeign(&Accessors::ScriptSource)); | |
1687 Handle<Foreign> script_name(factory()->NewForeign(&Accessors::ScriptName)); | |
1688 Handle<String> id_string(factory()->InternalizeOneByteString( | |
1689 STATIC_ASCII_VECTOR("id"))); | |
1690 Handle<Foreign> script_id(factory()->NewForeign(&Accessors::ScriptId)); | |
1691 Handle<String> line_offset_string( | |
1692 factory()->InternalizeOneByteString( | |
1693 STATIC_ASCII_VECTOR("line_offset"))); | |
1694 Handle<Foreign> script_line_offset( | |
1695 factory()->NewForeign(&Accessors::ScriptLineOffset)); | |
1696 Handle<String> column_offset_string( | |
1697 factory()->InternalizeOneByteString( | |
1698 STATIC_ASCII_VECTOR("column_offset"))); | |
1699 Handle<Foreign> script_column_offset( | |
1700 factory()->NewForeign(&Accessors::ScriptColumnOffset)); | |
1701 Handle<String> type_string(factory()->InternalizeOneByteString( | 1685 Handle<String> type_string(factory()->InternalizeOneByteString( |
1702 STATIC_ASCII_VECTOR("type"))); | 1686 STATIC_ASCII_VECTOR("type"))); |
1703 Handle<Foreign> script_type(factory()->NewForeign(&Accessors::ScriptType)); | 1687 Handle<Foreign> script_type(factory()->NewForeign(&Accessors::ScriptType)); |
1704 Handle<String> compilation_type_string( | 1688 Handle<String> compilation_type_string( |
1705 factory()->InternalizeOneByteString( | 1689 factory()->InternalizeOneByteString( |
1706 STATIC_ASCII_VECTOR("compilation_type"))); | 1690 STATIC_ASCII_VECTOR("compilation_type"))); |
1707 Handle<Foreign> script_compilation_type( | 1691 Handle<Foreign> script_compilation_type( |
1708 factory()->NewForeign(&Accessors::ScriptCompilationType)); | 1692 factory()->NewForeign(&Accessors::ScriptCompilationType)); |
1709 Handle<String> line_ends_string(factory()->InternalizeOneByteString( | 1693 Handle<String> line_ends_string(factory()->InternalizeOneByteString( |
1710 STATIC_ASCII_VECTOR("line_ends"))); | 1694 STATIC_ASCII_VECTOR("line_ends"))); |
(...skipping 15 matching lines...) Expand all Loading... |
1726 Handle<Foreign> script_eval_from_script_position( | 1710 Handle<Foreign> script_eval_from_script_position( |
1727 factory()->NewForeign(&Accessors::ScriptEvalFromScriptPosition)); | 1711 factory()->NewForeign(&Accessors::ScriptEvalFromScriptPosition)); |
1728 Handle<String> eval_from_function_name_string( | 1712 Handle<String> eval_from_function_name_string( |
1729 factory()->InternalizeOneByteString( | 1713 factory()->InternalizeOneByteString( |
1730 STATIC_ASCII_VECTOR("eval_from_function_name"))); | 1714 STATIC_ASCII_VECTOR("eval_from_function_name"))); |
1731 Handle<Foreign> script_eval_from_function_name( | 1715 Handle<Foreign> script_eval_from_function_name( |
1732 factory()->NewForeign(&Accessors::ScriptEvalFromFunctionName)); | 1716 factory()->NewForeign(&Accessors::ScriptEvalFromFunctionName)); |
1733 PropertyAttributes attribs = | 1717 PropertyAttributes attribs = |
1734 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); | 1718 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
1735 | 1719 |
| 1720 Handle<AccessorInfo> script_column = |
| 1721 Accessors::ScriptColumnOffsetInfo(isolate(), attribs); |
1736 { | 1722 { |
1737 CallbacksDescriptor d( | 1723 CallbacksDescriptor d(Handle<Name>(Name::cast(script_column->name())), |
1738 factory()->source_string(), script_source, attribs); | 1724 script_column, attribs); |
1739 script_map->AppendDescriptor(&d); | 1725 script_map->AppendDescriptor(&d); |
1740 } | 1726 } |
1741 | 1727 |
| 1728 Handle<AccessorInfo> script_id = |
| 1729 Accessors::ScriptIdInfo(isolate(), attribs); |
1742 { | 1730 { |
1743 CallbacksDescriptor d(factory()->name_string(), script_name, attribs); | 1731 CallbacksDescriptor d(Handle<Name>(Name::cast(script_id->name())), |
| 1732 script_id, attribs); |
1744 script_map->AppendDescriptor(&d); | 1733 script_map->AppendDescriptor(&d); |
1745 } | 1734 } |
1746 | 1735 |
| 1736 |
| 1737 Handle<AccessorInfo> script_name = |
| 1738 Accessors::ScriptNameInfo(isolate(), attribs); |
1747 { | 1739 { |
1748 CallbacksDescriptor d(id_string, script_id, attribs); | 1740 CallbacksDescriptor d(Handle<Name>(Name::cast(script_name->name())), |
| 1741 script_name, attribs); |
1749 script_map->AppendDescriptor(&d); | 1742 script_map->AppendDescriptor(&d); |
1750 } | 1743 } |
1751 | 1744 |
| 1745 Handle<AccessorInfo> script_line = |
| 1746 Accessors::ScriptLineOffsetInfo(isolate(), attribs); |
1752 { | 1747 { |
1753 CallbacksDescriptor d(line_offset_string, script_line_offset, attribs); | 1748 CallbacksDescriptor d(Handle<Name>(Name::cast(script_line->name())), |
| 1749 script_line, attribs); |
1754 script_map->AppendDescriptor(&d); | 1750 script_map->AppendDescriptor(&d); |
1755 } | 1751 } |
1756 | 1752 |
| 1753 Handle<AccessorInfo> script_source = |
| 1754 Accessors::ScriptSourceInfo(isolate(), attribs); |
1757 { | 1755 { |
1758 CallbacksDescriptor d( | 1756 CallbacksDescriptor d(Handle<Name>(Name::cast(script_source->name())), |
1759 column_offset_string, script_column_offset, attribs); | 1757 script_source, attribs); |
1760 script_map->AppendDescriptor(&d); | 1758 script_map->AppendDescriptor(&d); |
1761 } | 1759 } |
1762 | 1760 |
1763 { | 1761 { |
1764 CallbacksDescriptor d(type_string, script_type, attribs); | 1762 CallbacksDescriptor d(type_string, script_type, attribs); |
1765 script_map->AppendDescriptor(&d); | 1763 script_map->AppendDescriptor(&d); |
1766 } | 1764 } |
1767 | 1765 |
1768 { | 1766 { |
1769 CallbacksDescriptor d( | 1767 CallbacksDescriptor d( |
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2689 return from + sizeof(NestingCounterType); | 2687 return from + sizeof(NestingCounterType); |
2690 } | 2688 } |
2691 | 2689 |
2692 | 2690 |
2693 // Called when the top-level V8 mutex is destroyed. | 2691 // Called when the top-level V8 mutex is destroyed. |
2694 void Bootstrapper::FreeThreadResources() { | 2692 void Bootstrapper::FreeThreadResources() { |
2695 ASSERT(!IsActive()); | 2693 ASSERT(!IsActive()); |
2696 } | 2694 } |
2697 | 2695 |
2698 } } // namespace v8::internal | 2696 } } // namespace v8::internal |
OLD | NEW |