| 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 4336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4347 Representation representation) { | 4347 Representation representation) { |
| 4348 ASSERT(offset >= 0); | 4348 ASSERT(offset >= 0); |
| 4349 return HObjectAccess(kBackingStore, offset, representation, | 4349 return HObjectAccess(kBackingStore, offset, representation, |
| 4350 Handle<String>::null(), false, false); | 4350 Handle<String>::null(), false, false); |
| 4351 } | 4351 } |
| 4352 | 4352 |
| 4353 | 4353 |
| 4354 HObjectAccess HObjectAccess::ForField(Handle<Map> map, | 4354 HObjectAccess HObjectAccess::ForField(Handle<Map> map, |
| 4355 LookupResult* lookup, | 4355 LookupResult* lookup, |
| 4356 Handle<String> name) { | 4356 Handle<String> name) { |
| 4357 ASSERT(lookup->IsField() || lookup->IsTransitionToField(*map)); | 4357 ASSERT(lookup->IsField() || lookup->IsTransitionToField()); |
| 4358 int index; | 4358 int index; |
| 4359 Representation representation; | 4359 Representation representation; |
| 4360 if (lookup->IsField()) { | 4360 if (lookup->IsField()) { |
| 4361 index = lookup->GetLocalFieldIndexFromMap(*map); | 4361 index = lookup->GetLocalFieldIndexFromMap(*map); |
| 4362 representation = lookup->representation(); | 4362 representation = lookup->representation(); |
| 4363 } else { | 4363 } else { |
| 4364 Map* transition = lookup->GetTransitionMapFromMap(*map); | 4364 Map* transition = lookup->GetTransitionTarget(); |
| 4365 int descriptor = transition->LastAdded(); | 4365 int descriptor = transition->LastAdded(); |
| 4366 index = transition->instance_descriptors()->GetFieldIndex(descriptor) - | 4366 index = transition->instance_descriptors()->GetFieldIndex(descriptor) - |
| 4367 map->inobject_properties(); | 4367 map->inobject_properties(); |
| 4368 PropertyDetails details = | 4368 PropertyDetails details = |
| 4369 transition->instance_descriptors()->GetDetails(descriptor); | 4369 transition->instance_descriptors()->GetDetails(descriptor); |
| 4370 representation = details.representation(); | 4370 representation = details.representation(); |
| 4371 } | 4371 } |
| 4372 if (index < 0) { | 4372 if (index < 0) { |
| 4373 // Negative property indices are in-object properties, indexed | 4373 // Negative property indices are in-object properties, indexed |
| 4374 // from the end of the fixed part of the object. | 4374 // from the end of the fixed part of the object. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4468 break; | 4468 break; |
| 4469 case kExternalMemory: | 4469 case kExternalMemory: |
| 4470 stream->Add("[external-memory]"); | 4470 stream->Add("[external-memory]"); |
| 4471 break; | 4471 break; |
| 4472 } | 4472 } |
| 4473 | 4473 |
| 4474 stream->Add("@%d", offset()); | 4474 stream->Add("@%d", offset()); |
| 4475 } | 4475 } |
| 4476 | 4476 |
| 4477 } } // namespace v8::internal | 4477 } } // namespace v8::internal |
| OLD | NEW |