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

Side by Side Diff: src/heap.cc

Issue 9050001: Ensure newly allocated empty Arrays are transitioned to FAST_ELEMENT (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix existing and add new tests Created 8 years, 11 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
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 4416 matching lines...) Expand 10 before | Expand all | Expand 10 after
4427 4427
4428 4428
4429 MaybeObject* Heap::AllocateGlobalContext() { 4429 MaybeObject* Heap::AllocateGlobalContext() {
4430 Object* result; 4430 Object* result;
4431 { MaybeObject* maybe_result = 4431 { MaybeObject* maybe_result =
4432 AllocateFixedArray(Context::GLOBAL_CONTEXT_SLOTS); 4432 AllocateFixedArray(Context::GLOBAL_CONTEXT_SLOTS);
4433 if (!maybe_result->ToObject(&result)) return maybe_result; 4433 if (!maybe_result->ToObject(&result)) return maybe_result;
4434 } 4434 }
4435 Context* context = reinterpret_cast<Context*>(result); 4435 Context* context = reinterpret_cast<Context*>(result);
4436 context->set_map_no_write_barrier(global_context_map()); 4436 context->set_map_no_write_barrier(global_context_map());
4437 context->set_fast_array_element_bias(undefined_value());
4438 context->set_untransitioned_js_array_map(undefined_value());
4437 ASSERT(context->IsGlobalContext()); 4439 ASSERT(context->IsGlobalContext());
4438 ASSERT(result->IsContext()); 4440 ASSERT(result->IsContext());
4439 return result; 4441 return result;
4440 } 4442 }
4441 4443
4442 4444
4443 MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) { 4445 MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) {
4444 ASSERT(length >= Context::MIN_CONTEXT_SLOTS); 4446 ASSERT(length >= Context::MIN_CONTEXT_SLOTS);
4445 Object* result; 4447 Object* result;
4446 { MaybeObject* maybe_result = AllocateFixedArray(length); 4448 { MaybeObject* maybe_result = AllocateFixedArray(length);
(...skipping 2156 matching lines...) Expand 10 before | Expand all | Expand 10 after
6603 isolate_->heap()->store_buffer()->Compact(); 6605 isolate_->heap()->store_buffer()->Compact();
6604 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); 6606 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED);
6605 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { 6607 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) {
6606 next = chunk->next_chunk(); 6608 next = chunk->next_chunk();
6607 isolate_->memory_allocator()->Free(chunk); 6609 isolate_->memory_allocator()->Free(chunk);
6608 } 6610 }
6609 chunks_queued_for_free_ = NULL; 6611 chunks_queued_for_free_ = NULL;
6610 } 6612 }
6611 6613
6612 } } // namespace v8::internal 6614 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698