OLD | NEW |
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 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 return this; | 1562 return this; |
1563 } | 1563 } |
1564 | 1564 |
1565 | 1565 |
1566 MaybeObject* JSObject::MigrateInstance() { | 1566 MaybeObject* JSObject::MigrateInstance() { |
1567 // Converting any field to the most specific type will cause the | 1567 // Converting any field to the most specific type will cause the |
1568 // GeneralizeFieldRepresentation algorithm to create the most general existing | 1568 // GeneralizeFieldRepresentation algorithm to create the most general existing |
1569 // transition that matches the object. This achieves what is needed. | 1569 // transition that matches the object. This achieves what is needed. |
1570 Map* original_map = map(); | 1570 Map* original_map = map(); |
1571 MaybeObject* maybe_result = GeneralizeFieldRepresentation( | 1571 MaybeObject* maybe_result = GeneralizeFieldRepresentation( |
1572 0, Representation::None()); | 1572 0, Representation::None(), ALLOW_AS_CONSTANT); |
1573 JSObject* result; | 1573 JSObject* result; |
1574 if (FLAG_trace_migration && maybe_result->To(&result)) { | 1574 if (FLAG_trace_migration && maybe_result->To(&result)) { |
1575 PrintInstanceMigration(stdout, original_map, result->map()); | 1575 PrintInstanceMigration(stdout, original_map, result->map()); |
1576 } | 1576 } |
1577 return maybe_result; | 1577 return maybe_result; |
1578 } | 1578 } |
1579 | 1579 |
1580 | 1580 |
1581 MaybeObject* JSObject::TryMigrateInstance() { | 1581 MaybeObject* JSObject::TryMigrateInstance() { |
1582 Map* new_map = map()->CurrentMapForDeprecated(); | 1582 Map* new_map = map()->CurrentMapForDeprecated(); |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2354 return PropertyDetails(Smi::cast(details)); | 2354 return PropertyDetails(Smi::cast(details)); |
2355 } | 2355 } |
2356 | 2356 |
2357 | 2357 |
2358 PropertyType DescriptorArray::GetType(int descriptor_number) { | 2358 PropertyType DescriptorArray::GetType(int descriptor_number) { |
2359 return GetDetails(descriptor_number).type(); | 2359 return GetDetails(descriptor_number).type(); |
2360 } | 2360 } |
2361 | 2361 |
2362 | 2362 |
2363 int DescriptorArray::GetFieldIndex(int descriptor_number) { | 2363 int DescriptorArray::GetFieldIndex(int descriptor_number) { |
| 2364 ASSERT(GetDetails(descriptor_number).type() == FIELD); |
2364 return GetDetails(descriptor_number).field_index(); | 2365 return GetDetails(descriptor_number).field_index(); |
2365 } | 2366 } |
2366 | 2367 |
2367 | 2368 |
2368 Object* DescriptorArray::GetConstant(int descriptor_number) { | 2369 Object* DescriptorArray::GetConstant(int descriptor_number) { |
2369 return GetValue(descriptor_number); | 2370 return GetValue(descriptor_number); |
2370 } | 2371 } |
2371 | 2372 |
2372 | 2373 |
2373 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) { | 2374 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) { |
(...skipping 3883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6257 #undef WRITE_UINT32_FIELD | 6258 #undef WRITE_UINT32_FIELD |
6258 #undef READ_SHORT_FIELD | 6259 #undef READ_SHORT_FIELD |
6259 #undef WRITE_SHORT_FIELD | 6260 #undef WRITE_SHORT_FIELD |
6260 #undef READ_BYTE_FIELD | 6261 #undef READ_BYTE_FIELD |
6261 #undef WRITE_BYTE_FIELD | 6262 #undef WRITE_BYTE_FIELD |
6262 | 6263 |
6263 | 6264 |
6264 } } // namespace v8::internal | 6265 } } // namespace v8::internal |
6265 | 6266 |
6266 #endif // V8_OBJECTS_INL_H_ | 6267 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |