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

Side by Side Diff: src/allocation-tracker.cc

Issue 1074943002: Split TemplateHashMapImpl::Lookup into two methods (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm (and ppc) builds Created 5 years, 8 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
« no previous file with comments | « no previous file | src/arm/simulator-arm.cc » ('j') | src/hashmap.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/allocation-tracker.h" 7 #include "src/allocation-tracker.h"
8 #include "src/frames-inl.h" 8 #include "src/frames-inl.h"
9 #include "src/heap-snapshot-generator.h" 9 #include "src/heap-snapshot-generator.h"
10 10
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 255
256 256
257 static uint32_t SnapshotObjectIdHash(SnapshotObjectId id) { 257 static uint32_t SnapshotObjectIdHash(SnapshotObjectId id) {
258 return ComputeIntegerHash(static_cast<uint32_t>(id), 258 return ComputeIntegerHash(static_cast<uint32_t>(id),
259 v8::internal::kZeroHashSeed); 259 v8::internal::kZeroHashSeed);
260 } 260 }
261 261
262 262
263 unsigned AllocationTracker::AddFunctionInfo(SharedFunctionInfo* shared, 263 unsigned AllocationTracker::AddFunctionInfo(SharedFunctionInfo* shared,
264 SnapshotObjectId id) { 264 SnapshotObjectId id) {
265 HashMap::Entry* entry = id_to_function_info_index_.Lookup( 265 HashMap::Entry* entry = id_to_function_info_index_.LookupOrInsert(
266 reinterpret_cast<void*>(id), SnapshotObjectIdHash(id), true); 266 reinterpret_cast<void*>(id), SnapshotObjectIdHash(id));
267 if (entry->value == NULL) { 267 if (entry->value == NULL) {
268 FunctionInfo* info = new FunctionInfo(); 268 FunctionInfo* info = new FunctionInfo();
269 info->name = names_->GetFunctionName(shared->DebugName()); 269 info->name = names_->GetFunctionName(shared->DebugName());
270 info->function_id = id; 270 info->function_id = id;
271 if (shared->script()->IsScript()) { 271 if (shared->script()->IsScript()) {
272 Script* script = Script::cast(shared->script()); 272 Script* script = Script::cast(shared->script());
273 if (script->name()->IsName()) { 273 if (script->name()->IsName()) {
274 Name* name = Name::cast(script->name()); 274 Name* name = Name::cast(script->name());
275 info->script_name = names_->GetName(name); 275 info->script_name = names_->GetName(name);
276 } 276 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 void AllocationTracker::UnresolvedLocation::HandleWeakScript( 331 void AllocationTracker::UnresolvedLocation::HandleWeakScript(
332 const v8::WeakCallbackData<v8::Value, void>& data) { 332 const v8::WeakCallbackData<v8::Value, void>& data) {
333 UnresolvedLocation* loc = 333 UnresolvedLocation* loc =
334 reinterpret_cast<UnresolvedLocation*>(data.GetParameter()); 334 reinterpret_cast<UnresolvedLocation*>(data.GetParameter());
335 GlobalHandles::Destroy(reinterpret_cast<Object**>(loc->script_.location())); 335 GlobalHandles::Destroy(reinterpret_cast<Object**>(loc->script_.location()));
336 loc->script_ = Handle<Script>::null(); 336 loc->script_ = Handle<Script>::null();
337 } 337 }
338 338
339 339
340 } } // namespace v8::internal 340 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/arm/simulator-arm.cc » ('j') | src/hashmap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698