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 3242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3253 void Heap::InitializeFunction(JSFunction* function, | 3253 void Heap::InitializeFunction(JSFunction* function, |
3254 SharedFunctionInfo* shared, | 3254 SharedFunctionInfo* shared, |
3255 Object* prototype) { | 3255 Object* prototype) { |
3256 ASSERT(!prototype->IsMap()); | 3256 ASSERT(!prototype->IsMap()); |
3257 function->initialize_properties(); | 3257 function->initialize_properties(); |
3258 function->initialize_elements(); | 3258 function->initialize_elements(); |
3259 function->set_shared(shared); | 3259 function->set_shared(shared); |
3260 function->set_code(shared->code()); | 3260 function->set_code(shared->code()); |
3261 function->set_prototype_or_initial_map(prototype); | 3261 function->set_prototype_or_initial_map(prototype); |
3262 function->set_context(undefined_value()); | 3262 function->set_context(undefined_value()); |
3263 function->set_literals(empty_fixed_array()); | 3263 function->set_literals_or_bindings(empty_fixed_array()); |
3264 function->set_next_function_link(undefined_value()); | 3264 function->set_next_function_link(undefined_value()); |
3265 } | 3265 } |
3266 | 3266 |
3267 | 3267 |
3268 MaybeObject* Heap::AllocateFunctionPrototype(JSFunction* function) { | 3268 MaybeObject* Heap::AllocateFunctionPrototype(JSFunction* function) { |
3269 // Allocate the prototype. Make sure to use the object function | 3269 // Allocate the prototype. Make sure to use the object function |
3270 // from the function's context, since the function can be from a | 3270 // from the function's context, since the function can be from a |
3271 // different context. | 3271 // different context. |
3272 JSFunction* object_function = | 3272 JSFunction* object_function = |
3273 function->context()->global_context()->object_function(); | 3273 function->context()->global_context()->object_function(); |
(...skipping 3119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6393 isolate_->heap()->store_buffer()->Compact(); | 6393 isolate_->heap()->store_buffer()->Compact(); |
6394 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); | 6394 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); |
6395 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { | 6395 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { |
6396 next = chunk->next_chunk(); | 6396 next = chunk->next_chunk(); |
6397 isolate_->memory_allocator()->Free(chunk); | 6397 isolate_->memory_allocator()->Free(chunk); |
6398 } | 6398 } |
6399 chunks_queued_for_free_ = NULL; | 6399 chunks_queued_for_free_ = NULL; |
6400 } | 6400 } |
6401 | 6401 |
6402 } } // namespace v8::internal | 6402 } } // namespace v8::internal |
OLD | NEW |