Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: src/heap.cc

Issue 8199004: Reimplement Function.prototype.bind. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/factory.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698