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

Side by Side Diff: src/objects.cc

Issue 11418181: Relax restrictions on CONSTANT_FUNCTION descriptors in TransformPropertiesToFastFor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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 | « no previous file | no next file » | 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 13252 matching lines...) Expand 10 before | Expand all | Expand 10 after
13263 13263
13264 // Compute the length of the instance descriptor. 13264 // Compute the length of the instance descriptor.
13265 int capacity = Capacity(); 13265 int capacity = Capacity();
13266 for (int i = 0; i < capacity; i++) { 13266 for (int i = 0; i < capacity; i++) {
13267 Object* k = KeyAt(i); 13267 Object* k = KeyAt(i);
13268 if (IsKey(k)) { 13268 if (IsKey(k)) {
13269 Object* value = ValueAt(i); 13269 Object* value = ValueAt(i);
13270 PropertyType type = DetailsAt(i).type(); 13270 PropertyType type = DetailsAt(i).type();
13271 ASSERT(type != FIELD); 13271 ASSERT(type != FIELD);
13272 instance_descriptor_length++; 13272 instance_descriptor_length++;
13273 if (type == NORMAL && 13273 if (type == NORMAL && !value->IsJSFunction()) {
13274 (!value->IsJSFunction() || heap->InNewSpace(value))) {
13275 number_of_fields += 1; 13274 number_of_fields += 1;
13276 } 13275 }
13277 } 13276 }
13278 } 13277 }
13279 13278
13280 int inobject_props = obj->map()->inobject_properties(); 13279 int inobject_props = obj->map()->inobject_properties();
13281 13280
13282 // Allocate new map. 13281 // Allocate new map.
13283 Map* new_map; 13282 Map* new_map;
13284 MaybeObject* maybe_new_map = obj->map()->CopyDropDescriptors(); 13283 MaybeObject* maybe_new_map = obj->map()->CopyDropDescriptors();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
13329 // Ensure the key is a symbol before writing into the instance descriptor. 13328 // Ensure the key is a symbol before writing into the instance descriptor.
13330 String* key; 13329 String* key;
13331 MaybeObject* maybe_key = heap->LookupSymbol(String::cast(k)); 13330 MaybeObject* maybe_key = heap->LookupSymbol(String::cast(k));
13332 if (!maybe_key->To(&key)) return maybe_key; 13331 if (!maybe_key->To(&key)) return maybe_key;
13333 13332
13334 PropertyDetails details = DetailsAt(i); 13333 PropertyDetails details = DetailsAt(i);
13335 ASSERT(details.descriptor_index() == details.dictionary_index()); 13334 ASSERT(details.descriptor_index() == details.dictionary_index());
13336 int enumeration_index = details.descriptor_index(); 13335 int enumeration_index = details.descriptor_index();
13337 PropertyType type = details.type(); 13336 PropertyType type = details.type();
13338 13337
13339 if (value->IsJSFunction() && !heap->InNewSpace(value)) { 13338 if (value->IsJSFunction()) {
13340 ConstantFunctionDescriptor d(key, 13339 ConstantFunctionDescriptor d(key,
13341 JSFunction::cast(value), 13340 JSFunction::cast(value),
13342 details.attributes(), 13341 details.attributes(),
13343 enumeration_index); 13342 enumeration_index);
13344 descriptors->Set(enumeration_index - 1, &d, witness); 13343 descriptors->Set(enumeration_index - 1, &d, witness);
13345 } else if (type == NORMAL) { 13344 } else if (type == NORMAL) {
13346 if (current_offset < inobject_props) { 13345 if (current_offset < inobject_props) {
13347 obj->InObjectPropertyAtPut(current_offset, 13346 obj->InObjectPropertyAtPut(current_offset,
13348 value, 13347 value,
13349 UPDATE_WRITE_BARRIER); 13348 UPDATE_WRITE_BARRIER);
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
13884 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13883 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13885 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13884 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13886 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13885 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13887 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13886 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13888 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13887 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13889 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13888 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13890 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13889 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13891 } 13890 }
13892 13891
13893 } } // namespace v8::internal 13892 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698