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/ast.cc

Issue 16549002: Add type field to AST expression nodes (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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.h ('k') | src/factory.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 return self.Union(body()->CaptureRegisters()); 785 return self.Union(body()->CaptureRegisters());
786 } 786 }
787 787
788 788
789 Interval RegExpQuantifier::CaptureRegisters() { 789 Interval RegExpQuantifier::CaptureRegisters() {
790 return body()->CaptureRegisters(); 790 return body()->CaptureRegisters();
791 } 791 }
792 792
793 793
794 bool RegExpAssertion::IsAnchoredAtStart() { 794 bool RegExpAssertion::IsAnchoredAtStart() {
795 return type() == RegExpAssertion::START_OF_INPUT; 795 return assertion_type() == RegExpAssertion::START_OF_INPUT;
796 } 796 }
797 797
798 798
799 bool RegExpAssertion::IsAnchoredAtEnd() { 799 bool RegExpAssertion::IsAnchoredAtEnd() {
800 return type() == RegExpAssertion::END_OF_INPUT; 800 return assertion_type() == RegExpAssertion::END_OF_INPUT;
801 } 801 }
802 802
803 803
804 bool RegExpAlternative::IsAnchoredAtStart() { 804 bool RegExpAlternative::IsAnchoredAtStart() {
805 ZoneList<RegExpTree*>* nodes = this->nodes(); 805 ZoneList<RegExpTree*>* nodes = this->nodes();
806 for (int i = 0; i < nodes->length(); i++) { 806 for (int i = 0; i < nodes->length(); i++) {
807 RegExpTree* node = nodes->at(i); 807 RegExpTree* node = nodes->at(i);
808 if (node->IsAnchoredAtStart()) { return true; } 808 if (node->IsAnchoredAtStart()) { return true; }
809 if (node->max_match() > 0) { return false; } 809 if (node->max_match() > 0) { return false; }
810 } 810 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 for (int i = 0; i < that->ranges(zone_)->length(); i++) { 922 for (int i = 0; i < that->ranges(zone_)->length(); i++) {
923 if (i > 0) stream()->Add(" "); 923 if (i > 0) stream()->Add(" ");
924 VisitCharacterRange(that->ranges(zone_)->at(i)); 924 VisitCharacterRange(that->ranges(zone_)->at(i));
925 } 925 }
926 stream()->Add("]"); 926 stream()->Add("]");
927 return NULL; 927 return NULL;
928 } 928 }
929 929
930 930
931 void* RegExpUnparser::VisitAssertion(RegExpAssertion* that, void* data) { 931 void* RegExpUnparser::VisitAssertion(RegExpAssertion* that, void* data) {
932 switch (that->type()) { 932 switch (that->assertion_type()) {
933 case RegExpAssertion::START_OF_INPUT: 933 case RegExpAssertion::START_OF_INPUT:
934 stream()->Add("@^i"); 934 stream()->Add("@^i");
935 break; 935 break;
936 case RegExpAssertion::END_OF_INPUT: 936 case RegExpAssertion::END_OF_INPUT:
937 stream()->Add("@$i"); 937 stream()->Add("@$i");
938 break; 938 break;
939 case RegExpAssertion::START_OF_LINE: 939 case RegExpAssertion::START_OF_LINE:
940 stream()->Add("@^l"); 940 stream()->Add("@^l");
941 break; 941 break;
942 case RegExpAssertion::END_OF_LINE: 942 case RegExpAssertion::END_OF_LINE:
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value()); 1194 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value());
1195 str = arr; 1195 str = arr;
1196 } else { 1196 } else {
1197 str = DoubleToCString(handle_->Number(), buffer); 1197 str = DoubleToCString(handle_->Number(), buffer);
1198 } 1198 }
1199 return factory->NewStringFromAscii(CStrVector(str)); 1199 return factory->NewStringFromAscii(CStrVector(str));
1200 } 1200 }
1201 1201
1202 1202
1203 } } // namespace v8::internal 1203 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698