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 3828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3839 maybe = LookupAsciiSymbol("<freezing call trap>"); | 3839 maybe = LookupAsciiSymbol("<freezing call trap>"); |
3840 if (!maybe->To<String>(&name)) return maybe; | 3840 if (!maybe->To<String>(&name)) return maybe; |
3841 maybe = AllocateSharedFunctionInfo(name); | 3841 maybe = AllocateSharedFunctionInfo(name); |
3842 if (!maybe->To<SharedFunctionInfo>(&shared)) return maybe; | 3842 if (!maybe->To<SharedFunctionInfo>(&shared)) return maybe; |
3843 } | 3843 } |
3844 | 3844 |
3845 // Because of possible retries of this function after failure, | 3845 // Because of possible retries of this function after failure, |
3846 // we must NOT fail after this point, where we have changed the type! | 3846 // we must NOT fail after this point, where we have changed the type! |
3847 | 3847 |
3848 // Reset the map for the object. | 3848 // Reset the map for the object. |
3849 object->set_map_unsafe(map); | 3849 object->set_map(map); |
3850 JSObject* jsobj = JSObject::cast(object); | 3850 JSObject* jsobj = JSObject::cast(object); |
3851 | 3851 |
3852 // Reinitialize the object from the constructor map. | 3852 // Reinitialize the object from the constructor map. |
3853 InitializeJSObjectFromMap(jsobj, FixedArray::cast(properties), map); | 3853 InitializeJSObjectFromMap(jsobj, FixedArray::cast(properties), map); |
3854 | 3854 |
3855 // Functions require some minimal initialization. | 3855 // Functions require some minimal initialization. |
3856 if (type == JS_FUNCTION_TYPE) { | 3856 if (type == JS_FUNCTION_TYPE) { |
3857 map->set_function_with_prototype(true); | 3857 map->set_function_with_prototype(true); |
3858 InitializeFunction(JSFunction::cast(object), shared, the_hole_value()); | 3858 InitializeFunction(JSFunction::cast(object), shared, the_hole_value()); |
3859 JSFunction::cast(object)->set_context( | 3859 JSFunction::cast(object)->set_context( |
(...skipping 2598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6458 isolate_->heap()->store_buffer()->Compact(); | 6458 isolate_->heap()->store_buffer()->Compact(); |
6459 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); | 6459 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); |
6460 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { | 6460 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { |
6461 next = chunk->next_chunk(); | 6461 next = chunk->next_chunk(); |
6462 isolate_->memory_allocator()->Free(chunk); | 6462 isolate_->memory_allocator()->Free(chunk); |
6463 } | 6463 } |
6464 chunks_queued_for_free_ = NULL; | 6464 chunks_queued_for_free_ = NULL; |
6465 } | 6465 } |
6466 | 6466 |
6467 } } // namespace v8::internal | 6467 } } // namespace v8::internal |
OLD | NEW |