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 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1858 DataDescriptor field(factory->lastIndex_string(), | 1858 DataDescriptor field(factory->lastIndex_string(), |
1859 JSRegExp::kLastIndexFieldIndex, writable, | 1859 JSRegExp::kLastIndexFieldIndex, writable, |
1860 Representation::Tagged()); | 1860 Representation::Tagged()); |
1861 initial_map->AppendDescriptor(&field); | 1861 initial_map->AppendDescriptor(&field); |
1862 | 1862 |
1863 static const int num_fields = JSRegExp::kInObjectFieldCount; | 1863 static const int num_fields = JSRegExp::kInObjectFieldCount; |
1864 initial_map->SetInObjectProperties(num_fields); | 1864 initial_map->SetInObjectProperties(num_fields); |
1865 initial_map->set_unused_property_fields(0); | 1865 initial_map->set_unused_property_fields(0); |
1866 initial_map->set_instance_size(initial_map->instance_size() + | 1866 initial_map->set_instance_size(initial_map->instance_size() + |
1867 num_fields * kPointerSize); | 1867 num_fields * kPointerSize); |
| 1868 |
| 1869 { // Internal: RegExpInitialize |
| 1870 Handle<JSFunction> function = isolate->factory()->NewFunction( |
| 1871 isolate->factory()->empty_string(), |
| 1872 isolate->builtins()->RegExpInitialize(), JS_OBJECT_TYPE, |
| 1873 JSObject::kHeaderSize); |
| 1874 function->shared()->DontAdaptArguments(); |
| 1875 function->shared()->set_length(3); |
| 1876 function->shared()->set_native(true); |
| 1877 isolate->native_context()->set(Context::REGEXP_INITIALIZE, *function); |
| 1878 } |
| 1879 |
| 1880 { // Internal: RegExpIsRegExp |
| 1881 Handle<JSFunction> function = isolate->factory()->NewFunction( |
| 1882 isolate->factory()->empty_string(), |
| 1883 isolate->builtins()->RegExpIsRegExp(), JS_OBJECT_TYPE, |
| 1884 JSObject::kHeaderSize); |
| 1885 function->shared()->DontAdaptArguments(); |
| 1886 function->shared()->set_length(1); |
| 1887 function->shared()->set_native(true); |
| 1888 isolate->native_context()->set(Context::REGEXP_IS_REGEXP, *function); |
| 1889 } |
| 1890 |
| 1891 { // Internal: RegExpInternalMatch |
| 1892 Handle<JSFunction> function = |
| 1893 factory->NewFunction(isolate->factory()->empty_string(), |
| 1894 isolate->builtins()->RegExpInternalMatch(), |
| 1895 JS_OBJECT_TYPE, JSObject::kHeaderSize); |
| 1896 function->shared()->set_internal_formal_parameter_count(2); |
| 1897 function->shared()->set_length(2); |
| 1898 function->shared()->set_native(true); |
| 1899 isolate->native_context()->set(Context::REGEXP_INTERNAL_MATCH, *function); |
| 1900 } |
| 1901 |
| 1902 { // Internal: RegExpInternalReplace |
| 1903 Handle<JSFunction> function = isolate->factory()->NewFunction( |
| 1904 isolate->factory()->empty_string(), |
| 1905 isolate->builtins()->RegExpInternalReplace(), JS_OBJECT_TYPE, |
| 1906 JSObject::kHeaderSize); |
| 1907 function->shared()->set_internal_formal_parameter_count(3); |
| 1908 function->shared()->set_length(3); |
| 1909 function->shared()->set_native(true); |
| 1910 isolate->native_context()->set(Context::REGEXP_INTERNAL_REPLACE, |
| 1911 *function); |
| 1912 } |
1868 } | 1913 } |
1869 | 1914 |
1870 { // -- E r r o r | 1915 { // -- E r r o r |
1871 InstallError(isolate, global, factory->Error_string(), | 1916 InstallError(isolate, global, factory->Error_string(), |
1872 Context::ERROR_FUNCTION_INDEX); | 1917 Context::ERROR_FUNCTION_INDEX); |
1873 InstallMakeError(isolate, isolate->builtins()->MakeError(), | 1918 InstallMakeError(isolate, isolate->builtins()->MakeError(), |
1874 Context::MAKE_ERROR_INDEX); | 1919 Context::MAKE_ERROR_INDEX); |
1875 } | 1920 } |
1876 | 1921 |
1877 { // -- E v a l E r r o r | 1922 { // -- E v a l E r r o r |
(...skipping 2527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4405 } | 4450 } |
4406 | 4451 |
4407 | 4452 |
4408 // Called when the top-level V8 mutex is destroyed. | 4453 // Called when the top-level V8 mutex is destroyed. |
4409 void Bootstrapper::FreeThreadResources() { | 4454 void Bootstrapper::FreeThreadResources() { |
4410 DCHECK(!IsActive()); | 4455 DCHECK(!IsActive()); |
4411 } | 4456 } |
4412 | 4457 |
4413 } // namespace internal | 4458 } // namespace internal |
4414 } // namespace v8 | 4459 } // namespace v8 |
OLD | NEW |