Commit 39114da1 authored by bmeurer's avatar bmeurer Committed by Commit bot

[api] Make sure InterceptorInfo is always in a verifyable state.

This should fix the Threading1 flakiness that we see on the waterfall.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#30967}
parent f7821596
...@@ -1370,13 +1370,13 @@ static void ObjectTemplateSetNamedPropertyHandler(ObjectTemplate* templ, ...@@ -1370,13 +1370,13 @@ static void ObjectTemplateSetNamedPropertyHandler(ObjectTemplate* templ,
EnsureNotInstantiated(cons, "ObjectTemplateSetNamedPropertyHandler"); EnsureNotInstantiated(cons, "ObjectTemplateSetNamedPropertyHandler");
auto obj = i::Handle<i::InterceptorInfo>::cast( auto obj = i::Handle<i::InterceptorInfo>::cast(
isolate->factory()->NewStruct(i::INTERCEPTOR_INFO_TYPE)); isolate->factory()->NewStruct(i::INTERCEPTOR_INFO_TYPE));
obj->set_flags(0);
if (getter != 0) SET_FIELD_WRAPPED(obj, set_getter, getter); if (getter != 0) SET_FIELD_WRAPPED(obj, set_getter, getter);
if (setter != 0) SET_FIELD_WRAPPED(obj, set_setter, setter); if (setter != 0) SET_FIELD_WRAPPED(obj, set_setter, setter);
if (query != 0) SET_FIELD_WRAPPED(obj, set_query, query); if (query != 0) SET_FIELD_WRAPPED(obj, set_query, query);
if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover); if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover);
if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator); if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator);
obj->set_flags(0);
obj->set_can_intercept_symbols( obj->set_can_intercept_symbols(
!(static_cast<int>(flags) & !(static_cast<int>(flags) &
static_cast<int>(PropertyHandlerFlags::kOnlyInterceptStrings))); static_cast<int>(PropertyHandlerFlags::kOnlyInterceptStrings)));
...@@ -1457,6 +1457,7 @@ void ObjectTemplate::SetHandler( ...@@ -1457,6 +1457,7 @@ void ObjectTemplate::SetHandler(
EnsureNotInstantiated(cons, "v8::ObjectTemplate::SetHandler"); EnsureNotInstantiated(cons, "v8::ObjectTemplate::SetHandler");
auto obj = i::Handle<i::InterceptorInfo>::cast( auto obj = i::Handle<i::InterceptorInfo>::cast(
isolate->factory()->NewStruct(i::INTERCEPTOR_INFO_TYPE)); isolate->factory()->NewStruct(i::INTERCEPTOR_INFO_TYPE));
obj->set_flags(0);
if (config.getter != 0) SET_FIELD_WRAPPED(obj, set_getter, config.getter); if (config.getter != 0) SET_FIELD_WRAPPED(obj, set_getter, config.getter);
if (config.setter != 0) SET_FIELD_WRAPPED(obj, set_setter, config.setter); if (config.setter != 0) SET_FIELD_WRAPPED(obj, set_setter, config.setter);
...@@ -1465,7 +1466,6 @@ void ObjectTemplate::SetHandler( ...@@ -1465,7 +1466,6 @@ void ObjectTemplate::SetHandler(
if (config.enumerator != 0) { if (config.enumerator != 0) {
SET_FIELD_WRAPPED(obj, set_enumerator, config.enumerator); SET_FIELD_WRAPPED(obj, set_enumerator, config.enumerator);
} }
obj->set_flags(0);
obj->set_all_can_read(static_cast<int>(config.flags) & obj->set_all_can_read(static_cast<int>(config.flags) &
static_cast<int>(PropertyHandlerFlags::kAllCanRead)); static_cast<int>(PropertyHandlerFlags::kAllCanRead));
......
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