OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 WRITE_FIELD(this, offset, value); | 1087 WRITE_FIELD(this, offset, value); |
1088 WRITE_BARRIER(this, offset); | 1088 WRITE_BARRIER(this, offset); |
1089 } else { | 1089 } else { |
1090 ASSERT(index < properties()->length()); | 1090 ASSERT(index < properties()->length()); |
1091 properties()->set(index, value); | 1091 properties()->set(index, value); |
1092 } | 1092 } |
1093 return value; | 1093 return value; |
1094 } | 1094 } |
1095 | 1095 |
1096 | 1096 |
| 1097 Object* JSObject::InObjectPropertyAt(int index) { |
| 1098 // Adjust for the number of properties stored in the object. |
| 1099 index -= map()->inobject_properties(); |
| 1100 ASSERT(index < 0); |
| 1101 int offset = map()->instance_size() + (index * kPointerSize); |
| 1102 return READ_FIELD(this, offset); |
| 1103 } |
| 1104 |
| 1105 |
1097 Object* JSObject::InObjectPropertyAtPut(int index, | 1106 Object* JSObject::InObjectPropertyAtPut(int index, |
1098 Object* value, | 1107 Object* value, |
1099 WriteBarrierMode mode) { | 1108 WriteBarrierMode mode) { |
1100 // Adjust for the number of properties stored in the object. | 1109 // Adjust for the number of properties stored in the object. |
1101 index -= map()->inobject_properties(); | 1110 index -= map()->inobject_properties(); |
1102 ASSERT(index < 0); | 1111 ASSERT(index < 0); |
1103 int offset = map()->instance_size() + (index * kPointerSize); | 1112 int offset = map()->instance_size() + (index * kPointerSize); |
1104 WRITE_FIELD(this, offset, value); | 1113 WRITE_FIELD(this, offset, value); |
1105 CONDITIONAL_WRITE_BARRIER(this, offset, mode); | 1114 CONDITIONAL_WRITE_BARRIER(this, offset, mode); |
1106 return value; | 1115 return value; |
(...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2566 #undef WRITE_INT_FIELD | 2575 #undef WRITE_INT_FIELD |
2567 #undef READ_SHORT_FIELD | 2576 #undef READ_SHORT_FIELD |
2568 #undef WRITE_SHORT_FIELD | 2577 #undef WRITE_SHORT_FIELD |
2569 #undef READ_BYTE_FIELD | 2578 #undef READ_BYTE_FIELD |
2570 #undef WRITE_BYTE_FIELD | 2579 #undef WRITE_BYTE_FIELD |
2571 | 2580 |
2572 | 2581 |
2573 } } // namespace v8::internal | 2582 } } // namespace v8::internal |
2574 | 2583 |
2575 #endif // V8_OBJECTS_INL_H_ | 2584 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |