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

Side by Side Diff: src/bootstrapper.cc

Issue 11093026: Reapply descriptor array sharing. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: fix long line Created 8 years, 2 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/arm/macro-assembler-arm.cc ('k') | src/handles.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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 PoisonArgumentsAndCaller(strict_mode_function_map); 630 PoisonArgumentsAndCaller(strict_mode_function_map);
631 PoisonArgumentsAndCaller( 631 PoisonArgumentsAndCaller(
632 strict_mode_function_instance_map_writable_prototype_); 632 strict_mode_function_instance_map_writable_prototype_);
633 } 633 }
634 634
635 635
636 static void SetAccessors(Handle<Map> map, 636 static void SetAccessors(Handle<Map> map,
637 Handle<String> name, 637 Handle<String> name,
638 Handle<JSFunction> func) { 638 Handle<JSFunction> func) {
639 DescriptorArray* descs = map->instance_descriptors(); 639 DescriptorArray* descs = map->instance_descriptors();
640 int number = descs->Search(*name); 640 int number = descs->SearchWithCache(*name, *map);
641 AccessorPair* accessors = AccessorPair::cast(descs->GetValue(number)); 641 AccessorPair* accessors = AccessorPair::cast(descs->GetValue(number));
642 accessors->set_getter(*func); 642 accessors->set_getter(*func);
643 accessors->set_setter(*func); 643 accessors->set_setter(*func);
644 } 644 }
645 645
646 646
647 void Genesis::PoisonArgumentsAndCaller(Handle<Map> map) { 647 void Genesis::PoisonArgumentsAndCaller(Handle<Map> map) {
648 SetAccessors(map, factory()->arguments_symbol(), GetThrowTypeErrorFunction()); 648 SetAccessors(map, factory()->arguments_symbol(), GetThrowTypeErrorFunction());
649 SetAccessors(map, factory()->caller_symbol(), GetThrowTypeErrorFunction()); 649 SetAccessors(map, factory()->caller_symbol(), GetThrowTypeErrorFunction());
650 } 650 }
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1767 Handle<DescriptorArray> reresult_descriptors = 1767 Handle<DescriptorArray> reresult_descriptors =
1768 factory()->NewDescriptorArray(3); 1768 factory()->NewDescriptorArray(3);
1769 DescriptorArray::WhitenessWitness witness(*reresult_descriptors); 1769 DescriptorArray::WhitenessWitness witness(*reresult_descriptors);
1770 Map::SetDescriptors(initial_map, reresult_descriptors); 1770 Map::SetDescriptors(initial_map, reresult_descriptors);
1771 1771
1772 { 1772 {
1773 JSFunction* array_function = native_context()->array_function(); 1773 JSFunction* array_function = native_context()->array_function();
1774 Handle<DescriptorArray> array_descriptors( 1774 Handle<DescriptorArray> array_descriptors(
1775 array_function->initial_map()->instance_descriptors()); 1775 array_function->initial_map()->instance_descriptors());
1776 String* length = heap()->length_symbol(); 1776 String* length = heap()->length_symbol();
1777 int old = array_descriptors->SearchWithCache(length); 1777 int old = array_descriptors->SearchWithCache(
1778 length, array_function->initial_map());
1778 ASSERT(old != DescriptorArray::kNotFound); 1779 ASSERT(old != DescriptorArray::kNotFound);
1779 CallbacksDescriptor desc(length, 1780 CallbacksDescriptor desc(length,
1780 array_descriptors->GetValue(old), 1781 array_descriptors->GetValue(old),
1781 array_descriptors->GetDetails(old).attributes()); 1782 array_descriptors->GetDetails(old).attributes());
1782 initial_map->AppendDescriptor(&desc, witness); 1783 initial_map->AppendDescriptor(&desc, witness);
1783 } 1784 }
1784 { 1785 {
1785 FieldDescriptor index_field(heap()->index_symbol(), 1786 FieldDescriptor index_field(heap()->index_symbol(),
1786 JSRegExpResult::kIndexIndex, 1787 JSRegExpResult::kIndexIndex,
1787 NONE); 1788 NONE);
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
2395 return from + sizeof(NestingCounterType); 2396 return from + sizeof(NestingCounterType);
2396 } 2397 }
2397 2398
2398 2399
2399 // Called when the top-level V8 mutex is destroyed. 2400 // Called when the top-level V8 mutex is destroyed.
2400 void Bootstrapper::FreeThreadResources() { 2401 void Bootstrapper::FreeThreadResources() {
2401 ASSERT(!IsActive()); 2402 ASSERT(!IsActive());
2402 } 2403 }
2403 2404
2404 } } // namespace v8::internal 2405 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698