OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 6935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6946 ASSERT(obj->HasFastProperties()); | 6946 ASSERT(obj->HasFastProperties()); |
6947 | 6947 |
6948 return obj; | 6948 return obj; |
6949 } | 6949 } |
6950 | 6950 |
6951 | 6951 |
6952 // Init line_ends array with code positions of line ends inside script source | 6952 // Init line_ends array with code positions of line ends inside script source |
6953 void Script::InitLineEnds() { | 6953 void Script::InitLineEnds() { |
6954 if (!line_ends()->IsUndefined()) return; | 6954 if (!line_ends()->IsUndefined()) return; |
6955 | 6955 |
6956 if (source()->IsUndefined()) { | 6956 if (!source()->IsString()) { |
6957 set_line_ends(*(Factory::NewArrayLiteral(0))); | 6957 ASSERT(source()->IsUndefined()); |
| 6958 set_line_ends(*(Factory::NewJSArray(0))); |
6958 ASSERT(line_ends()->IsJSArray()); | 6959 ASSERT(line_ends()->IsJSArray()); |
6959 return; | 6960 return; |
6960 } | 6961 } |
6961 | 6962 |
6962 Handle<String> src(String::cast(source())); | 6963 Handle<String> src(String::cast(source())); |
6963 const int src_len = src->length(); | 6964 const int src_len = src->length(); |
6964 Handle<String> new_line = Factory::NewStringFromAscii(CStrVector("\n")); | 6965 Handle<String> new_line = Factory::NewStringFromAscii(CStrVector("\n")); |
6965 | 6966 |
6966 // Pass 1: Identify line count | 6967 // Pass 1: Identify line count |
6967 int line_count = 0; | 6968 int line_count = 0; |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7257 // No break point. | 7258 // No break point. |
7258 if (break_point_objects()->IsUndefined()) return 0; | 7259 if (break_point_objects()->IsUndefined()) return 0; |
7259 // Single beak point. | 7260 // Single beak point. |
7260 if (!break_point_objects()->IsFixedArray()) return 1; | 7261 if (!break_point_objects()->IsFixedArray()) return 1; |
7261 // Multiple break points. | 7262 // Multiple break points. |
7262 return FixedArray::cast(break_point_objects())->length(); | 7263 return FixedArray::cast(break_point_objects())->length(); |
7263 } | 7264 } |
7264 | 7265 |
7265 | 7266 |
7266 } } // namespace v8::internal | 7267 } } // namespace v8::internal |
OLD | NEW |