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

Side by Side Diff: src/heap.cc

Issue 55933002: Inline array constructor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Even better codegen for 1 arg case, and refactoring. Created 7 years, 1 month 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 | « no previous file | src/hydrogen.h » ('j') | src/hydrogen.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 4567 matching lines...) Expand 10 before | Expand all | Expand 10 after
4578 } 4578 }
4579 4579
4580 4580
4581 MaybeObject* Heap::AllocateJSObjectWithAllocationSite(JSFunction* constructor, 4581 MaybeObject* Heap::AllocateJSObjectWithAllocationSite(JSFunction* constructor,
4582 Handle<AllocationSite> allocation_site) { 4582 Handle<AllocationSite> allocation_site) {
4583 ASSERT(constructor->has_initial_map()); 4583 ASSERT(constructor->has_initial_map());
4584 // Allocate the object based on the constructors initial map, or the payload 4584 // Allocate the object based on the constructors initial map, or the payload
4585 // advice 4585 // advice
4586 Map* initial_map = constructor->initial_map(); 4586 Map* initial_map = constructor->initial_map();
4587 4587
4588 Smi* smi = Smi::cast(allocation_site->transition_info()); 4588 ElementsKind to_kind = allocation_site->GetElementsKind();
4589 ElementsKind to_kind = static_cast<ElementsKind>(smi->value());
4590 AllocationSiteMode mode = TRACK_ALLOCATION_SITE; 4589 AllocationSiteMode mode = TRACK_ALLOCATION_SITE;
4591 if (to_kind != initial_map->elements_kind()) { 4590 if (to_kind != initial_map->elements_kind()) {
4592 MaybeObject* maybe_new_map = initial_map->AsElementsKind(to_kind); 4591 MaybeObject* maybe_new_map = initial_map->AsElementsKind(to_kind);
4593 if (!maybe_new_map->To(&initial_map)) return maybe_new_map; 4592 if (!maybe_new_map->To(&initial_map)) return maybe_new_map;
4594 // Possibly alter the mode, since we found an updated elements kind 4593 // Possibly alter the mode, since we found an updated elements kind
4595 // in the type info cell. 4594 // in the type info cell.
4596 mode = AllocationSite::GetMode(to_kind); 4595 mode = AllocationSite::GetMode(to_kind);
4597 } 4596 }
4598 4597
4599 MaybeObject* result; 4598 MaybeObject* result;
(...skipping 3304 matching lines...) Expand 10 before | Expand all | Expand 10 after
7904 if (FLAG_concurrent_recompilation) { 7903 if (FLAG_concurrent_recompilation) {
7905 heap_->relocation_mutex_->Lock(); 7904 heap_->relocation_mutex_->Lock();
7906 #ifdef DEBUG 7905 #ifdef DEBUG
7907 heap_->relocation_mutex_locked_by_optimizer_thread_ = 7906 heap_->relocation_mutex_locked_by_optimizer_thread_ =
7908 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 7907 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
7909 #endif // DEBUG 7908 #endif // DEBUG
7910 } 7909 }
7911 } 7910 }
7912 7911
7913 } } // namespace v8::internal 7912 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.h » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698