Commit f0c21aa4 authored by yangguo's avatar yangguo Committed by Commit bot

Add DCHECK that the script context table do not contain native scripts.

This is to prevent unnecessary script contexts to be created for
native scripts, which could end up with a script context table
containing twenty script contexts for a newly created native context.

R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/1301533002

Cr-Commit-Position: refs/heads/master@{#30188}
parent 25ee6d66
......@@ -3225,7 +3225,6 @@ Genesis::Genesis(Isolate* isolate,
native_context()->set_natives_utils_object(
isolate->heap()->undefined_value());
}
// The serializer cannot serialize typed arrays. Reset those typed arrays
// for each new context.
InitializeBuiltinTypedArrays();
......@@ -3235,6 +3234,10 @@ Genesis::Genesis(Isolate* isolate,
if (!InstallDebuggerNatives()) return;
}
// Check that the script context table is empty except for the 'this' binding.
// We do not need script contexts for native scripts.
DCHECK_EQ(1, native_context()->script_context_table()->used());
result_ = native_context();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment