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

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

Issue 1390073004: Revert of [turbofan] Add initial support for global specialization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@AstGraphBuilder
Patch Set: Created 5 years, 2 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
« no previous file with comments | « src/flag-definitions.h ('k') | test/mjsunit/call-runtime-tail.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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 393 }
394 } 394 }
395 395
396 396
397 // Test that optimized code for different closures is actually shared 397 // Test that optimized code for different closures is actually shared
398 // immediately by the FastNewClosureStub when run different contexts. 398 // immediately by the FastNewClosureStub when run different contexts.
399 TEST(OptimizedCodeSharing2) { 399 TEST(OptimizedCodeSharing2) {
400 if (FLAG_stress_compaction) return; 400 if (FLAG_stress_compaction) return;
401 FLAG_allow_natives_syntax = true; 401 FLAG_allow_natives_syntax = true;
402 FLAG_cache_optimized_code = true; 402 FLAG_cache_optimized_code = true;
403 FLAG_native_context_specialization = false;
404 FLAG_turbo_cache_shared_code = true; 403 FLAG_turbo_cache_shared_code = true;
405 const char* flag = "--turbo-filter=*"; 404 const char* flag = "--turbo-filter=*";
406 FlagList::SetFlagsFromString(flag, StrLength(flag)); 405 FlagList::SetFlagsFromString(flag, StrLength(flag));
407 CcTest::InitializeVM(); 406 CcTest::InitializeVM();
408 v8::HandleScope scope(CcTest::isolate()); 407 v8::HandleScope scope(CcTest::isolate());
409 v8::Local<v8::Script> script = v8_compile( 408 v8::Local<v8::Script> script = v8_compile(
410 "function MakeClosure() {" 409 "function MakeClosure() {"
411 " return function() { return x; };" 410 " return function() { return x; };"
412 "}"); 411 "}");
413 Handle<Code> reference_code; 412 Handle<Code> reference_code;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 } 448 }
450 } 449 }
451 450
452 451
453 // Test that optimized code for different closures is actually shared 452 // Test that optimized code for different closures is actually shared
454 // immediately by the FastNewClosureStub without context-dependent entries. 453 // immediately by the FastNewClosureStub without context-dependent entries.
455 TEST(OptimizedCodeSharing3) { 454 TEST(OptimizedCodeSharing3) {
456 if (FLAG_stress_compaction) return; 455 if (FLAG_stress_compaction) return;
457 FLAG_allow_natives_syntax = true; 456 FLAG_allow_natives_syntax = true;
458 FLAG_cache_optimized_code = true; 457 FLAG_cache_optimized_code = true;
459 FLAG_native_context_specialization = false;
460 FLAG_turbo_cache_shared_code = true; 458 FLAG_turbo_cache_shared_code = true;
461 const char* flag = "--turbo-filter=*"; 459 const char* flag = "--turbo-filter=*";
462 FlagList::SetFlagsFromString(flag, StrLength(flag)); 460 FlagList::SetFlagsFromString(flag, StrLength(flag));
463 CcTest::InitializeVM(); 461 CcTest::InitializeVM();
464 v8::HandleScope scope(CcTest::isolate()); 462 v8::HandleScope scope(CcTest::isolate());
465 v8::Local<v8::Script> script = v8_compile( 463 v8::Local<v8::Script> script = v8_compile(
466 "function MakeClosure() {" 464 "function MakeClosure() {"
467 " return function() { return x; };" 465 " return function() { return x; };"
468 "}"); 466 "}");
469 Handle<Code> reference_code; 467 Handle<Code> reference_code;
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 CompileRun("function f() { a = 12345678 }; f();"); 691 CompileRun("function f() { a = 12345678 }; f();");
694 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); 692 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f"));
695 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); 693 CompileRun("function f(x) { a = 12345678 + x}; f(1);");
696 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); 694 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f"));
697 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); 695 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);");
698 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); 696 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f"));
699 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); 697 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);");
700 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); 698 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f"));
701 } 699 }
702 #endif 700 #endif
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | test/mjsunit/call-runtime-tail.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698