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 3251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3262 void Heap::InitializeFunction(JSFunction* function, | 3262 void Heap::InitializeFunction(JSFunction* function, |
3263 SharedFunctionInfo* shared, | 3263 SharedFunctionInfo* shared, |
3264 Object* prototype) { | 3264 Object* prototype) { |
3265 ASSERT(!prototype->IsMap()); | 3265 ASSERT(!prototype->IsMap()); |
3266 function->initialize_properties(); | 3266 function->initialize_properties(); |
3267 function->initialize_elements(); | 3267 function->initialize_elements(); |
3268 function->set_shared(shared); | 3268 function->set_shared(shared); |
3269 function->set_code(shared->code()); | 3269 function->set_code(shared->code()); |
3270 function->set_prototype_or_initial_map(prototype); | 3270 function->set_prototype_or_initial_map(prototype); |
3271 function->set_context(undefined_value()); | 3271 function->set_context(undefined_value()); |
3272 function->set_literals(empty_fixed_array()); | 3272 function->set_literals_or_bindings(empty_fixed_array()); |
3273 function->set_next_function_link(undefined_value()); | 3273 function->set_next_function_link(undefined_value()); |
3274 } | 3274 } |
3275 | 3275 |
3276 | 3276 |
3277 MaybeObject* Heap::AllocateFunctionPrototype(JSFunction* function) { | 3277 MaybeObject* Heap::AllocateFunctionPrototype(JSFunction* function) { |
3278 // Allocate the prototype. Make sure to use the object function | 3278 // Allocate the prototype. Make sure to use the object function |
3279 // from the function's context, since the function can be from a | 3279 // from the function's context, since the function can be from a |
3280 // different context. | 3280 // different context. |
3281 JSFunction* object_function = | 3281 JSFunction* object_function = |
3282 function->context()->global_context()->object_function(); | 3282 function->context()->global_context()->object_function(); |
(...skipping 3123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6406 isolate_->heap()->store_buffer()->Compact(); | 6406 isolate_->heap()->store_buffer()->Compact(); |
6407 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); | 6407 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); |
6408 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { | 6408 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { |
6409 next = chunk->next_chunk(); | 6409 next = chunk->next_chunk(); |
6410 isolate_->memory_allocator()->Free(chunk); | 6410 isolate_->memory_allocator()->Free(chunk); |
6411 } | 6411 } |
6412 chunks_queued_for_free_ = NULL; | 6412 chunks_queued_for_free_ = NULL; |
6413 } | 6413 } |
6414 | 6414 |
6415 } } // namespace v8::internal | 6415 } } // namespace v8::internal |
OLD | NEW |