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

Side by Side Diff: src/compiler.cc

Issue 294021: Add support for global variable references in toplevel code. We use... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 2 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
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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 void CodeGenSelector::VisitSlot(Slot* expr) { 599 void CodeGenSelector::VisitSlot(Slot* expr) {
600 Slot::Type type = expr->type(); 600 Slot::Type type = expr->type();
601 if (type != Slot::PARAMETER && type != Slot::LOCAL) { 601 if (type != Slot::PARAMETER && type != Slot::LOCAL) {
602 BAILOUT("non-parameter/non-local slot reference"); 602 BAILOUT("non-parameter/non-local slot reference");
603 } 603 }
604 } 604 }
605 605
606 606
607 void CodeGenSelector::VisitVariableProxy(VariableProxy* expr) { 607 void CodeGenSelector::VisitVariableProxy(VariableProxy* expr) {
608 Expression* rewrite = expr->var()->rewrite(); 608 Expression* rewrite = expr->var()->rewrite();
609 if (rewrite == NULL) BAILOUT("global variable reference"); 609 if (rewrite != NULL) Visit(rewrite);
610 Visit(rewrite);
611 } 610 }
612 611
613 612
614 void CodeGenSelector::VisitLiteral(Literal* expr) { 613 void CodeGenSelector::VisitLiteral(Literal* expr) {
615 // All literals are supported. 614 // All literals are supported.
616 expr->set_location(Location::Constant()); 615 expr->set_location(Location::Constant());
617 } 616 }
618 617
619 618
620 void CodeGenSelector::VisitRegExpLiteral(RegExpLiteral* expr) { 619 void CodeGenSelector::VisitRegExpLiteral(RegExpLiteral* expr) {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 709
711 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) { 710 void CodeGenSelector::VisitThisFunction(ThisFunction* expr) {
712 BAILOUT("ThisFunction"); 711 BAILOUT("ThisFunction");
713 } 712 }
714 713
715 #undef BAILOUT 714 #undef BAILOUT
716 #undef CHECK_BAILOUT 715 #undef CHECK_BAILOUT
717 716
718 717
719 } } // namespace v8::internal 718 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698