Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: test/cctest/test-api.cc

Issue 551191: Port caching of lookup followups for interceptors to ARM (Closed)
Patch Set: Next iteration Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/stub-cache-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index a00097b54f0fc286f7dff226b9f9d5fcdda4a869..e05d73780d8f8920a74e011bea33c3c6e6cfddac 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -5675,6 +5675,35 @@ THREADED_TEST(InterceptorCallICInvalidatedConstantFunctionViaGlobal) {
}
+// Test the case when actual function to call sits on global object.
+THREADED_TEST(InterceptorCallICCachedFromGlobal) {
+ v8::HandleScope scope;
+ v8::Handle<v8::ObjectTemplate> templ_o = ObjectTemplate::New();
+ templ_o->SetNamedPropertyHandler(NoBlockGetterX);
+
+ LocalContext context;
+ context->Global()->Set(v8_str("o"), templ_o->NewInstance());
+
+ v8::Handle<Value> value = CompileRun(
+ "try {"
+ " o.__proto__ = this;"
+ " for (var i = 0; i < 10; i++) {"
+ " var v = o.parseFloat('239');"
+ " if (v != 239) throw v;"
+ // Now it should be ICed and keep a reference to parseFloat.
+ " }"
+ " var result = 0;"
+ " for (var i = 0; i < 10; i++) {"
+ " result += o.parseFloat('239');"
+ " }"
+ " result"
+ "} catch(e) {"
+ " e"
+ "};");
+ CHECK_EQ(239 * 10, value->Int32Value());
+}
+
+
static int interceptor_call_count = 0;
static v8::Handle<Value> InterceptorICRefErrorGetter(Local<String> name,
« no previous file with comments | « src/x64/stub-cache-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698