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

Side by Side Diff: src/rewriter.cc

Issue 722001: Add IsStackAllocated helper for variables. (Closed)
Patch Set: Created 10 years, 9 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
« no previous file with comments | « src/data-flow.cc ('k') | src/variables.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 } else if (node->type()->IsLikelySmi()) { 239 } else if (node->type()->IsLikelySmi()) {
240 var->type()->SetAsLikelySmi(); 240 var->type()->SetAsLikelySmi();
241 } 241 }
242 242
243 if (!var->is_this() && 243 if (!var->is_this() &&
244 !Heap::result_symbol()->Equals(*var->name())) { 244 !Heap::result_symbol()->Equals(*var->name())) {
245 func_name_inferrer_.PushName(var->name()); 245 func_name_inferrer_.PushName(var->name());
246 } 246 }
247 247
248 if (FLAG_safe_int32_compiler) { 248 if (FLAG_safe_int32_compiler) {
249 Slot* slot = var->slot(); 249 if (var->IsStackAllocated() && !var->is_arguments()) {
250 if (slot != NULL) { 250 node->set_side_effect_free(true);
251 node->set_side_effect_free(
252 (slot->type() == Slot::LOCAL && !slot->is_arguments()) ||
253 slot->type() == Slot::PARAMETER);
254 } 251 }
255 } 252 }
256 } 253 }
257 } 254 }
258 255
259 256
260 void AstOptimizer::VisitLiteral(Literal* node) { 257 void AstOptimizer::VisitLiteral(Literal* node) {
261 Handle<Object> literal = node->handle(); 258 Handle<Object> literal = node->handle();
262 if (literal->IsSmi()) { 259 if (literal->IsSmi()) {
263 node->type()->SetAsLikelySmi(); 260 node->type()->SetAsLikelySmi();
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 optimizer.Optimize(body); 904 optimizer.Optimize(body);
908 if (optimizer.HasStackOverflow()) { 905 if (optimizer.HasStackOverflow()) {
909 return false; 906 return false;
910 } 907 }
911 } 908 }
912 return true; 909 return true;
913 } 910 }
914 911
915 912
916 } } // namespace v8::internal 913 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/data-flow.cc ('k') | src/variables.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698