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

Side by Side Diff: test/cctest/test-api.cc

Issue 14200035: Rollback of r13728 in 3.17 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.17
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/version.cc ('k') | test/mjsunit/builtins.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after
1842 CheckThisNamedPropertyHandler, 1842 CheckThisNamedPropertyHandler,
1843 CheckThisNamedPropertySetter, 1843 CheckThisNamedPropertySetter,
1844 CheckThisNamedPropertyQuery, 1844 CheckThisNamedPropertyQuery,
1845 CheckThisNamedPropertyDeleter, 1845 CheckThisNamedPropertyDeleter,
1846 CheckThisNamedPropertyEnumerator); 1846 CheckThisNamedPropertyEnumerator);
1847 1847
1848 bottom = templ->GetFunction()->NewInstance(); 1848 bottom = templ->GetFunction()->NewInstance();
1849 Local<v8::Object> top = templ->GetFunction()->NewInstance(); 1849 Local<v8::Object> top = templ->GetFunction()->NewInstance();
1850 Local<v8::Object> middle = templ->GetFunction()->NewInstance(); 1850 Local<v8::Object> middle = templ->GetFunction()->NewInstance();
1851 1851
1852 bottom->SetPrototype(middle); 1852 bottom->Set(v8_str("__proto__"), middle);
1853 middle->SetPrototype(top); 1853 middle->Set(v8_str("__proto__"), top);
1854 env->Global()->Set(v8_str("obj"), bottom); 1854 env->Global()->Set(v8_str("obj"), bottom);
1855 1855
1856 // Indexed and named get. 1856 // Indexed and named get.
1857 Script::Compile(v8_str("obj[0]"))->Run(); 1857 Script::Compile(v8_str("obj[0]"))->Run();
1858 Script::Compile(v8_str("obj.x"))->Run(); 1858 Script::Compile(v8_str("obj.x"))->Run();
1859 1859
1860 // Indexed and named set. 1860 // Indexed and named set.
1861 Script::Compile(v8_str("obj[1] = 42"))->Run(); 1861 Script::Compile(v8_str("obj[1] = 42"))->Run();
1862 Script::Compile(v8_str("obj.y = 42"))->Run(); 1862 Script::Compile(v8_str("obj.y = 42"))->Run();
1863 1863
(...skipping 7800 matching lines...) Expand 10 before | Expand all | Expand 10 after
9664 // is invoked 9664 // is invoked
9665 THREADED_TEST(InterceptorCallICCacheableNotNeeded) { 9665 THREADED_TEST(InterceptorCallICCacheableNotNeeded) {
9666 v8::HandleScope scope; 9666 v8::HandleScope scope;
9667 v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(); 9667 v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New();
9668 templ->SetNamedPropertyHandler(InterceptorCallICGetter4); 9668 templ->SetNamedPropertyHandler(InterceptorCallICGetter4);
9669 LocalContext context; 9669 LocalContext context;
9670 context->Global()->Set(v8_str("o"), templ->NewInstance()); 9670 context->Global()->Set(v8_str("o"), templ->NewInstance());
9671 call_ic_function4 = 9671 call_ic_function4 =
9672 v8_compile("function f(x) { return x - 1; }; f")->Run(); 9672 v8_compile("function f(x) { return x - 1; }; f")->Run();
9673 v8::Handle<Value> value = CompileRun( 9673 v8::Handle<Value> value = CompileRun(
9674 "Object.getPrototypeOf(o).x = function(x) { return x + 1; };" 9674 "o.__proto__.x = function(x) { return x + 1; };"
9675 "var result = 0;" 9675 "var result = 0;"
9676 "for (var i = 0; i < 1000; i++) {" 9676 "for (var i = 0; i < 1000; i++) {"
9677 " result = o.x(42);" 9677 " result = o.x(42);"
9678 "}"); 9678 "}");
9679 CHECK_EQ(41, value->Int32Value()); 9679 CHECK_EQ(41, value->Int32Value());
9680 } 9680 }
9681 9681
9682 9682
9683 // Test the case when we stored cacheable lookup into 9683 // Test the case when we stored cacheable lookup into
9684 // a stub, but it got invalidated later on 9684 // a stub, but it got invalidated later on
(...skipping 8626 matching lines...) Expand 10 before | Expand all | Expand 10 after
18311 i::Semaphore* sem_; 18311 i::Semaphore* sem_;
18312 volatile int sem_value_; 18312 volatile int sem_value_;
18313 }; 18313 };
18314 18314
18315 18315
18316 THREADED_TEST(SemaphoreInterruption) { 18316 THREADED_TEST(SemaphoreInterruption) {
18317 ThreadInterruptTest().RunTest(); 18317 ThreadInterruptTest().RunTest();
18318 } 18318 }
18319 18319
18320 #endif // WIN32 18320 #endif // WIN32
OLDNEW
« no previous file with comments | « src/version.cc ('k') | test/mjsunit/builtins.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698