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

Side by Side Diff: src/profile-generator.cc

Issue 10779012: Removing LookupTransition from LookupRealNamedProperty and related utility functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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/objects.cc ('k') | src/runtime.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 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 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after
2293 Heap* heap = object->GetHeap(); 2293 Heap* heap = object->GetHeap();
2294 if (object->IsJSFunction()) return heap->closure_symbol(); 2294 if (object->IsJSFunction()) return heap->closure_symbol();
2295 String* constructor_name = object->constructor_name(); 2295 String* constructor_name = object->constructor_name();
2296 if (constructor_name == heap->Object_symbol()) { 2296 if (constructor_name == heap->Object_symbol()) {
2297 // Look up an immediate "constructor" property, if it is a function, 2297 // Look up an immediate "constructor" property, if it is a function,
2298 // return its name. This is for instances of binding objects, which 2298 // return its name. This is for instances of binding objects, which
2299 // have prototype constructor type "Object". 2299 // have prototype constructor type "Object".
2300 Object* constructor_prop = NULL; 2300 Object* constructor_prop = NULL;
2301 LookupResult result(heap->isolate()); 2301 LookupResult result(heap->isolate());
2302 object->LocalLookupRealNamedProperty(heap->constructor_symbol(), &result); 2302 object->LocalLookupRealNamedProperty(heap->constructor_symbol(), &result);
2303 if (result.IsProperty()) { 2303 if (!result.IsFound()) return object->constructor_name();
2304 constructor_prop = result.GetLazyValue(); 2304
2305 } 2305 constructor_prop = result.GetLazyValue();
2306 if (constructor_prop->IsJSFunction()) { 2306 if (constructor_prop->IsJSFunction()) {
2307 Object* maybe_name = JSFunction::cast(constructor_prop)->shared()->name(); 2307 Object* maybe_name =
2308 JSFunction::cast(constructor_prop)->shared()->name();
2308 if (maybe_name->IsString()) { 2309 if (maybe_name->IsString()) {
2309 String* name = String::cast(maybe_name); 2310 String* name = String::cast(maybe_name);
2310 if (name->length() > 0) return name; 2311 if (name->length() > 0) return name;
2311 } 2312 }
2312 } 2313 }
2313 } 2314 }
2314 return object->constructor_name(); 2315 return object->constructor_name();
2315 } 2316 }
2316 2317
2317 2318
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after
3567 3568
3568 3569
3569 void HeapSnapshotJSONSerializer::SortHashMap( 3570 void HeapSnapshotJSONSerializer::SortHashMap(
3570 HashMap* map, List<HashMap::Entry*>* sorted_entries) { 3571 HashMap* map, List<HashMap::Entry*>* sorted_entries) {
3571 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) 3572 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
3572 sorted_entries->Add(p); 3573 sorted_entries->Add(p);
3573 sorted_entries->Sort(SortUsingEntryValue); 3574 sorted_entries->Sort(SortUsingEntryValue);
3574 } 3575 }
3575 3576
3576 } } // namespace v8::internal 3577 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698