Commit c090806f authored by Qingyan Li's avatar Qingyan Li Committed by Commit Bot

[snapshot] fix check script_context_table

There maybe one more ScriptContext in script_context_table if mksnapshot
executed with embeded script.

R=yangguo@chromium.org

Bug: v8:7304
Change-Id: I6f431f76d4beae61a519c3acc3b856d1f7479740
Reviewed-on: https://chromium-review.googlesource.com/866630Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50637}
parent 02dbef14
......@@ -5555,10 +5555,6 @@ Genesis::Genesis(
ConfigureUtilsObject(context_type);
// 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());
native_context()->ResetErrorsThrown();
result_ = native_context();
}
......
......@@ -9,6 +9,7 @@
#include "src/accessors.h"
#include "src/arguments.h"
#include "src/ast/scopes.h"
#include "src/bootstrapper.h"
#include "src/deoptimizer.h"
#include "src/frames-inl.h"
#include "src/isolate-inl.h"
......@@ -726,6 +727,9 @@ RUNTIME_FUNCTION(Runtime_NewScriptContext) {
Handle<JSFunction> closure(function->shared()->IsUserJavaScript()
? native_context->closure()
: *function);
// We do not need script contexts here during bootstrap.
DCHECK(!isolate->bootstrapper()->IsActive());
Handle<Context> result =
isolate->factory()->NewScriptContext(closure, scope_info);
......
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