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

Side by Side Diff: src/scopes.cc

Issue 6286144: Do not compile the unreachable body of functions with illegal redeclarations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build/ia32
Patch Set: Created 9 years, 10 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/ia32/full-codegen-ia32.cc ('k') | no next file » | 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 return var; 376 return var;
377 } 377 }
378 378
379 379
380 void Scope::AddDeclaration(Declaration* declaration) { 380 void Scope::AddDeclaration(Declaration* declaration) {
381 decls_.Add(declaration); 381 decls_.Add(declaration);
382 } 382 }
383 383
384 384
385 void Scope::SetIllegalRedeclaration(Expression* expression) { 385 void Scope::SetIllegalRedeclaration(Expression* expression) {
386 // Only set the illegal redeclaration expression the 386 // Record only the first illegal redeclaration.
387 // first time the function is called.
388 if (!HasIllegalRedeclaration()) { 387 if (!HasIllegalRedeclaration()) {
389 illegal_redecl_ = expression; 388 illegal_redecl_ = expression;
390 } 389 }
391 ASSERT(HasIllegalRedeclaration()); 390 ASSERT(HasIllegalRedeclaration());
392 } 391 }
393 392
394 393
395 void Scope::VisitIllegalRedeclaration(AstVisitor* visitor) { 394 void Scope::VisitIllegalRedeclaration(AstVisitor* visitor) {
396 ASSERT(HasIllegalRedeclaration()); 395 ASSERT(HasIllegalRedeclaration());
397 illegal_redecl_->Accept(visitor); 396 illegal_redecl_->Accept(visitor);
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && 1054 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS &&
1056 !must_have_local_context) { 1055 !must_have_local_context) {
1057 num_heap_slots_ = 0; 1056 num_heap_slots_ = 0;
1058 } 1057 }
1059 1058
1060 // Allocation done. 1059 // Allocation done.
1061 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); 1060 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS);
1062 } 1061 }
1063 1062
1064 } } // namespace v8::internal 1063 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698