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

Side by Side Diff: src/handles.cc

Issue 40218: Fix garbage collection of unused maps. Null descriptors, created... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 9 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/objects.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-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 DescriptorArray* desc = object->map()->instance_descriptors(); 460 DescriptorArray* desc = object->map()->instance_descriptors();
461 return Handle<FixedArray>(FixedArray::cast(desc->GetEnumCache())); 461 return Handle<FixedArray>(FixedArray::cast(desc->GetEnumCache()));
462 } 462 }
463 Counters::enum_cache_misses.Increment(); 463 Counters::enum_cache_misses.Increment();
464 int num_enum = object->NumberOfEnumProperties(); 464 int num_enum = object->NumberOfEnumProperties();
465 Handle<FixedArray> storage = Factory::NewFixedArray(num_enum); 465 Handle<FixedArray> storage = Factory::NewFixedArray(num_enum);
466 Handle<FixedArray> sort_array = Factory::NewFixedArray(num_enum); 466 Handle<FixedArray> sort_array = Factory::NewFixedArray(num_enum);
467 for (DescriptorReader r(object->map()->instance_descriptors()); 467 for (DescriptorReader r(object->map()->instance_descriptors());
468 !r.eos(); 468 !r.eos();
469 r.advance()) { 469 r.advance()) {
470 if (!r.IsTransition() && !r.IsDontEnum()) { 470 if (r.IsProperty() && !r.IsDontEnum()) {
471 (*storage)->set(index, r.GetKey()); 471 (*storage)->set(index, r.GetKey());
472 (*sort_array)->set(index, Smi::FromInt(r.GetDetails().index())); 472 (*sort_array)->set(index, Smi::FromInt(r.GetDetails().index()));
473 index++; 473 index++;
474 } 474 }
475 } 475 }
476 (*storage)->SortPairs(*sort_array); 476 (*storage)->SortPairs(*sort_array);
477 Handle<FixedArray> bridge_storage = 477 Handle<FixedArray> bridge_storage =
478 Factory::NewFixedArray(DescriptorArray::kEnumCacheBridgeLength); 478 Factory::NewFixedArray(DescriptorArray::kEnumCacheBridgeLength);
479 DescriptorArray* desc = object->map()->instance_descriptors(); 479 DescriptorArray* desc = object->map()->instance_descriptors();
480 desc->SetEnumCache(*bridge_storage, *storage); 480 desc->SetEnumCache(*bridge_storage, *storage);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 Handle<Context> compile_context, 603 Handle<Context> compile_context,
604 Handle<Context> function_context) { 604 Handle<Context> function_context) {
605 Handle<FixedArray> arr = Factory::NewFixedArray(3); 605 Handle<FixedArray> arr = Factory::NewFixedArray(3);
606 arr->set(0, Smi::FromInt(index)); 606 arr->set(0, Smi::FromInt(index));
607 arr->set(1, *compile_context); // Compile in this context 607 arr->set(1, *compile_context); // Compile in this context
608 arr->set(2, *function_context); // Set function context to this 608 arr->set(2, *function_context); // Set function context to this
609 fun->shared()->set_lazy_load_data(*arr); 609 fun->shared()->set_lazy_load_data(*arr);
610 } 610 }
611 611
612 } } // namespace v8::internal 612 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698