OLD | NEW |
---|---|
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 |
11 // with the distribution. | 11 // with the distribution. |
12 // * Neither the name of Google Inc. nor the names of its | 12 // * Neither the name of Google Inc. nor the names of its |
13 // contributors may be used to endorse or promote products derived | 13 // contributors may be used to endorse or promote products derived |
14 // from this software without specific prior written permission. | 14 // from this software without specific prior written permission. |
15 // | 15 // |
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "hydrogen.h" | 28 #include "hydrogen.h" |
29 #include "hydrogen-gvn.h" | |
30 | 29 |
31 #include <algorithm> | 30 #include <algorithm> |
32 | 31 |
33 #include "v8.h" | 32 #include "v8.h" |
34 #include "codegen.h" | 33 #include "codegen.h" |
35 #include "full-codegen.h" | 34 #include "full-codegen.h" |
36 #include "hashmap.h" | 35 #include "hashmap.h" |
37 #include "hydrogen-environment-liveness.h" | 36 #include "hydrogen-environment-liveness.h" |
37 #include "hydrogen-escape-analysis.h" | |
38 #include "hydrogen-gvn.h" | |
38 #include "lithium-allocator.h" | 39 #include "lithium-allocator.h" |
39 #include "parser.h" | 40 #include "parser.h" |
40 #include "scopeinfo.h" | 41 #include "scopeinfo.h" |
41 #include "scopes.h" | 42 #include "scopes.h" |
42 #include "stub-cache.h" | 43 #include "stub-cache.h" |
43 #include "typing.h" | 44 #include "typing.h" |
44 | 45 |
45 #if V8_TARGET_ARCH_IA32 | 46 #if V8_TARGET_ARCH_IA32 |
46 #include "ia32/lithium-codegen-ia32.h" | 47 #include "ia32/lithium-codegen-ia32.h" |
47 #elif V8_TARGET_ARCH_X64 | 48 #elif V8_TARGET_ARCH_X64 |
(...skipping 3928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3976 // Do a full verify after building the graph and computing dominators. | 3977 // Do a full verify after building the graph and computing dominators. |
3977 Verify(true); | 3978 Verify(true); |
3978 #endif | 3979 #endif |
3979 | 3980 |
3980 if (FLAG_analyze_environment_liveness) { | 3981 if (FLAG_analyze_environment_liveness) { |
3981 EnvironmentSlotLivenessAnalyzer esla(this); | 3982 EnvironmentSlotLivenessAnalyzer esla(this); |
3982 esla.AnalyzeAndTrim(); | 3983 esla.AnalyzeAndTrim(); |
3983 } | 3984 } |
3984 | 3985 |
3985 PropagateDeoptimizingMark(); | 3986 PropagateDeoptimizingMark(); |
3987 | |
titzer
2013/06/28 12:40:55
Whitespace change
Michael Starzinger
2013/06/28 13:37:27
Done.
| |
3986 if (!CheckConstPhiUses()) { | 3988 if (!CheckConstPhiUses()) { |
3987 *bailout_reason = SmartArrayPointer<char>(StrDup( | 3989 *bailout_reason = SmartArrayPointer<char>(StrDup( |
3988 "Unsupported phi use of const variable")); | 3990 "Unsupported phi use of const variable")); |
3989 return false; | 3991 return false; |
3990 } | 3992 } |
3991 EliminateRedundantPhis(); | 3993 EliminateRedundantPhis(); |
3992 if (!CheckArgumentsPhiUses()) { | 3994 if (!CheckArgumentsPhiUses()) { |
3993 *bailout_reason = SmartArrayPointer<char>(StrDup( | 3995 *bailout_reason = SmartArrayPointer<char>(StrDup( |
3994 "Unsupported phi use of arguments")); | 3996 "Unsupported phi use of arguments")); |
3995 return false; | 3997 return false; |
(...skipping 26 matching lines...) Expand all Loading... | |
4022 | 4024 |
4023 InitializeInferredTypes(); | 4025 InitializeInferredTypes(); |
4024 | 4026 |
4025 // Must be performed before canonicalization to ensure that Canonicalize | 4027 // Must be performed before canonicalization to ensure that Canonicalize |
4026 // will not remove semantically meaningful ToInt32 operations e.g. BIT_OR with | 4028 // will not remove semantically meaningful ToInt32 operations e.g. BIT_OR with |
4027 // zero. | 4029 // zero. |
4028 if (FLAG_opt_safe_uint32_operations) ComputeSafeUint32Operations(); | 4030 if (FLAG_opt_safe_uint32_operations) ComputeSafeUint32Operations(); |
4029 | 4031 |
4030 if (FLAG_use_canonicalizing) Canonicalize(); | 4032 if (FLAG_use_canonicalizing) Canonicalize(); |
4031 | 4033 |
4034 if (FLAG_use_escape_analysis) { | |
4035 HEscapeAnalysis escapeAnalysis(this); | |
Jakob Kummerow
2013/06/28 12:34:26
nit: unix_hacker_style for variable names
Michael Starzinger
2013/06/28 12:39:37
Done (also for the range analysis below).
| |
4036 escapeAnalysis.Analyze(); | |
4037 } | |
4038 | |
4032 if (FLAG_use_gvn) GlobalValueNumbering(); | 4039 if (FLAG_use_gvn) GlobalValueNumbering(); |
4033 | 4040 |
4034 if (FLAG_use_range) { | 4041 if (FLAG_use_range) { |
4035 HRangeAnalysis rangeAnalysis(this); | 4042 HRangeAnalysis rangeAnalysis(this); |
4036 rangeAnalysis.Analyze(); | 4043 rangeAnalysis.Analyze(); |
4037 } | 4044 } |
4038 ComputeMinusZeroChecks(); | 4045 ComputeMinusZeroChecks(); |
4039 | 4046 |
4040 // Eliminate redundant stack checks on backwards branches. | 4047 // Eliminate redundant stack checks on backwards branches. |
4041 HStackCheckEliminator sce(this); | 4048 HStackCheckEliminator sce(this); |
(...skipping 7512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11554 if (ShouldProduceTraceOutput()) { | 11561 if (ShouldProduceTraceOutput()) { |
11555 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11562 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11556 } | 11563 } |
11557 | 11564 |
11558 #ifdef DEBUG | 11565 #ifdef DEBUG |
11559 graph_->Verify(false); // No full verify. | 11566 graph_->Verify(false); // No full verify. |
11560 #endif | 11567 #endif |
11561 } | 11568 } |
11562 | 11569 |
11563 } } // namespace v8::internal | 11570 } } // namespace v8::internal |
OLD | NEW |