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

Side by Side Diff: src/factory.cc

Issue 10444055: Promoting elements transitions to their own field. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: renaming SearchMode fields and moving it into descriptor array class Created 8 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/bootstrapper.cc ('k') | src/heap.cc » ('j') | src/objects.h » ('J')
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 ASSERT(0 <= at_least_space_for); 108 ASSERT(0 <= at_least_space_for);
109 CALL_HEAP_FUNCTION(isolate(), 109 CALL_HEAP_FUNCTION(isolate(),
110 ObjectHashTable::Allocate(at_least_space_for), 110 ObjectHashTable::Allocate(at_least_space_for),
111 ObjectHashTable); 111 ObjectHashTable);
112 } 112 }
113 113
114 114
115 Handle<DescriptorArray> Factory::NewDescriptorArray(int number_of_descriptors) { 115 Handle<DescriptorArray> Factory::NewDescriptorArray(int number_of_descriptors) {
116 ASSERT(0 <= number_of_descriptors); 116 ASSERT(0 <= number_of_descriptors);
117 CALL_HEAP_FUNCTION(isolate(), 117 CALL_HEAP_FUNCTION(isolate(),
118 DescriptorArray::Allocate(number_of_descriptors), 118 DescriptorArray::Allocate(number_of_descriptors,
119 DescriptorArray::MAY_BE_SHARED),
119 DescriptorArray); 120 DescriptorArray);
120 } 121 }
121 122
122 123
123 Handle<DeoptimizationInputData> Factory::NewDeoptimizationInputData( 124 Handle<DeoptimizationInputData> Factory::NewDeoptimizationInputData(
124 int deopt_entry_count, 125 int deopt_entry_count,
125 PretenureFlag pretenure) { 126 PretenureFlag pretenure) {
126 ASSERT(deopt_entry_count > 0); 127 ASSERT(deopt_entry_count > 0);
127 CALL_HEAP_FUNCTION(isolate(), 128 CALL_HEAP_FUNCTION(isolate(),
128 DeoptimizationInputData::Allocate(deopt_entry_count, 129 DeoptimizationInputData::Allocate(deopt_entry_count,
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 copy->inobject_properties() + extra_inobject_properties; 490 copy->inobject_properties() + extra_inobject_properties;
490 copy->set_inobject_properties(inobject_properties); 491 copy->set_inobject_properties(inobject_properties);
491 copy->set_unused_property_fields(inobject_properties); 492 copy->set_unused_property_fields(inobject_properties);
492 copy->set_instance_size(copy->instance_size() + instance_size_delta); 493 copy->set_instance_size(copy->instance_size() + instance_size_delta);
493 copy->set_visitor_id(StaticVisitorBase::GetVisitorId(*copy)); 494 copy->set_visitor_id(StaticVisitorBase::GetVisitorId(*copy));
494 return copy; 495 return copy;
495 } 496 }
496 497
497 498
498 Handle<Map> Factory::CopyMapDropTransitions(Handle<Map> src) { 499 Handle<Map> Factory::CopyMapDropTransitions(Handle<Map> src) {
499 CALL_HEAP_FUNCTION(isolate(), src->CopyDropTransitions(), Map); 500 CALL_HEAP_FUNCTION(isolate(),
501 src->CopyDropTransitions(DescriptorArray::MAY_BE_SHARED),
502 Map);
500 } 503 }
501 504
502 505
503 Handle<Map> Factory::GetElementsTransitionMap( 506 Handle<Map> Factory::GetElementsTransitionMap(
504 Handle<JSObject> src, 507 Handle<JSObject> src,
505 ElementsKind elements_kind) { 508 ElementsKind elements_kind) {
506 Isolate* i = isolate(); 509 Isolate* i = isolate();
507 CALL_HEAP_FUNCTION(i, 510 CALL_HEAP_FUNCTION(i,
508 src->GetElementsTransitionMap(i, elements_kind), 511 src->GetElementsTransitionMap(i, elements_kind),
509 Map); 512 Map);
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 // Fill in new callback descriptors. Process the callbacks from 935 // Fill in new callback descriptors. Process the callbacks from
933 // back to front so that the last callback with a given name takes 936 // back to front so that the last callback with a given name takes
934 // precedence over previously added callbacks with that name. 937 // precedence over previously added callbacks with that name.
935 for (int i = nof_callbacks - 1; i >= 0; i--) { 938 for (int i = nof_callbacks - 1; i >= 0; i--) {
936 Handle<AccessorInfo> entry = 939 Handle<AccessorInfo> entry =
937 Handle<AccessorInfo>(AccessorInfo::cast(callbacks.get(i))); 940 Handle<AccessorInfo>(AccessorInfo::cast(callbacks.get(i)));
938 // Ensure the key is a symbol before writing into the instance descriptor. 941 // Ensure the key is a symbol before writing into the instance descriptor.
939 Handle<String> key = 942 Handle<String> key =
940 SymbolFromString(Handle<String>(String::cast(entry->name()))); 943 SymbolFromString(Handle<String>(String::cast(entry->name())));
941 // Check if a descriptor with this name already exists before writing. 944 // Check if a descriptor with this name already exists before writing.
942 if (result->LinearSearch(*key, descriptor_count) == 945 if (result->LinearSearch(EXPECT_UNSORTED, *key, descriptor_count) ==
943 DescriptorArray::kNotFound) { 946 DescriptorArray::kNotFound) {
944 CallbacksDescriptor desc(*key, *entry, entry->property_attributes()); 947 CallbacksDescriptor desc(*key, *entry, entry->property_attributes());
945 result->Set(descriptor_count, &desc, witness); 948 result->Set(descriptor_count, &desc, witness);
946 descriptor_count++; 949 descriptor_count++;
947 } else { 950 } else {
948 duplicates++; 951 duplicates++;
949 } 952 }
950 } 953 }
951 954
952 // If duplicates were detected, allocate a result of the right size 955 // If duplicates were detected, allocate a result of the right size
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 1483
1481 1484
1482 Handle<Object> Factory::ToBoolean(bool value) { 1485 Handle<Object> Factory::ToBoolean(bool value) {
1483 return Handle<Object>(value 1486 return Handle<Object>(value
1484 ? isolate()->heap()->true_value() 1487 ? isolate()->heap()->true_value()
1485 : isolate()->heap()->false_value()); 1488 : isolate()->heap()->false_value());
1486 } 1489 }
1487 1490
1488 1491
1489 } } // namespace v8::internal 1492 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/heap.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698