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 6784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6795 } | 6795 } |
6796 | 6796 |
6797 // If the script does not end with a line ending add the final end position | 6797 // If the script does not end with a line ending add the final end position |
6798 // as just past the last line ending. | 6798 // as just past the last line ending. |
6799 if (array_index == 0 || | 6799 if (array_index == 0 || |
6800 (Smi::cast(array->GetElement(array_index - 1))->value() != src_len - 1)) { | 6800 (Smi::cast(array->GetElement(array_index - 1))->value() != src_len - 1)) { |
6801 SetElement(array, array_index++, Handle<Smi>(Smi::FromInt(src_len))); | 6801 SetElement(array, array_index++, Handle<Smi>(Smi::FromInt(src_len))); |
6802 } | 6802 } |
6803 | 6803 |
6804 Handle<FixedArray> fixed_array = Factory::NewFixedArray(0); | 6804 Handle<FixedArray> fixed_array = Factory::NewFixedArray(0); |
6805 set_line_ends(fixed_array->AddKeysFromJSArray(*array)); | 6805 set_line_ends(*AddKeysFromJSArray(fixed_array, array)); |
6806 ASSERT(line_ends()->IsFixedArray()); | 6806 ASSERT(line_ends()->IsFixedArray()); |
6807 } | 6807 } |
6808 | 6808 |
6809 | 6809 |
6810 // Convert code position into line number | 6810 // Convert code position into line number |
6811 int Script::GetLineNumber(int code_pos) { | 6811 int Script::GetLineNumber(int code_pos) { |
6812 InitLineEnds(); | 6812 InitLineEnds(); |
6813 FixedArray* line_ends_array = FixedArray::cast(line_ends()); | 6813 FixedArray* line_ends_array = FixedArray::cast(line_ends()); |
6814 | 6814 |
6815 int line = -1; | 6815 int line = -1; |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7069 // No break point. | 7069 // No break point. |
7070 if (break_point_objects()->IsUndefined()) return 0; | 7070 if (break_point_objects()->IsUndefined()) return 0; |
7071 // Single beak point. | 7071 // Single beak point. |
7072 if (!break_point_objects()->IsFixedArray()) return 1; | 7072 if (!break_point_objects()->IsFixedArray()) return 1; |
7073 // Multiple break points. | 7073 // Multiple break points. |
7074 return FixedArray::cast(break_point_objects())->length(); | 7074 return FixedArray::cast(break_point_objects())->length(); |
7075 } | 7075 } |
7076 | 7076 |
7077 | 7077 |
7078 } } // namespace v8::internal | 7078 } } // namespace v8::internal |
OLD | NEW |