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 4358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4369 Representation representation) { | 4369 Representation representation) { |
4370 ASSERT(offset >= 0); | 4370 ASSERT(offset >= 0); |
4371 return HObjectAccess(kBackingStore, offset, representation, | 4371 return HObjectAccess(kBackingStore, offset, representation, |
4372 Handle<String>::null(), false, false); | 4372 Handle<String>::null(), false, false); |
4373 } | 4373 } |
4374 | 4374 |
4375 | 4375 |
4376 HObjectAccess HObjectAccess::ForField(Handle<Map> map, | 4376 HObjectAccess HObjectAccess::ForField(Handle<Map> map, |
4377 LookupResult* lookup, | 4377 LookupResult* lookup, |
4378 Handle<String> name) { | 4378 Handle<String> name) { |
4379 ASSERT(lookup->IsField() || lookup->IsTransitionToField(*map)); | 4379 ASSERT(lookup->IsField() || lookup->IsTransitionToField()); |
4380 int index; | 4380 int index; |
4381 Representation representation; | 4381 Representation representation; |
4382 if (lookup->IsField()) { | 4382 if (lookup->IsField()) { |
4383 index = lookup->GetLocalFieldIndexFromMap(*map); | 4383 index = lookup->GetLocalFieldIndexFromMap(*map); |
4384 representation = lookup->representation(); | 4384 representation = lookup->representation(); |
4385 } else { | 4385 } else { |
4386 Map* transition = lookup->GetTransitionMapFromMap(*map); | 4386 Map* transition = lookup->GetTransitionTarget(); |
4387 int descriptor = transition->LastAdded(); | 4387 int descriptor = transition->LastAdded(); |
4388 index = transition->instance_descriptors()->GetFieldIndex(descriptor) - | 4388 index = transition->instance_descriptors()->GetFieldIndex(descriptor) - |
4389 map->inobject_properties(); | 4389 map->inobject_properties(); |
4390 PropertyDetails details = | 4390 PropertyDetails details = |
4391 transition->instance_descriptors()->GetDetails(descriptor); | 4391 transition->instance_descriptors()->GetDetails(descriptor); |
4392 representation = details.representation(); | 4392 representation = details.representation(); |
4393 } | 4393 } |
4394 if (index < 0) { | 4394 if (index < 0) { |
4395 // Negative property indices are in-object properties, indexed | 4395 // Negative property indices are in-object properties, indexed |
4396 // from the end of the fixed part of the object. | 4396 // from the end of the fixed part of the object. |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4514 break; | 4514 break; |
4515 case kExternalMemory: | 4515 case kExternalMemory: |
4516 stream->Add("[external-memory]"); | 4516 stream->Add("[external-memory]"); |
4517 break; | 4517 break; |
4518 } | 4518 } |
4519 | 4519 |
4520 stream->Add("@%d", offset()); | 4520 stream->Add("@%d", offset()); |
4521 } | 4521 } |
4522 | 4522 |
4523 } } // namespace v8::internal | 4523 } } // namespace v8::internal |
OLD | NEW |