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

Unified Diff: src/factory.cc

Issue 952303002: Remove NativeContext from Literal array, since we always create the literals in the native context … (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 5 years, 10 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 | « no previous file | src/liveedit.cc » ('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 bf249067ed0fc3bf93f92c1f6597c52839be4d3a..36154c6b7aef6771464773dafafd74a56e160b7f 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1385,13 +1385,6 @@ Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo(
if (!info->bound() && index < 0) {
int number_of_literals = info->num_literals();
Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure);
- if (number_of_literals > 0) {
- // Store the native context in the literals array prefix. This
- // context will be used when creating object, regexp and array
- // literals in this function.
- literals->set(JSFunction::kLiteralNativeContextIndex,
- context->native_context());
- }
result->set_literals(*literals);
}
@@ -2031,14 +2024,7 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
shared->set_scope_info(*scope_info);
shared->set_feedback_vector(*feedback_vector);
shared->set_kind(kind);
- int literals_array_size = number_of_literals;
- // If the function contains object, regexp or array literals,
- // allocate extra space for a literals array prefix containing the
- // context.
- if (number_of_literals > 0) {
- literals_array_size += JSFunction::kLiteralsPrefixSize;
- }
- shared->set_num_literals(literals_array_size);
+ shared->set_num_literals(number_of_literals);
if (IsGeneratorFunction(kind)) {
shared->set_instance_class_name(isolate()->heap()->Generator_string());
shared->DisableOptimization(kGenerator);
« no previous file with comments | « no previous file | src/liveedit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698