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 "src/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/base/ieee754.h" | 9 #include "src/base/ieee754.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1802 | 1802 |
1803 { | 1803 { |
1804 // RegExp.prototype setup. | 1804 // RegExp.prototype setup. |
1805 | 1805 |
1806 // Install the "constructor" property on the {prototype}. | 1806 // Install the "constructor" property on the {prototype}. |
1807 JSObject::AddProperty(prototype, factory->constructor_string(), | 1807 JSObject::AddProperty(prototype, factory->constructor_string(), |
1808 regexp_fun, DONT_ENUM); | 1808 regexp_fun, DONT_ENUM); |
1809 | 1809 |
1810 { | 1810 { |
1811 Handle<JSFunction> fun = SimpleInstallFunction( | 1811 Handle<JSFunction> fun = SimpleInstallFunction( |
1812 prototype, "exec", Builtins::kRegExpPrototypeExec, 1, true, | 1812 prototype, factory->exec_string(), Builtins::kRegExpPrototypeExec, |
1813 DONT_ENUM); | 1813 1, true, DONT_ENUM); |
1814 native_context()->set_regexp_exec_function(*fun); | 1814 native_context()->set_regexp_exec_function(*fun); |
1815 } | 1815 } |
1816 | 1816 |
1817 SimpleInstallGetter(prototype, factory->flags_string(), | 1817 SimpleInstallGetter(prototype, factory->flags_string(), |
1818 Builtins::kRegExpPrototypeFlagsGetter, true); | 1818 Builtins::kRegExpPrototypeFlagsGetter, true); |
1819 SimpleInstallGetter(prototype, factory->global_string(), | 1819 SimpleInstallGetter(prototype, factory->global_string(), |
1820 Builtins::kRegExpPrototypeGlobalGetter, true); | 1820 Builtins::kRegExpPrototypeGlobalGetter, true); |
1821 SimpleInstallGetter(prototype, factory->ignoreCase_string(), | 1821 SimpleInstallGetter(prototype, factory->ignoreCase_string(), |
1822 Builtins::kRegExpPrototypeIgnoreCaseGetter, true); | 1822 Builtins::kRegExpPrototypeIgnoreCaseGetter, true); |
1823 SimpleInstallGetter(prototype, factory->multiline_string(), | 1823 SimpleInstallGetter(prototype, factory->multiline_string(), |
1824 Builtins::kRegExpPrototypeMultilineGetter, true); | 1824 Builtins::kRegExpPrototypeMultilineGetter, true); |
1825 SimpleInstallGetter(prototype, factory->source_string(), | 1825 SimpleInstallGetter(prototype, factory->source_string(), |
1826 Builtins::kRegExpPrototypeSourceGetter, false); | 1826 Builtins::kRegExpPrototypeSourceGetter, false); |
1827 SimpleInstallGetter(prototype, factory->sticky_string(), | 1827 SimpleInstallGetter(prototype, factory->sticky_string(), |
1828 Builtins::kRegExpPrototypeStickyGetter, true); | 1828 Builtins::kRegExpPrototypeStickyGetter, true); |
1829 SimpleInstallGetter(prototype, factory->unicode_string(), | 1829 SimpleInstallGetter(prototype, factory->unicode_string(), |
1830 Builtins::kRegExpPrototypeUnicodeGetter, true); | 1830 Builtins::kRegExpPrototypeUnicodeGetter, true); |
1831 | 1831 |
1832 SimpleInstallFunction(prototype, "compile", | 1832 SimpleInstallFunction(prototype, "compile", |
1833 Builtins::kRegExpPrototypeCompile, 2, false, | 1833 Builtins::kRegExpPrototypeCompile, 2, false, |
1834 DONT_ENUM); | 1834 DONT_ENUM); |
1835 SimpleInstallFunction(prototype, factory->toString_string(), | 1835 SimpleInstallFunction(prototype, factory->toString_string(), |
1836 Builtins::kRegExpPrototypeToString, 0, false, | 1836 Builtins::kRegExpPrototypeToString, 0, false, |
1837 DONT_ENUM); | 1837 DONT_ENUM); |
1838 SimpleInstallFunction(prototype, "test", Builtins::kRegExpPrototypeTest, | 1838 SimpleInstallFunction(prototype, "test", Builtins::kRegExpPrototypeTest, |
1839 1, false, DONT_ENUM); | 1839 1, true, DONT_ENUM); |
1840 | 1840 |
1841 { | 1841 { |
1842 Handle<JSFunction> fun = SimpleCreateFunction( | 1842 Handle<JSFunction> fun = SimpleCreateFunction( |
1843 isolate, factory->InternalizeUtf8String("[Symbol.match]"), | 1843 isolate, factory->InternalizeUtf8String("[Symbol.match]"), |
1844 Builtins::kRegExpPrototypeMatch, 1, false); | 1844 Builtins::kRegExpPrototypeMatch, 1, false); |
1845 InstallFunction(prototype, fun, factory->match_symbol(), DONT_ENUM); | 1845 InstallFunction(prototype, fun, factory->match_symbol(), DONT_ENUM); |
1846 } | 1846 } |
1847 | 1847 |
1848 { | 1848 { |
1849 Handle<JSFunction> fun = SimpleCreateFunction( | 1849 Handle<JSFunction> fun = SimpleCreateFunction( |
(...skipping 2722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4572 } | 4572 } |
4573 | 4573 |
4574 | 4574 |
4575 // Called when the top-level V8 mutex is destroyed. | 4575 // Called when the top-level V8 mutex is destroyed. |
4576 void Bootstrapper::FreeThreadResources() { | 4576 void Bootstrapper::FreeThreadResources() { |
4577 DCHECK(!IsActive()); | 4577 DCHECK(!IsActive()); |
4578 } | 4578 } |
4579 | 4579 |
4580 } // namespace internal | 4580 } // namespace internal |
4581 } // namespace v8 | 4581 } // namespace v8 |
OLD | NEW |