OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/ast/ast-expression-rewriter.h" | 10 #include "src/ast/ast-expression-rewriter.h" |
(...skipping 3829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3840 } | 3840 } |
3841 | 3841 |
3842 std::unique_ptr<Utf16CharacterStream> stream; | 3842 std::unique_ptr<Utf16CharacterStream> stream; |
3843 Utf16CharacterStream* stream_ptr; | 3843 Utf16CharacterStream* stream_ptr; |
3844 if (info->character_stream()) { | 3844 if (info->character_stream()) { |
3845 DCHECK(info->source_stream() == nullptr); | 3845 DCHECK(info->source_stream() == nullptr); |
3846 stream_ptr = info->character_stream(); | 3846 stream_ptr = info->character_stream(); |
3847 } else { | 3847 } else { |
3848 DCHECK(info->character_stream() == nullptr); | 3848 DCHECK(info->character_stream() == nullptr); |
3849 stream.reset(ScannerStream::For(info->source_stream(), | 3849 stream.reset(ScannerStream::For(info->source_stream(), |
3850 info->source_stream_encoding())); | 3850 info->source_stream_encoding(), |
| 3851 runtime_call_stats_)); |
3851 stream_ptr = stream.get(); | 3852 stream_ptr = stream.get(); |
3852 } | 3853 } |
3853 DCHECK(info->maybe_outer_scope_info().is_null()); | 3854 DCHECK(info->maybe_outer_scope_info().is_null()); |
3854 | 3855 |
3855 DCHECK(original_scope_); | 3856 DCHECK(original_scope_); |
3856 | 3857 |
3857 // When streaming, we don't know the length of the source until we have parsed | 3858 // When streaming, we don't know the length of the source until we have parsed |
3858 // it. The raw data can be UTF-8, so we wouldn't know the source length until | 3859 // it. The raw data can be UTF-8, so we wouldn't know the source length until |
3859 // we have decoded it anyway even if we knew the raw data length (which we | 3860 // we have decoded it anyway even if we knew the raw data length (which we |
3860 // don't). We work around this by storing all the scopes which need their end | 3861 // don't). We work around this by storing all the scopes which need their end |
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5475 | 5476 |
5476 return final_loop; | 5477 return final_loop; |
5477 } | 5478 } |
5478 | 5479 |
5479 #undef CHECK_OK | 5480 #undef CHECK_OK |
5480 #undef CHECK_OK_VOID | 5481 #undef CHECK_OK_VOID |
5481 #undef CHECK_FAILED | 5482 #undef CHECK_FAILED |
5482 | 5483 |
5483 } // namespace internal | 5484 } // namespace internal |
5484 } // namespace v8 | 5485 } // namespace v8 |
OLD | NEW |