Reviewers: Michael Starzinger,

Description:
put js accessor ics behind a flags until fixed

[email protected]
BUG=

Please review this at https://codereview.chromium.org/23816009/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+23, -3 lines):
  M src/flag-definitions.h
  M src/ic.cc
  M test/cctest/test-accessors.cc


Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index d47e9b1aecaeb772baf40cd0142c7efd3f7d493b..2b4f72d5f3ef85e2f32ae7ecd4b9ec7154fd1530 100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -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,
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index 9724c446e1f4d8e640ed55c204b9a7f7b2224c37..7211ad91679dc199abc4b704406731efa13a10c7 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -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);
         }
Index: test/cctest/test-accessors.cc
diff --git a/test/cctest/test-accessors.cc b/test/cctest/test-accessors.cc
index 09b0644b36758ee7a1a3d42eb619e13d47f8296b..bfe138382ec27be0a1f23188feb628f4cb164bc3 100644
--- a/test/cctest/test-accessors.cc
+++ b/test/cctest/test-accessors.cc
@@ -552,3 +552,19 @@ 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());
+}


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to