OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 bool with_last_line) { | 610 bool with_last_line) { |
611 src = FlattenGetString(src); | 611 src = FlattenGetString(src); |
612 // Rough estimate of line count based on a roughly estimated average | 612 // Rough estimate of line count based on a roughly estimated average |
613 // length of (unpacked) code. | 613 // length of (unpacked) code. |
614 int line_count_estimate = src->length() >> 4; | 614 int line_count_estimate = src->length() >> 4; |
615 List<int> line_ends(line_count_estimate); | 615 List<int> line_ends(line_count_estimate); |
616 Isolate* isolate = src->GetIsolate(); | 616 Isolate* isolate = src->GetIsolate(); |
617 { | 617 { |
618 AssertNoAllocation no_heap_allocation; // ensure vectors stay valid. | 618 AssertNoAllocation no_heap_allocation; // ensure vectors stay valid. |
619 // Dispatch on type of strings. | 619 // Dispatch on type of strings. |
620 String::FlatContent content = src->GetFlatContent(no_heap_allocation); | 620 String::FlatContent content = src->GetFlatContent(); |
621 ASSERT(content.IsFlat()); | 621 ASSERT(content.IsFlat()); |
622 if (content.IsAscii()) { | 622 if (content.IsAscii()) { |
623 CalculateLineEnds(isolate, | 623 CalculateLineEnds(isolate, |
624 &line_ends, | 624 &line_ends, |
625 content.ToAsciiVector(), | 625 content.ToAsciiVector(), |
626 with_last_line); | 626 with_last_line); |
627 } else { | 627 } else { |
628 CalculateLineEnds(isolate, | 628 CalculateLineEnds(isolate, |
629 &line_ends, | 629 &line_ends, |
630 content.ToUC16Vector(), | 630 content.ToUC16Vector(), |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 | 952 |
953 bool CompileOptimized(Handle<JSFunction> function, | 953 bool CompileOptimized(Handle<JSFunction> function, |
954 int osr_ast_id, | 954 int osr_ast_id, |
955 ClearExceptionFlag flag) { | 955 ClearExceptionFlag flag) { |
956 CompilationInfo info(function); | 956 CompilationInfo info(function); |
957 info.SetOptimizing(osr_ast_id); | 957 info.SetOptimizing(osr_ast_id); |
958 return CompileLazyHelper(&info, flag); | 958 return CompileLazyHelper(&info, flag); |
959 } | 959 } |
960 | 960 |
961 } } // namespace v8::internal | 961 } } // namespace v8::internal |
OLD | NEW |