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

Unified Diff: src/liveedit.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 | « src/factory.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/liveedit.cc
diff --git a/src/liveedit.cc b/src/liveedit.cc
index 8da3d52f555b78e23451bfbfeffacb9454e83f8f..b6cc124ab11d018c4798ba1c4abd371f598360b1 100644
--- a/src/liveedit.cc
+++ b/src/liveedit.cc
@@ -995,9 +995,6 @@ class LiteralFixer {
Handle<SharedFunctionInfo> shared_info,
Isolate* isolate) {
int new_literal_count = compile_info_wrapper->GetLiteralCount();
- if (new_literal_count > 0) {
- new_literal_count += JSFunction::kLiteralsPrefixSize;
- }
int old_literal_count = shared_info->num_literals();
if (old_literal_count == new_literal_count) {
@@ -1013,21 +1010,8 @@ class LiteralFixer {
CollectJSFunctions(shared_info, isolate);
for (int i = 0; i < function_instances->length(); i++) {
Handle<JSFunction> fun(JSFunction::cast(function_instances->get(i)));
- Handle<FixedArray> old_literals(fun->literals());
Handle<FixedArray> new_literals =
isolate->factory()->NewFixedArray(new_literal_count);
- if (new_literal_count > 0) {
- Handle<Context> native_context;
- if (old_literals->length() >
- JSFunction::kLiteralNativeContextIndex) {
- native_context = Handle<Context>(
- JSFunction::NativeContextFromLiterals(fun->literals()));
- } else {
- native_context = Handle<Context>(fun->context()->native_context());
- }
- new_literals->set(JSFunction::kLiteralNativeContextIndex,
- *native_context);
- }
fun->set_literals(*new_literals);
}
@@ -1075,7 +1059,7 @@ class LiteralFixer {
void visit(JSFunction* fun) {
FixedArray* literals = fun->literals();
int len = literals->length();
- for (int j = JSFunction::kLiteralsPrefixSize; j < len; j++) {
+ for (int j = 0; j < len; j++) {
literals->set_undefined(j);
}
}
« no previous file with comments | « src/factory.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698