Commit eac097c5 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[cleanup] Don't crash when printing context->previous()

Bug: v8:8834
Change-Id: I5730e550f1b19e651d1fa7cb8b5694c9d839ff84
Reviewed-on: https://chromium-review.googlesource.com/c/1480374Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59763}
parent 8a1e927f
......@@ -77,6 +77,8 @@ void Context::set_scope_info(ScopeInfo scope_info) {
set(SCOPE_INFO_INDEX, scope_info);
}
Object Context::unchecked_previous() { return get(PREVIOUS_INDEX); }
Context Context::previous() {
Object result = get(PREVIOUS_INDEX);
DCHECK(IsBootstrappingOrValidParentContext(result, *this));
......
......@@ -538,6 +538,8 @@ class Context : public HeapObject {
// Direct slot access.
inline void set_scope_info(ScopeInfo scope_info);
inline Object unchecked_previous();
inline Context previous();
inline void set_previous(Context context);
......
......@@ -958,7 +958,7 @@ void PrintContextWithHeader(std::ostream& os, Context context,
context->PrintHeader(os, type);
os << "\n - length: " << context->length();
os << "\n - scope_info: " << Brief(context->scope_info());
os << "\n - previous: " << Brief(context->previous());
os << "\n - previous: " << Brief(context->unchecked_previous());
os << "\n - extension: " << Brief(context->extension());
os << "\n - native_context: " << Brief(context->native_context());
PrintFixedArrayElements(os, 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