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

Side by Side Diff: src/objects-inl.h

Issue 11194080: Get the target field index when transitioning. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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
« no previous file with comments | « src/objects.h ('k') | 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 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 if (transition == TransitionArray::kNotFound) return false; 1437 if (transition == TransitionArray::kNotFound) return false;
1438 PropertyDetails target_details = transitions->GetTargetDetails(transition); 1438 PropertyDetails target_details = transitions->GetTargetDetails(transition);
1439 if (target_details.type() != FIELD) return false; 1439 if (target_details.type() != FIELD) return false;
1440 if (target_details.attributes() != NONE) return false; 1440 if (target_details.attributes() != NONE) return false;
1441 Handle<Map> target(transitions->GetTarget(transition)); 1441 Handle<Map> target(transitions->GetTarget(transition));
1442 JSObject::AddFastPropertyUsingMap(object, target); 1442 JSObject::AddFastPropertyUsingMap(object, target);
1443 return true; 1443 return true;
1444 } 1444 }
1445 1445
1446 1446
1447 int JSObject::LastAddedFieldIndex() {
1448 Map* map = this->map();
1449 int last_added = map->LastAdded();
1450 return map->instance_descriptors()->GetFieldIndex(last_added);
1451 }
1452
1453
1447 ACCESSORS(Oddball, to_string, String, kToStringOffset) 1454 ACCESSORS(Oddball, to_string, String, kToStringOffset)
1448 ACCESSORS(Oddball, to_number, Object, kToNumberOffset) 1455 ACCESSORS(Oddball, to_number, Object, kToNumberOffset)
1449 1456
1450 1457
1451 byte Oddball::kind() { 1458 byte Oddball::kind() {
1452 return Smi::cast(READ_FIELD(this, kKindOffset))->value(); 1459 return Smi::cast(READ_FIELD(this, kKindOffset))->value();
1453 } 1460 }
1454 1461
1455 1462
1456 void Oddball::set_kind(byte value) { 1463 void Oddball::set_kind(byte value) {
(...skipping 4076 matching lines...) Expand 10 before | Expand all | Expand 10 after
5533 #undef WRITE_UINT32_FIELD 5540 #undef WRITE_UINT32_FIELD
5534 #undef READ_SHORT_FIELD 5541 #undef READ_SHORT_FIELD
5535 #undef WRITE_SHORT_FIELD 5542 #undef WRITE_SHORT_FIELD
5536 #undef READ_BYTE_FIELD 5543 #undef READ_BYTE_FIELD
5537 #undef WRITE_BYTE_FIELD 5544 #undef WRITE_BYTE_FIELD
5538 5545
5539 5546
5540 } } // namespace v8::internal 5547 } } // namespace v8::internal
5541 5548
5542 #endif // V8_OBJECTS_INL_H_ 5549 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698