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

Side by Side Diff: src/runtime.cc

Issue 5812005: Deoptimize non-smi switch cases if they are reached. (Closed)
Patch Set: Rebased Created 10 years 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
« src/hydrogen.cc ('K') | « src/ia32/full-codegen-ia32.cc ('k') | 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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 6858 matching lines...) Expand 10 before | Expand all | Expand 10 after
6869 function->PrintName(); 6869 function->PrintName();
6870 PrintF("]\n"); 6870 PrintF("]\n");
6871 } 6871 }
6872 6872
6873 // Try to compile the optimized code. A true return value from 6873 // Try to compile the optimized code. A true return value from
6874 // CompileOptimized means that compilation succeeded, not necessarily 6874 // CompileOptimized means that compilation succeeded, not necessarily
6875 // that optimization succeeded. 6875 // that optimization succeeded.
6876 if (CompileOptimized(function, ast_id) && function->IsOptimized()) { 6876 if (CompileOptimized(function, ast_id) && function->IsOptimized()) {
6877 DeoptimizationInputData* data = DeoptimizationInputData::cast( 6877 DeoptimizationInputData* data = DeoptimizationInputData::cast(
6878 function->code()->deoptimization_data()); 6878 function->code()->deoptimization_data());
6879 if (FLAG_trace_osr) { 6879 if (data->OsrPcOffset()->value() >= 0) {
6880 PrintF("[on-stack replacement offset %d in optimized code]\n", 6880 if (FLAG_trace_osr) {
6881 PrintF("[on-stack replacement offset %d in optimized code]\n",
6881 data->OsrPcOffset()->value()); 6882 data->OsrPcOffset()->value());
6883 }
6884 ASSERT(data->OsrAstId()->value() == ast_id);
6885 } else {
6886 // We may never generate the desired OSR entry if we emit an
6887 // early deoptimize.
6888 succeeded = false;
6882 } 6889 }
6883 ASSERT(data->OsrAstId()->value() == ast_id);
6884 ASSERT(data->OsrPcOffset()->value() >= 0);
6885 } else { 6890 } else {
6886 succeeded = false; 6891 succeeded = false;
6887 } 6892 }
6888 } 6893 }
6889 6894
6890 // Revert to the original stack checks in the original unoptimized code. 6895 // Revert to the original stack checks in the original unoptimized code.
6891 if (FLAG_trace_osr) { 6896 if (FLAG_trace_osr) {
6892 PrintF("[restoring original stack checks in "); 6897 PrintF("[restoring original stack checks in ");
6893 function->PrintName(); 6898 function->PrintName();
6894 PrintF("]\n"); 6899 PrintF("]\n");
(...skipping 3894 matching lines...) Expand 10 before | Expand all | Expand 10 after
10789 } else { 10794 } else {
10790 // Handle last resort GC and make sure to allow future allocations 10795 // Handle last resort GC and make sure to allow future allocations
10791 // to grow the heap without causing GCs (if possible). 10796 // to grow the heap without causing GCs (if possible).
10792 Counters::gc_last_resort_from_js.Increment(); 10797 Counters::gc_last_resort_from_js.Increment();
10793 Heap::CollectAllGarbage(false); 10798 Heap::CollectAllGarbage(false);
10794 } 10799 }
10795 } 10800 }
10796 10801
10797 10802
10798 } } // namespace v8::internal 10803 } } // namespace v8::internal
OLDNEW
« src/hydrogen.cc ('K') | « src/ia32/full-codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698