| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1508 inline Object* GetPrototype(); | 1508 inline Object* GetPrototype(); |
| 1509 | 1509 |
| 1510 // Set the object's prototype (only JSObject and null are allowed). | 1510 // Set the object's prototype (only JSObject and null are allowed). |
| 1511 MUST_USE_RESULT MaybeObject* SetPrototype(Object* value, | 1511 MUST_USE_RESULT MaybeObject* SetPrototype(Object* value, |
| 1512 bool skip_hidden_prototypes); | 1512 bool skip_hidden_prototypes); |
| 1513 | 1513 |
| 1514 // Tells whether the index'th element is present. | 1514 // Tells whether the index'th element is present. |
| 1515 inline bool HasElement(uint32_t index); | 1515 inline bool HasElement(uint32_t index); |
| 1516 bool HasElementWithReceiver(JSObject* receiver, uint32_t index); | 1516 bool HasElementWithReceiver(JSObject* receiver, uint32_t index); |
| 1517 | 1517 |
| 1518 // Computes the new capacity when expanding the elements of a JSObject. |
| 1519 static int NewElementsCapacity(int old_capacity) { |
| 1520 // (old_capacity + 50%) + 16 |
| 1521 return old_capacity + (old_capacity >> 1) + 16; |
| 1522 } |
| 1523 |
| 1518 // Tells whether the index'th element is present and how it is stored. | 1524 // Tells whether the index'th element is present and how it is stored. |
| 1519 enum LocalElementType { | 1525 enum LocalElementType { |
| 1520 // There is no element with given index. | 1526 // There is no element with given index. |
| 1521 UNDEFINED_ELEMENT, | 1527 UNDEFINED_ELEMENT, |
| 1522 | 1528 |
| 1523 // Element with given index is handled by interceptor. | 1529 // Element with given index is handled by interceptor. |
| 1524 INTERCEPTED_ELEMENT, | 1530 INTERCEPTED_ELEMENT, |
| 1525 | 1531 |
| 1526 // Element with given index is character in string. | 1532 // Element with given index is character in string. |
| 1527 STRING_CHARACTER_ELEMENT, | 1533 STRING_CHARACTER_ELEMENT, |
| (...skipping 5034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6562 } else { | 6568 } else { |
| 6563 value &= ~(1 << bit_position); | 6569 value &= ~(1 << bit_position); |
| 6564 } | 6570 } |
| 6565 return value; | 6571 return value; |
| 6566 } | 6572 } |
| 6567 }; | 6573 }; |
| 6568 | 6574 |
| 6569 } } // namespace v8::internal | 6575 } } // namespace v8::internal |
| 6570 | 6576 |
| 6571 #endif // V8_OBJECTS_H_ | 6577 #endif // V8_OBJECTS_H_ |
| OLD | NEW |