Commit 14e576f9 authored by haraken@chromium.org's avatar haraken@chromium.org

Revert r174506

r174506 replaced toV8Context() with v8::Object::CreationContext(),
and it caused 16% regression in dromaeo.jslibeventjquery.
This is because v8::Object::CreationContext() is slow.

This CL reverts the change.

BUG=383926

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179085 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent bd89c20d
......@@ -157,7 +157,13 @@ void V8Window::eventAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Val
return;
}
v8::Handle<v8::Value> jsEvent = V8HiddenValue::getHiddenValue(info.GetIsolate(), info.Holder()->CreationContext()->Global(), V8HiddenValue::event(info.GetIsolate()));
ASSERT(frame);
// This is a fast path to retrieve info.Holder()->CreationContext().
v8::Local<v8::Context> context = toV8Context(frame, DOMWrapperWorld::current(info.GetIsolate()));
if (context.IsEmpty())
return;
v8::Handle<v8::Value> jsEvent = V8HiddenValue::getHiddenValue(info.GetIsolate(), context->Global(), V8HiddenValue::event(info.GetIsolate()));
if (jsEvent.IsEmpty())
return;
v8SetReturnValue(info, jsEvent);
......@@ -172,7 +178,13 @@ void V8Window::eventAttributeSetterCustom(v8::Local<v8::Value> value, const v8::
return;
}
V8HiddenValue::setHiddenValue(info.GetIsolate(), info.Holder()->CreationContext()->Global(), V8HiddenValue::event(info.GetIsolate()), value);
ASSERT(frame);
// This is a fast path to retrieve info.Holder()->CreationContext().
v8::Local<v8::Context> context = toV8Context(frame, DOMWrapperWorld::current(info.GetIsolate()));
if (context.IsEmpty())
return;
V8HiddenValue::setHiddenValue(info.GetIsolate(), context->Global(), V8HiddenValue::event(info.GetIsolate()), value);
}
void V8Window::frameElementAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& 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