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

Side by Side Diff: src/hydrogen.cc

Issue 17914002: First simplistic implementation of escape analysis. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Ben Titzer. Created 7 years, 5 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 | « src/hydrogen.h ('k') | src/hydrogen-escape-analysis.h » ('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
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 3974 matching lines...) Expand 10 before | Expand all | Expand 10 after
4022 4023
4023 InitializeInferredTypes(); 4024 InitializeInferredTypes();
4024 4025
4025 // Must be performed before canonicalization to ensure that Canonicalize 4026 // Must be performed before canonicalization to ensure that Canonicalize
4026 // will not remove semantically meaningful ToInt32 operations e.g. BIT_OR with 4027 // will not remove semantically meaningful ToInt32 operations e.g. BIT_OR with
4027 // zero. 4028 // zero.
4028 if (FLAG_opt_safe_uint32_operations) ComputeSafeUint32Operations(); 4029 if (FLAG_opt_safe_uint32_operations) ComputeSafeUint32Operations();
4029 4030
4030 if (FLAG_use_canonicalizing) Canonicalize(); 4031 if (FLAG_use_canonicalizing) Canonicalize();
4031 4032
4033 if (FLAG_use_escape_analysis) {
4034 HEscapeAnalysis escape_analysis(this);
4035 escape_analysis.Analyze();
4036 }
4037
4032 if (FLAG_use_gvn) GlobalValueNumbering(); 4038 if (FLAG_use_gvn) GlobalValueNumbering();
4033 4039
4034 if (FLAG_use_range) { 4040 if (FLAG_use_range) {
4035 HRangeAnalysis rangeAnalysis(this); 4041 HRangeAnalysis range_analysis(this);
4036 rangeAnalysis.Analyze(); 4042 range_analysis.Analyze();
4037 } 4043 }
4038 ComputeMinusZeroChecks(); 4044 ComputeMinusZeroChecks();
4039 4045
4040 // Eliminate redundant stack checks on backwards branches. 4046 // Eliminate redundant stack checks on backwards branches.
4041 HStackCheckEliminator sce(this); 4047 HStackCheckEliminator sce(this);
4042 sce.Process(); 4048 sce.Process();
4043 4049
4044 if (FLAG_idefs) SetupInformativeDefinitions(); 4050 if (FLAG_idefs) SetupInformativeDefinitions();
4045 if (FLAG_array_bounds_checks_elimination && !FLAG_idefs) { 4051 if (FLAG_array_bounds_checks_elimination && !FLAG_idefs) {
4046 EliminateRedundantBoundsChecks(); 4052 EliminateRedundantBoundsChecks();
(...skipping 7507 matching lines...) Expand 10 before | Expand all | Expand 10 after
11554 if (ShouldProduceTraceOutput()) { 11560 if (ShouldProduceTraceOutput()) {
11555 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 11561 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
11556 } 11562 }
11557 11563
11558 #ifdef DEBUG 11564 #ifdef DEBUG
11559 graph_->Verify(false); // No full verify. 11565 graph_->Verify(false); // No full verify.
11560 #endif 11566 #endif
11561 } 11567 }
11562 11568
11563 } } // namespace v8::internal 11569 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-escape-analysis.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698