| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #include <algorithm> | 30 #include <algorithm> |
| 31 | 31 |
| 32 #include "v8.h" | 32 #include "v8.h" |
| 33 #include "codegen.h" | 33 #include "codegen.h" |
| 34 #include "full-codegen.h" | 34 #include "full-codegen.h" |
| 35 #include "hashmap.h" | 35 #include "hashmap.h" |
| 36 #include "hydrogen-bce.h" | 36 #include "hydrogen-bce.h" |
| 37 #include "hydrogen-bch.h" | 37 #include "hydrogen-bch.h" |
| 38 #include "hydrogen-canonicalize.h" | 38 #include "hydrogen-canonicalize.h" |
| 39 #include "hydrogen-check-elimination.h" |
| 39 #include "hydrogen-dce.h" | 40 #include "hydrogen-dce.h" |
| 40 #include "hydrogen-dehoist.h" | 41 #include "hydrogen-dehoist.h" |
| 41 #include "hydrogen-deoptimizing-mark.h" | 42 #include "hydrogen-deoptimizing-mark.h" |
| 42 #include "hydrogen-environment-liveness.h" | 43 #include "hydrogen-environment-liveness.h" |
| 43 #include "hydrogen-escape-analysis.h" | 44 #include "hydrogen-escape-analysis.h" |
| 44 #include "hydrogen-infer-representation.h" | 45 #include "hydrogen-infer-representation.h" |
| 45 #include "hydrogen-infer-types.h" | 46 #include "hydrogen-infer-types.h" |
| 46 #include "hydrogen-load-elimination.h" | 47 #include "hydrogen-load-elimination.h" |
| 47 #include "hydrogen-gvn.h" | 48 #include "hydrogen-gvn.h" |
| 48 #include "hydrogen-mark-deoptimize.h" | 49 #include "hydrogen-mark-deoptimize.h" |
| (...skipping 2932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2981 if (!CheckConstPhiUses()) { | 2982 if (!CheckConstPhiUses()) { |
| 2982 *bailout_reason = kUnsupportedPhiUseOfConstVariable; | 2983 *bailout_reason = kUnsupportedPhiUseOfConstVariable; |
| 2983 return false; | 2984 return false; |
| 2984 } | 2985 } |
| 2985 Run<HRedundantPhiEliminationPhase>(); | 2986 Run<HRedundantPhiEliminationPhase>(); |
| 2986 if (!CheckArgumentsPhiUses()) { | 2987 if (!CheckArgumentsPhiUses()) { |
| 2987 *bailout_reason = kUnsupportedPhiUseOfArguments; | 2988 *bailout_reason = kUnsupportedPhiUseOfArguments; |
| 2988 return false; | 2989 return false; |
| 2989 } | 2990 } |
| 2990 | 2991 |
| 2991 // Remove dead code and phis | 2992 if (FLAG_check_elimination) Run<HCheckEliminationPhase>(); |
| 2992 if (FLAG_dead_code_elimination) Run<HDeadCodeEliminationPhase>(); | 2993 if (FLAG_dead_code_elimination) Run<HDeadCodeEliminationPhase>(); |
| 2993 | |
| 2994 if (FLAG_use_escape_analysis) Run<HEscapeAnalysisPhase>(); | 2994 if (FLAG_use_escape_analysis) Run<HEscapeAnalysisPhase>(); |
| 2995 | 2995 |
| 2996 if (FLAG_load_elimination) Run<HLoadEliminationPhase>(); | 2996 if (FLAG_load_elimination) Run<HLoadEliminationPhase>(); |
| 2997 | 2997 |
| 2998 CollectPhis(); | 2998 CollectPhis(); |
| 2999 | 2999 |
| 3000 if (has_osr()) osr()->FinishOsrValues(); | 3000 if (has_osr()) osr()->FinishOsrValues(); |
| 3001 | 3001 |
| 3002 Run<HInferRepresentationPhase>(); | 3002 Run<HInferRepresentationPhase>(); |
| 3003 | 3003 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 3021 if (FLAG_use_gvn) Run<HGlobalValueNumberingPhase>(); | 3021 if (FLAG_use_gvn) Run<HGlobalValueNumberingPhase>(); |
| 3022 | 3022 |
| 3023 if (FLAG_use_range) Run<HRangeAnalysisPhase>(); | 3023 if (FLAG_use_range) Run<HRangeAnalysisPhase>(); |
| 3024 | 3024 |
| 3025 Run<HComputeChangeUndefinedToNaN>(); | 3025 Run<HComputeChangeUndefinedToNaN>(); |
| 3026 Run<HComputeMinusZeroChecksPhase>(); | 3026 Run<HComputeMinusZeroChecksPhase>(); |
| 3027 | 3027 |
| 3028 // Eliminate redundant stack checks on backwards branches. | 3028 // Eliminate redundant stack checks on backwards branches. |
| 3029 Run<HStackCheckEliminationPhase>(); | 3029 Run<HStackCheckEliminationPhase>(); |
| 3030 | 3030 |
| 3031 if (FLAG_array_bounds_checks_elimination) { | 3031 if (FLAG_array_bounds_checks_elimination) Run<HBoundsCheckEliminationPhase>(); |
| 3032 Run<HBoundsCheckEliminationPhase>(); | 3032 if (FLAG_array_bounds_checks_hoisting) Run<HBoundsCheckHoistingPhase>(); |
| 3033 } | |
| 3034 if (FLAG_array_bounds_checks_hoisting) { | |
| 3035 Run<HBoundsCheckHoistingPhase>(); | |
| 3036 } | |
| 3037 if (FLAG_array_index_dehoisting) Run<HDehoistIndexComputationsPhase>(); | 3033 if (FLAG_array_index_dehoisting) Run<HDehoistIndexComputationsPhase>(); |
| 3038 if (FLAG_dead_code_elimination) Run<HDeadCodeEliminationPhase>(); | 3034 if (FLAG_dead_code_elimination) Run<HDeadCodeEliminationPhase>(); |
| 3039 | 3035 |
| 3040 RestoreActualValues(); | 3036 RestoreActualValues(); |
| 3041 | 3037 |
| 3042 return true; | 3038 return true; |
| 3043 } | 3039 } |
| 3044 | 3040 |
| 3045 | 3041 |
| 3046 void HGraph::RestoreActualValues() { | 3042 void HGraph::RestoreActualValues() { |
| (...skipping 6727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9774 if (ShouldProduceTraceOutput()) { | 9770 if (ShouldProduceTraceOutput()) { |
| 9775 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 9771 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 9776 } | 9772 } |
| 9777 | 9773 |
| 9778 #ifdef DEBUG | 9774 #ifdef DEBUG |
| 9779 graph_->Verify(false); // No full verify. | 9775 graph_->Verify(false); // No full verify. |
| 9780 #endif | 9776 #endif |
| 9781 } | 9777 } |
| 9782 | 9778 |
| 9783 } } // namespace v8::internal | 9779 } } // namespace v8::internal |
| OLD | NEW |