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

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

Issue 9285013: Fix building with clang (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/cctest/test-parsing.cc » ('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 2007-2010 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
11 // with the distribution. 11 // with the distribution.
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 "function f(x) { calls++; if (x > 0) { f(x - 1); } else { g(); } };" 230 "function f(x) { calls++; if (x > 0) { f(x - 1); } else { g(); } };"
231 "f(10); gc(); gc()"); 231 "f(10); gc(); gc()");
232 } 232 }
233 233
234 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value()); 234 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
235 CHECK_EQ(11, env->Global()->Get(v8_str("calls"))->Int32Value()); 235 CHECK_EQ(11, env->Global()->Get(v8_str("calls"))->Int32Value());
236 CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(Isolate::Current())); 236 CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(Isolate::Current()));
237 237
238 v8::Local<v8::Function> fun = 238 v8::Local<v8::Function> fun =
239 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f"))); 239 v8::Local<v8::Function>::Cast(env->Global()->Get(v8::String::New("f")));
240 Handle<v8::internal::JSFunction> f(v8::Utils::OpenHandle(*fun)); 240 CHECK(!fun.IsEmpty());
241 } 241 }
242 242
243 243
244 TEST(DeoptimizeMultiple) { 244 TEST(DeoptimizeMultiple) {
245 v8::HandleScope scope; 245 v8::HandleScope scope;
246 const char* extension_list[] = { "v8/gc" }; 246 const char* extension_list[] = { "v8/gc" };
247 v8::ExtensionConfiguration extensions(1, extension_list); 247 v8::ExtensionConfiguration extensions(1, extension_list);
248 LocalContext env(&extensions); 248 LocalContext env(&extensions);
249 249
250 { 250 {
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 } 706 }
707 707
708 CHECK(!GetJSFunction(env->Global(), "f1")->IsOptimized()); 708 CHECK(!GetJSFunction(env->Global(), "f1")->IsOptimized());
709 CHECK(!GetJSFunction(env->Global(), "g1")->IsOptimized()); 709 CHECK(!GetJSFunction(env->Global(), "g1")->IsOptimized());
710 CHECK(!GetJSFunction(env->Global(), "f2")->IsOptimized()); 710 CHECK(!GetJSFunction(env->Global(), "f2")->IsOptimized());
711 CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized()); 711 CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized());
712 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value()); 712 CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
713 CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value()); 713 CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value());
714 CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(Isolate::Current())); 714 CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(Isolate::Current()));
715 } 715 }
OLDNEW
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698