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

Side by Side Diff: src/bootstrapper.cc

Issue 2312743002: Revert of [regexp] Port RegExpConstructor (Closed)
Patch Set: Format Created 4 years, 3 months 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 | « BUILD.gn ('k') | src/builtins/builtins.h » ('j') | no next file with comments »
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 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 to_primitive->shared()->set_internal_formal_parameter_count(1); 1570 to_primitive->shared()->set_internal_formal_parameter_count(1);
1571 1571
1572 // Set the length for the function to satisfy ECMA-262. 1572 // Set the length for the function to satisfy ECMA-262.
1573 to_primitive->shared()->set_length(1); 1573 to_primitive->shared()->set_length(1);
1574 } 1574 }
1575 1575
1576 { // -- R e g E x p 1576 { // -- R e g E x p
1577 // Builtin functions for RegExp.prototype. 1577 // Builtin functions for RegExp.prototype.
1578 Handle<JSFunction> regexp_fun = InstallFunction( 1578 Handle<JSFunction> regexp_fun = InstallFunction(
1579 global, "RegExp", JS_REGEXP_TYPE, JSRegExp::kSize, 1579 global, "RegExp", JS_REGEXP_TYPE, JSRegExp::kSize,
1580 isolate->initial_object_prototype(), Builtins::kRegExpConstructor); 1580 isolate->initial_object_prototype(), Builtins::kIllegal);
1581 InstallWithIntrinsicDefaultProto(isolate, regexp_fun, 1581 InstallWithIntrinsicDefaultProto(isolate, regexp_fun,
1582 Context::REGEXP_FUNCTION_INDEX); 1582 Context::REGEXP_FUNCTION_INDEX);
1583 1583 regexp_fun->shared()->SetConstructStub(
1584 Handle<SharedFunctionInfo> shared(regexp_fun->shared(), isolate); 1584 *isolate->builtins()->JSBuiltinsConstructStub());
1585 shared->SetConstructStub(*isolate->builtins()->RegExpConstructor());
1586 shared->set_instance_class_name(isolate->heap()->RegExp_string());
1587 shared->DontAdaptArguments();
1588 shared->set_length(2);
1589
1590 Handle<JSObject> proto =
1591 factory->NewJSObject(isolate->object_function(), TENURED);
1592 JSObject::AddProperty(proto, factory->constructor_string(), regexp_fun,
1593 DONT_ENUM);
1594 Accessors::FunctionSetPrototype(regexp_fun, proto).Assert();
1595 1585
1596 DCHECK(regexp_fun->has_initial_map()); 1586 DCHECK(regexp_fun->has_initial_map());
1597 Handle<Map> initial_map(regexp_fun->initial_map()); 1587 Handle<Map> initial_map(regexp_fun->initial_map());
1598 1588
1599 DCHECK_EQ(0, initial_map->GetInObjectProperties()); 1589 DCHECK_EQ(0, initial_map->GetInObjectProperties());
1600 1590
1601 Map::EnsureDescriptorSlack(initial_map, 1); 1591 Map::EnsureDescriptorSlack(initial_map, 1);
1602 1592
1603 // ECMA-262, section 15.10.7.5. 1593 // ECMA-262, section 15.10.7.5.
1604 PropertyAttributes writable = 1594 PropertyAttributes writable =
(...skipping 2530 matching lines...) Expand 10 before | Expand all | Expand 10 after
4135 } 4125 }
4136 4126
4137 4127
4138 // Called when the top-level V8 mutex is destroyed. 4128 // Called when the top-level V8 mutex is destroyed.
4139 void Bootstrapper::FreeThreadResources() { 4129 void Bootstrapper::FreeThreadResources() {
4140 DCHECK(!IsActive()); 4130 DCHECK(!IsActive());
4141 } 4131 }
4142 4132
4143 } // namespace internal 4133 } // namespace internal
4144 } // namespace v8 4134 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/builtins/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698