Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: src/bootstrapper.cc

Issue 2551443002: [regexp] Migrate constructor and compile to CSA (Closed)
Patch Set: Address comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | src/builtins/builtins-regexp.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 // Builtin functions for RegExp.prototype. 1862 // Builtin functions for RegExp.prototype.
1863 Handle<JSObject> prototype = 1863 Handle<JSObject> prototype =
1864 factory->NewJSObject(isolate->object_function(), TENURED); 1864 factory->NewJSObject(isolate->object_function(), TENURED);
1865 Handle<JSFunction> regexp_fun = 1865 Handle<JSFunction> regexp_fun =
1866 InstallFunction(global, "RegExp", JS_REGEXP_TYPE, JSRegExp::kSize, 1866 InstallFunction(global, "RegExp", JS_REGEXP_TYPE, JSRegExp::kSize,
1867 prototype, Builtins::kRegExpConstructor); 1867 prototype, Builtins::kRegExpConstructor);
1868 InstallWithIntrinsicDefaultProto(isolate, regexp_fun, 1868 InstallWithIntrinsicDefaultProto(isolate, regexp_fun,
1869 Context::REGEXP_FUNCTION_INDEX); 1869 Context::REGEXP_FUNCTION_INDEX);
1870 1870
1871 Handle<SharedFunctionInfo> shared(regexp_fun->shared(), isolate); 1871 Handle<SharedFunctionInfo> shared(regexp_fun->shared(), isolate);
1872 shared->SetConstructStub(*isolate->builtins()->RegExpConstructor()); 1872 shared->SetConstructStub(*isolate->builtins()->JSBuiltinsConstructStub());
1873 shared->set_instance_class_name(isolate->heap()->RegExp_string()); 1873 shared->set_instance_class_name(isolate->heap()->RegExp_string());
1874 shared->DontAdaptArguments(); 1874 shared->set_internal_formal_parameter_count(2);
1875 shared->set_length(2); 1875 shared->set_length(2);
1876 1876
1877 { 1877 {
1878 // RegExp.prototype setup. 1878 // RegExp.prototype setup.
1879 1879
1880 // Install the "constructor" property on the {prototype}. 1880 // Install the "constructor" property on the {prototype}.
1881 JSObject::AddProperty(prototype, factory->constructor_string(), 1881 JSObject::AddProperty(prototype, factory->constructor_string(),
1882 regexp_fun, DONT_ENUM); 1882 regexp_fun, DONT_ENUM);
1883 1883
1884 { 1884 {
(...skipping 12 matching lines...) Expand all
1897 SimpleInstallGetter(prototype, factory->multiline_string(), 1897 SimpleInstallGetter(prototype, factory->multiline_string(),
1898 Builtins::kRegExpPrototypeMultilineGetter, true); 1898 Builtins::kRegExpPrototypeMultilineGetter, true);
1899 SimpleInstallGetter(prototype, factory->source_string(), 1899 SimpleInstallGetter(prototype, factory->source_string(),
1900 Builtins::kRegExpPrototypeSourceGetter, true); 1900 Builtins::kRegExpPrototypeSourceGetter, true);
1901 SimpleInstallGetter(prototype, factory->sticky_string(), 1901 SimpleInstallGetter(prototype, factory->sticky_string(),
1902 Builtins::kRegExpPrototypeStickyGetter, true); 1902 Builtins::kRegExpPrototypeStickyGetter, true);
1903 SimpleInstallGetter(prototype, factory->unicode_string(), 1903 SimpleInstallGetter(prototype, factory->unicode_string(),
1904 Builtins::kRegExpPrototypeUnicodeGetter, true); 1904 Builtins::kRegExpPrototypeUnicodeGetter, true);
1905 1905
1906 SimpleInstallFunction(prototype, "compile", 1906 SimpleInstallFunction(prototype, "compile",
1907 Builtins::kRegExpPrototypeCompile, 2, false, 1907 Builtins::kRegExpPrototypeCompile, 2, true,
1908 DONT_ENUM); 1908 DONT_ENUM);
1909 SimpleInstallFunction(prototype, factory->toString_string(), 1909 SimpleInstallFunction(prototype, factory->toString_string(),
1910 Builtins::kRegExpPrototypeToString, 0, false, 1910 Builtins::kRegExpPrototypeToString, 0, false,
1911 DONT_ENUM); 1911 DONT_ENUM);
1912 SimpleInstallFunction(prototype, "test", Builtins::kRegExpPrototypeTest, 1912 SimpleInstallFunction(prototype, "test", Builtins::kRegExpPrototypeTest,
1913 1, true, DONT_ENUM); 1913 1, true, DONT_ENUM);
1914 1914
1915 { 1915 {
1916 Handle<JSFunction> fun = SimpleCreateFunction( 1916 Handle<JSFunction> fun = SimpleCreateFunction(
1917 isolate, factory->InternalizeUtf8String("[Symbol.match]"), 1917 isolate, factory->InternalizeUtf8String("[Symbol.match]"),
(...skipping 2661 matching lines...) Expand 10 before | Expand all | Expand 10 after
4579 } 4579 }
4580 4580
4581 4581
4582 // Called when the top-level V8 mutex is destroyed. 4582 // Called when the top-level V8 mutex is destroyed.
4583 void Bootstrapper::FreeThreadResources() { 4583 void Bootstrapper::FreeThreadResources() {
4584 DCHECK(!IsActive()); 4584 DCHECK(!IsActive());
4585 } 4585 }
4586 4586
4587 } // namespace internal 4587 } // namespace internal
4588 } // namespace v8 4588 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | src/builtins/builtins-regexp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698