Commit bec49a48 authored by jkummerow's avatar jkummerow Committed by Commit bot

Revert of Avoid Context::Enter and Context::Exit if we're reentering the...

Revert of Avoid Context::Enter and Context::Exit if we're reentering the active and last entered context (patchset #2 id:20001 of https://codereview.chromium.org/2131483002/ )

Reason for revert:
crashes: crbug.com/626719

Original issue's description:
> Avoid Context::Enter and Context::Exit if we're reentering the active and last entered context
>
> A bit of browsing around indicates that the new fast-path is taken most of the time:
>    3496 Entering new
>  152295 Reentering same
>
> BUG=
>
> Committed: https://crrev.com/1829eb661ef1cf432fb551bcb193f521a219d490
> Cr-Commit-Position: refs/heads/master@{#37570}

TBR=jochen@chromium.org,verwaest@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=

Review-Url: https://codereview.chromium.org/2140563002
Cr-Commit-Position: refs/heads/master@{#37632}
parent be5808bf
......@@ -183,17 +183,7 @@ class CallDepthScope {
DCHECK(!isolate_->external_caught_exception());
isolate_->IncrementJsCallsFromApiCounter();
isolate_->handle_scope_implementer()->IncrementCallDepth();
if (!context.IsEmpty()) {
i::Handle<i::Context> env = Utils::OpenHandle(*context);
i::HandleScopeImplementer* impl = isolate->handle_scope_implementer();
if (isolate->context() != nullptr &&
isolate->context()->native_context() == env->native_context() &&
impl->LastEnteredContextWas(env)) {
context_ = Local<Context>();
} else {
context_->Enter();
}
}
if (!context_.IsEmpty()) context_->Enter();
if (do_callback_) isolate_->FireBeforeCallEnteredCallback();
}
~CallDepthScope() {
......
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