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

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

Issue 10642019: Skip test for optimized code sharing if flag is disabled by default. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed nit Created 8 years, 6 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 | « no previous file | no next file » | 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 v8::Local<v8::Function> f = v8::Local<v8::Function>::Cast( 348 v8::Local<v8::Function> f = v8::Local<v8::Function>::Cast(
349 env->Global()->Get(v8::String::New("f"))); 349 env->Global()->Get(v8::String::New("f")));
350 CHECK_EQ(i, f->GetScriptLineNumber()); 350 CHECK_EQ(i, f->GetScriptLineNumber());
351 } 351 }
352 } 352 }
353 353
354 354
355 // Test that optimized code for different closures is actually shared 355 // Test that optimized code for different closures is actually shared
356 // immediately by the FastNewClosureStub when run in the same context. 356 // immediately by the FastNewClosureStub when run in the same context.
357 TEST(OptimizedCodeSharing) { 357 TEST(OptimizedCodeSharing) {
358 // Skip test if --cache-optimized-code is not activated by default because
359 // FastNewClosureStub that is baked into the snapshot is incorrect.
360 if (!FLAG_cache_optimized_code) return;
358 FLAG_allow_natives_syntax = true; 361 FLAG_allow_natives_syntax = true;
359 InitializeVM(); 362 InitializeVM();
360 v8::HandleScope scope; 363 v8::HandleScope scope;
361 for (int i = 0; i < 10; i++) { 364 for (int i = 0; i < 10; i++) {
362 LocalContext env; 365 LocalContext env;
363 env->Global()->Set(v8::String::New("x"), v8::Integer::New(i)); 366 env->Global()->Set(v8::String::New("x"), v8::Integer::New(i));
364 CompileRun("function MakeClosure() {" 367 CompileRun("function MakeClosure() {"
365 " return function() { return x; };" 368 " return function() { return x; };"
366 "}" 369 "}"
367 "var closure0 = MakeClosure();" 370 "var closure0 = MakeClosure();"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 CompileRun("function f() { a = 12345678 }; f();"); 428 CompileRun("function f() { a = 12345678 }; f();");
426 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 429 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
427 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); 430 CompileRun("function f(x) { a = 12345678 + x}; f(1);");
428 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 431 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
429 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); 432 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);");
430 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 433 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
431 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); 434 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);");
432 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 435 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
433 } 436 }
434 #endif 437 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698