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

Side by Side Diff: src/factory.cc

Issue 10816005: Swapped transition array and descriptor array. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: u Created 8 years, 4 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
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),
120 DescriptorArray); 119 DescriptorArray);
121 } 120 }
122 121
123 122
123 void Factory::SetDescriptors(Handle<Map> map,
Michael Starzinger 2012/08/06 14:15:52 This method should definitely be moved into the "M
Toon Verwaest 2012/08/07 08:33:04 Done.
124 Handle<DescriptorArray> descriptors) {
125 CALL_HEAP_FUNCTION_VOID(isolate(), map->SetDescriptors(*descriptors));
126 }
127
128
124 Handle<DeoptimizationInputData> Factory::NewDeoptimizationInputData( 129 Handle<DeoptimizationInputData> Factory::NewDeoptimizationInputData(
125 int deopt_entry_count, 130 int deopt_entry_count,
126 PretenureFlag pretenure) { 131 PretenureFlag pretenure) {
127 ASSERT(deopt_entry_count > 0); 132 ASSERT(deopt_entry_count > 0);
128 CALL_HEAP_FUNCTION(isolate(), 133 CALL_HEAP_FUNCTION(isolate(),
129 DeoptimizationInputData::Allocate(deopt_entry_count, 134 DeoptimizationInputData::Allocate(deopt_entry_count,
130 pretenure), 135 pretenure),
131 DeoptimizationInputData); 136 DeoptimizationInputData);
132 } 137 }
133 138
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 copy->inobject_properties() + extra_inobject_properties; 495 copy->inobject_properties() + extra_inobject_properties;
491 copy->set_inobject_properties(inobject_properties); 496 copy->set_inobject_properties(inobject_properties);
492 copy->set_unused_property_fields(inobject_properties); 497 copy->set_unused_property_fields(inobject_properties);
493 copy->set_instance_size(copy->instance_size() + instance_size_delta); 498 copy->set_instance_size(copy->instance_size() + instance_size_delta);
494 copy->set_visitor_id(StaticVisitorBase::GetVisitorId(*copy)); 499 copy->set_visitor_id(StaticVisitorBase::GetVisitorId(*copy));
495 return copy; 500 return copy;
496 } 501 }
497 502
498 503
499 Handle<Map> Factory::CopyMap(Handle<Map> src) { 504 Handle<Map> Factory::CopyMap(Handle<Map> src) {
500 CALL_HEAP_FUNCTION(isolate(), src->Copy(DescriptorArray::MAY_BE_SHARED), Map); 505 CALL_HEAP_FUNCTION(isolate(), src->Copy(), Map);
501 } 506 }
502 507
503 508
504 Handle<Map> Factory::GetElementsTransitionMap( 509 Handle<Map> Factory::GetElementsTransitionMap(
505 Handle<JSObject> src, 510 Handle<JSObject> src,
506 ElementsKind elements_kind) { 511 ElementsKind elements_kind) {
507 Isolate* i = isolate(); 512 Isolate* i = isolate();
508 CALL_HEAP_FUNCTION(i, 513 CALL_HEAP_FUNCTION(i,
509 src->GetElementsTransitionMap(i, elements_kind), 514 src->GetElementsTransitionMap(i, elements_kind),
510 Map); 515 Map);
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 1406
1402 1407
1403 Handle<Object> Factory::ToBoolean(bool value) { 1408 Handle<Object> Factory::ToBoolean(bool value) {
1404 return Handle<Object>(value 1409 return Handle<Object>(value
1405 ? isolate()->heap()->true_value() 1410 ? isolate()->heap()->true_value()
1406 : isolate()->heap()->false_value()); 1411 : isolate()->heap()->false_value());
1407 } 1412 }
1408 1413
1409 1414
1410 } } // namespace v8::internal 1415 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698