| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 } | 460 } |
| 461 | 461 |
| 462 | 462 |
| 463 // Init line_ends array with code positions of line ends inside script | 463 // Init line_ends array with code positions of line ends inside script |
| 464 // source. | 464 // source. |
| 465 void InitScriptLineEnds(Handle<Script> script) { | 465 void InitScriptLineEnds(Handle<Script> script) { |
| 466 if (!script->line_ends()->IsUndefined()) return; | 466 if (!script->line_ends()->IsUndefined()) return; |
| 467 | 467 |
| 468 if (!script->source()->IsString()) { | 468 if (!script->source()->IsString()) { |
| 469 ASSERT(script->source()->IsUndefined()); | 469 ASSERT(script->source()->IsUndefined()); |
| 470 script->set_line_ends(*(Factory::NewFixedArray(0))); | 470 Handle<FixedArray> empty = Factory::NewFixedArray(0); |
| 471 script->set_line_ends(*empty); |
| 471 ASSERT(script->line_ends()->IsFixedArray()); | 472 ASSERT(script->line_ends()->IsFixedArray()); |
| 472 return; | 473 return; |
| 473 } | 474 } |
| 474 | 475 |
| 475 Handle<String> src(String::cast(script->source())); | 476 Handle<String> src(String::cast(script->source())); |
| 476 | 477 |
| 477 Handle<FixedArray> array = CalculateLineEnds(src, true); | 478 Handle<FixedArray> array = CalculateLineEnds(src, true); |
| 478 | 479 |
| 479 script->set_line_ends(*array); | 480 script->set_line_ends(*array); |
| 480 ASSERT(script->line_ends()->IsFixedArray()); | 481 ASSERT(script->line_ends()->IsFixedArray()); |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 | 824 |
| 824 OptimizedObjectForAddingMultipleProperties:: | 825 OptimizedObjectForAddingMultipleProperties:: |
| 825 ~OptimizedObjectForAddingMultipleProperties() { | 826 ~OptimizedObjectForAddingMultipleProperties() { |
| 826 // Reoptimize the object to allow fast property access. | 827 // Reoptimize the object to allow fast property access. |
| 827 if (has_been_transformed_) { | 828 if (has_been_transformed_) { |
| 828 TransformToFastProperties(object_, unused_property_fields_); | 829 TransformToFastProperties(object_, unused_property_fields_); |
| 829 } | 830 } |
| 830 } | 831 } |
| 831 | 832 |
| 832 } } // namespace v8::internal | 833 } } // namespace v8::internal |
| OLD | NEW |