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