OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/regexp/regexp-parser.h" | 5 #include "src/regexp/regexp-parser.h" |
6 | 6 |
7 #include "src/char-predicates-inl.h" | 7 #include "src/char-predicates-inl.h" |
8 #include "src/factory.h" | 8 #include "src/factory.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } else { | 68 } else { |
69 return kEndMarker; | 69 return kEndMarker; |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 | 73 |
74 void RegExpParser::Advance() { | 74 void RegExpParser::Advance() { |
75 if (has_next()) { | 75 if (has_next()) { |
76 StackLimitCheck check(isolate()); | 76 StackLimitCheck check(isolate()); |
77 if (check.HasOverflowed()) { | 77 if (check.HasOverflowed()) { |
| 78 if (FLAG_abort_on_stack_overflow) FATAL("Aborting on stack overflow"); |
78 ReportError(CStrVector( | 79 ReportError(CStrVector( |
79 MessageTemplate::TemplateString(MessageTemplate::kStackOverflow))); | 80 MessageTemplate::TemplateString(MessageTemplate::kStackOverflow))); |
80 } else if (zone()->excess_allocation()) { | 81 } else if (zone()->excess_allocation()) { |
81 ReportError(CStrVector("Regular expression too large")); | 82 ReportError(CStrVector("Regular expression too large")); |
82 } else { | 83 } else { |
83 current_ = ReadNext<true>(); | 84 current_ = ReadNext<true>(); |
84 } | 85 } |
85 } else { | 86 } else { |
86 current_ = kEndMarker; | 87 current_ = kEndMarker; |
87 // Advance so that position() points to 1-after-the-last-character. This is | 88 // Advance so that position() points to 1-after-the-last-character. This is |
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1787 return false; | 1788 return false; |
1788 } | 1789 } |
1789 terms_.Add(new (zone()) RegExpQuantifier(min, max, quantifier_type, atom), | 1790 terms_.Add(new (zone()) RegExpQuantifier(min, max, quantifier_type, atom), |
1790 zone()); | 1791 zone()); |
1791 LAST(ADD_TERM); | 1792 LAST(ADD_TERM); |
1792 return true; | 1793 return true; |
1793 } | 1794 } |
1794 | 1795 |
1795 } // namespace internal | 1796 } // namespace internal |
1796 } // namespace v8 | 1797 } // namespace v8 |
OLD | NEW |