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

Side by Side Diff: src/compiler.h

Issue 5753005: Make closures optimizable by Crankshaft compiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Next round Created 9 years, 11 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/ast.cc ('k') | src/compiler.cc » ('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 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 return has_global_object() ? closure()->context()->global() : NULL; 107 return has_global_object() ? closure()->context()->global() : NULL;
108 } 108 }
109 109
110 // Accessors for the different compilation modes. 110 // Accessors for the different compilation modes.
111 bool IsOptimizing() const { return mode_ == OPTIMIZE; } 111 bool IsOptimizing() const { return mode_ == OPTIMIZE; }
112 bool IsOptimizable() const { return mode_ == BASE; } 112 bool IsOptimizable() const { return mode_ == BASE; }
113 void SetOptimizing(int osr_ast_id) { 113 void SetOptimizing(int osr_ast_id) {
114 SetMode(OPTIMIZE); 114 SetMode(OPTIMIZE);
115 osr_ast_id_ = osr_ast_id; 115 osr_ast_id_ = osr_ast_id;
116 } 116 }
117 void DisableOptimization() { SetMode(NONOPT); } 117 void DisableOptimization();
118 118
119 // Deoptimization support. 119 // Deoptimization support.
120 bool HasDeoptimizationSupport() const { return supports_deoptimization_; } 120 bool HasDeoptimizationSupport() const { return supports_deoptimization_; }
121 void EnableDeoptimizationSupport() { 121 void EnableDeoptimizationSupport() {
122 ASSERT(IsOptimizable()); 122 ASSERT(IsOptimizable());
123 supports_deoptimization_ = true; 123 supports_deoptimization_ = true;
124 } 124 }
125 125
126 // Determine whether or not we can adaptively optimize. 126 // Determine whether or not we can adaptively optimize.
127 bool AllowOptimize() { 127 bool AllowOptimize() {
128 return V8::UseCrankshaft() && 128 return V8::UseCrankshaft() && !closure_.is_null();
129 !closure_.is_null() &&
130 function_->AllowOptimize();
131 } 129 }
132 130
133 private: 131 private:
134 // Compilation mode. 132 // Compilation mode.
135 // BASE is generated by the full codegen, optionally prepared for bailouts. 133 // BASE is generated by the full codegen, optionally prepared for bailouts.
136 // OPTIMIZE is optimized code generated by the Hydrogen-based backend. 134 // OPTIMIZE is optimized code generated by the Hydrogen-based backend.
137 // NONOPT is generated by the full codegen or the classic backend 135 // NONOPT is generated by the full codegen or the classic backend
138 // and is not prepared for recompilation/bailouts. These functions 136 // and is not prepared for recompilation/bailouts. These functions
139 // are never recompiled. 137 // are never recompiled.
140 enum Mode { 138 enum Mode {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 FrameElement::ClearConstantList(); 265 FrameElement::ClearConstantList();
268 Result::ClearConstantList(); 266 Result::ClearConstantList();
269 } 267 }
270 } 268 }
271 }; 269 };
272 270
273 271
274 } } // namespace v8::internal 272 } } // namespace v8::internal
275 273
276 #endif // V8_COMPILER_H_ 274 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698