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

Side by Side Diff: src/heap.cc

Issue 14846017: Becuase of cross-context calls, hydrogen-based Array constructor needs to ensure (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Enable optimize_constructed_arrays Created 7 years, 7 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/flag-definitions.h ('k') | src/hydrogen.h » ('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 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 4322 matching lines...) Expand 10 before | Expand all | Expand 10 after
4333 // Allocate the object based on the constructors initial map, or the payload 4333 // Allocate the object based on the constructors initial map, or the payload
4334 // advice 4334 // advice
4335 Map* initial_map = constructor->initial_map(); 4335 Map* initial_map = constructor->initial_map();
4336 4336
4337 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast( 4337 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(
4338 *allocation_site_info_payload); 4338 *allocation_site_info_payload);
4339 Smi* smi = Smi::cast(cell->value()); 4339 Smi* smi = Smi::cast(cell->value());
4340 ElementsKind to_kind = static_cast<ElementsKind>(smi->value()); 4340 ElementsKind to_kind = static_cast<ElementsKind>(smi->value());
4341 AllocationSiteMode mode = TRACK_ALLOCATION_SITE; 4341 AllocationSiteMode mode = TRACK_ALLOCATION_SITE;
4342 if (to_kind != initial_map->elements_kind()) { 4342 if (to_kind != initial_map->elements_kind()) {
4343 MaybeObject* maybe_new_map = constructor->GetElementsTransitionMap( 4343 MaybeObject* maybe_new_map = initial_map->AsElementsKind(to_kind);
4344 isolate(), to_kind);
4345 if (!maybe_new_map->To(&initial_map)) return maybe_new_map; 4344 if (!maybe_new_map->To(&initial_map)) return maybe_new_map;
4346 // Possibly alter the mode, since we found an updated elements kind 4345 // Possibly alter the mode, since we found an updated elements kind
4347 // in the type info cell. 4346 // in the type info cell.
4348 mode = AllocationSiteInfo::GetMode(to_kind); 4347 mode = AllocationSiteInfo::GetMode(to_kind);
4349 } 4348 }
4350 4349
4351 MaybeObject* result; 4350 MaybeObject* result;
4352 if (mode == TRACK_ALLOCATION_SITE) { 4351 if (mode == TRACK_ALLOCATION_SITE) {
4353 result = AllocateJSObjectFromMapWithAllocationSite(initial_map, 4352 result = AllocateJSObjectFromMapWithAllocationSite(initial_map,
4354 allocation_site_info_payload); 4353 allocation_site_info_payload);
(...skipping 3532 matching lines...) Expand 10 before | Expand all | Expand 10 after
7887 if (FLAG_parallel_recompilation) { 7886 if (FLAG_parallel_recompilation) {
7888 heap_->relocation_mutex_->Lock(); 7887 heap_->relocation_mutex_->Lock();
7889 #ifdef DEBUG 7888 #ifdef DEBUG
7890 heap_->relocation_mutex_locked_by_optimizer_thread_ = 7889 heap_->relocation_mutex_locked_by_optimizer_thread_ =
7891 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 7890 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
7892 #endif // DEBUG 7891 #endif // DEBUG
7893 } 7892 }
7894 } 7893 }
7895 7894
7896 } } // namespace v8::internal 7895 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698