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

Side by Side Diff: src/compiler.cc

Issue 449012: Introduce flag for using the fast compiler where possible.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/flag-definitions.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // Signal a stack overflow by returning a null handle. The stack 117 // Signal a stack overflow by returning a null handle. The stack
118 // overflow exception will be thrown by the caller. 118 // overflow exception will be thrown by the caller.
119 return Handle<Code>::null(); 119 return Handle<Code>::null();
120 } 120 }
121 121
122 // Generate code and return it. 122 // Generate code and return it.
123 if (FLAG_fast_compiler) { 123 if (FLAG_fast_compiler) {
124 // If there is no shared function info, try the fast code 124 // If there is no shared function info, try the fast code
125 // generator for code in the global scope. Otherwise obey the 125 // generator for code in the global scope. Otherwise obey the
126 // explicit hint in the shared function info. 126 // explicit hint in the shared function info.
127 if (shared.is_null() && !literal->scope()->is_global_scope()) { 127 // If always_fast_compiler is true, always try the fast compiler.
128 if (shared.is_null() && !literal->scope()->is_global_scope() &&
Lasse Reichstein 2009/11/30 11:45:53 Does "shared.is_null()" have a special significanc
fschneider 2009/11/30 12:19:19 Good question. I'm not sure. As I understand the S
129 !FLAG_always_fast_compiler) {
128 if (FLAG_trace_bailout) PrintF("Non-global scope\n"); 130 if (FLAG_trace_bailout) PrintF("Non-global scope\n");
129 } else if (!shared.is_null() && !shared->try_fast_codegen()) { 131 } else if (!shared.is_null() && !shared->try_fast_codegen() &&
132 !FLAG_always_fast_compiler) {
130 if (FLAG_trace_bailout) PrintF("No hint to try fast\n"); 133 if (FLAG_trace_bailout) PrintF("No hint to try fast\n");
131 } else { 134 } else {
132 CodeGenSelector selector; 135 CodeGenSelector selector;
133 CodeGenSelector::CodeGenTag code_gen = selector.Select(literal); 136 CodeGenSelector::CodeGenTag code_gen = selector.Select(literal);
134 if (code_gen == CodeGenSelector::FAST) { 137 if (code_gen == CodeGenSelector::FAST) {
135 return FastCodeGenerator::MakeCode(literal, script, is_eval); 138 return FastCodeGenerator::MakeCode(literal, script, is_eval);
136 } 139 }
137 ASSERT(code_gen == CodeGenSelector::NORMAL); 140 ASSERT(code_gen == CodeGenSelector::NORMAL);
138 } 141 }
139 } 142 }
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 1118
1116 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { 1119 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) {
1117 BAILOUT("ThisFunction"); 1120 BAILOUT("ThisFunction");
1118 } 1121 }
1119 1122
1120 #undef BAILOUT 1123 #undef BAILOUT
1121 #undef CHECK_BAILOUT 1124 #undef CHECK_BAILOUT
1122 1125
1123 1126
1124 } } // namespace v8::internal 1127 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698