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

Side by Side Diff: src/objects.cc

Issue 141046: Added descriptor lookup cache to eliminate some search overhead.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 6 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/heap.cc ('k') | src/objects-inl.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after
1558 return FixedArray::cast(element)->get(kSetterIndex); 1558 return FixedArray::cast(element)->get(kSetterIndex);
1559 } 1559 }
1560 } 1560 }
1561 } 1561 }
1562 return Heap::undefined_value(); 1562 return Heap::undefined_value();
1563 } 1563 }
1564 1564
1565 1565
1566 void JSObject::LookupInDescriptor(String* name, LookupResult* result) { 1566 void JSObject::LookupInDescriptor(String* name, LookupResult* result) {
1567 DescriptorArray* descriptors = map()->instance_descriptors(); 1567 DescriptorArray* descriptors = map()->instance_descriptors();
1568 int number = descriptors->Search(name); 1568 int number = DescriptorLookupCache::Lookup(descriptors, name);
1569 if (number == DescriptorLookupCache::kAbsent) {
1570 number = descriptors->Search(name);
1571 DescriptorLookupCache::Update(descriptors, name, number);
1572 }
1569 if (number != DescriptorArray::kNotFound) { 1573 if (number != DescriptorArray::kNotFound) {
1570 result->DescriptorResult(this, descriptors->GetDetails(number), number); 1574 result->DescriptorResult(this, descriptors->GetDetails(number), number);
1571 } else { 1575 } else {
1572 result->NotFound(); 1576 result->NotFound();
1573 } 1577 }
1574 } 1578 }
1575 1579
1576 1580
1577 void JSObject::LocalLookupRealNamedProperty(String* name, 1581 void JSObject::LocalLookupRealNamedProperty(String* name,
1578 LookupResult* result) { 1582 LookupResult* result) {
(...skipping 5901 matching lines...) Expand 10 before | Expand all | Expand 10 after
7480 // No break point. 7484 // No break point.
7481 if (break_point_objects()->IsUndefined()) return 0; 7485 if (break_point_objects()->IsUndefined()) return 0;
7482 // Single beak point. 7486 // Single beak point.
7483 if (!break_point_objects()->IsFixedArray()) return 1; 7487 if (!break_point_objects()->IsFixedArray()) return 1;
7484 // Multiple break points. 7488 // Multiple break points.
7485 return FixedArray::cast(break_point_objects())->length(); 7489 return FixedArray::cast(break_point_objects())->length();
7486 } 7490 }
7487 #endif 7491 #endif
7488 7492
7489 } } // namespace v8::internal 7493 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698