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

Unified Diff: src/factory.cc

Issue 2095673002: Share SharedFunctionInfo between all functions created for a FunctionTemplateInfo (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 3c5f4161fd00f8c162a8c0c21903cceeb8e9260f..e197494e6b56176b101af20f5cbb48e0c1da39fd 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1278,16 +1278,9 @@ Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name,
Handle<JSFunction> Factory::NewFunction(Handle<String> name, Handle<Code> code,
Handle<Object> prototype,
- bool read_only_prototype,
bool is_strict) {
- // In strict mode, readonly strict map is only available during bootstrap
- DCHECK(!is_strict || !read_only_prototype ||
- isolate()->bootstrapper()->IsActive());
- Handle<Map> map =
- is_strict ? isolate()->strict_function_map()
- : read_only_prototype
- ? isolate()->sloppy_function_with_readonly_prototype_map()
- : isolate()->sloppy_function_map();
+ Handle<Map> map = is_strict ? isolate()->strict_function_map()
+ : isolate()->sloppy_function_map();
Handle<JSFunction> result = NewFunction(map, name, code);
result->set_prototype_or_initial_map(*prototype);
return result;
@@ -1297,12 +1290,9 @@ Handle<JSFunction> Factory::NewFunction(Handle<String> name, Handle<Code> code,
Handle<JSFunction> Factory::NewFunction(Handle<String> name, Handle<Code> code,
Handle<Object> prototype,
InstanceType type, int instance_size,
- bool read_only_prototype,
- bool install_constructor,
bool is_strict) {
// Allocate the function
- Handle<JSFunction> function =
- NewFunction(name, code, prototype, read_only_prototype, is_strict);
+ Handle<JSFunction> function = NewFunction(name, code, prototype, is_strict);
ElementsKind elements_kind =
type == JS_ARRAY_TYPE ? FAST_SMI_ELEMENTS : FAST_HOLEY_SMI_ELEMENTS;
@@ -1313,9 +1303,6 @@ Handle<JSFunction> Factory::NewFunction(Handle<String> name, Handle<Code> code,
if (!function->shared()->is_resumable()) {
if (prototype->IsTheHole(isolate())) {
prototype = NewFunctionPrototype(function);
- } else if (install_constructor) {
- JSObject::AddProperty(Handle<JSObject>::cast(prototype),
- constructor_string(), function, DONT_ENUM);
}
}
« no previous file with comments | « src/factory.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698