Commit 33fbaaf7 authored by dcarney@chromium.org's avatar dcarney@chromium.org

put js accessor ics behind a flags until fixed

R=mstarzinger@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16597 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e5eaef56
......@@ -545,6 +545,7 @@ DEFINE_bool(use_idle_notification, true,
"Use idle notification to reduce memory footprint.")
// ic.cc
DEFINE_bool(use_ic, true, "use inline caching")
DEFINE_bool(js_accessor_ics, false, "create ics for js accessors")
// macro-assembler-ia32.cc
DEFINE_bool(native_code_counters, false,
......
......@@ -1360,7 +1360,8 @@ Handle<Code> LoadIC::ComputeLoadHandler(LookupResult* lookup,
Handle<JSFunction> function = Handle<JSFunction>::cast(getter);
CallOptimization call_optimization(function);
if (call_optimization.is_simple_api_call() &&
call_optimization.IsCompatibleReceiver(*receiver)) {
call_optimization.IsCompatibleReceiver(*receiver) &&
FLAG_js_accessor_ics) {
return isolate()->stub_cache()->ComputeLoadCallback(
name, receiver, holder, call_optimization);
}
......@@ -1568,7 +1569,8 @@ Handle<Code> KeyedLoadIC::ComputeLoadHandler(LookupResult* lookup,
Handle<JSFunction> function = Handle<JSFunction>::cast(getter);
CallOptimization call_optimization(function);
if (call_optimization.is_simple_api_call() &&
call_optimization.IsCompatibleReceiver(*receiver)) {
call_optimization.IsCompatibleReceiver(*receiver) &&
FLAG_js_accessor_ics) {
return isolate()->stub_cache()->ComputeKeyedLoadCallback(
name, receiver, holder, call_optimization);
}
......@@ -1834,7 +1836,8 @@ Handle<Code> StoreIC::ComputeStoreMonomorphic(LookupResult* lookup,
Handle<JSFunction> function = Handle<JSFunction>::cast(setter);
CallOptimization call_optimization(function);
if (call_optimization.is_simple_api_call() &&
call_optimization.IsCompatibleReceiver(*receiver)) {
call_optimization.IsCompatibleReceiver(*receiver) &&
FLAG_js_accessor_ics) {
return isolate()->stub_cache()->ComputeStoreCallback(
name, receiver, holder, call_optimization, strict_mode);
}
......
......@@ -552,3 +552,18 @@ THREADED_TEST(JSONStringifyNamedInterceptorObject) {
v8::Handle<v8::String> expected = v8_str("{\"regress\":\"crbug-161028\"}");
CHECK(CompileRun("JSON.stringify(obj)")->Equals(expected));
}
THREADED_TEST(CrossContextAccess) {
LocalContext env;
v8::Isolate* isolate = env->GetIsolate();
v8::HandleScope scope(isolate);
v8::Handle<v8::Function> fun = v8::Function::New(isolate, handle_property);
LocalContext switch_context;
switch_context->Global()->Set(v8_str("fun"), fun);
v8::TryCatch try_catch;
CompileRun(
"var o = Object.create(null, { n: { get:fun } });"
"for (var i = 0; i < 10; i++) o.n;");
CHECK(!try_catch.HasCaught());
}
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