OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1509 // Note: this call does not update write barrier, it is caller's | 1509 // Note: this call does not update write barrier, it is caller's |
1510 // reponsibility to ensure that *v* can be collected without WB here. | 1510 // reponsibility to ensure that *v* can be collected without WB here. |
1511 inline void InitializeBody(int object_size); | 1511 inline void InitializeBody(int object_size); |
1512 | 1512 |
1513 // Check whether this object references another object | 1513 // Check whether this object references another object |
1514 bool ReferencesObject(Object* obj); | 1514 bool ReferencesObject(Object* obj); |
1515 | 1515 |
1516 // Casting. | 1516 // Casting. |
1517 static inline JSObject* cast(Object* obj); | 1517 static inline JSObject* cast(Object* obj); |
1518 | 1518 |
| 1519 // Disalow further properties to be added to the object. |
| 1520 Object* PreventExtensions(); |
| 1521 |
| 1522 |
1519 // Dispatched behavior. | 1523 // Dispatched behavior. |
1520 void JSObjectIterateBody(int object_size, ObjectVisitor* v); | 1524 void JSObjectIterateBody(int object_size, ObjectVisitor* v); |
1521 void JSObjectShortPrint(StringStream* accumulator); | 1525 void JSObjectShortPrint(StringStream* accumulator); |
1522 #ifdef DEBUG | 1526 #ifdef DEBUG |
1523 void JSObjectPrint(); | 1527 void JSObjectPrint(); |
1524 void JSObjectVerify(); | 1528 void JSObjectVerify(); |
1525 void PrintProperties(); | 1529 void PrintProperties(); |
1526 void PrintElements(); | 1530 void PrintElements(); |
1527 | 1531 |
1528 // Structure for collecting spill information about JSObjects. | 1532 // Structure for collecting spill information about JSObjects. |
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2973 | 2977 |
2974 // Tells whether the instance has a call-as-function handler. | 2978 // Tells whether the instance has a call-as-function handler. |
2975 inline void set_has_instance_call_handler() { | 2979 inline void set_has_instance_call_handler() { |
2976 set_bit_field(bit_field() | (1 << kHasInstanceCallHandler)); | 2980 set_bit_field(bit_field() | (1 << kHasInstanceCallHandler)); |
2977 } | 2981 } |
2978 | 2982 |
2979 inline bool has_instance_call_handler() { | 2983 inline bool has_instance_call_handler() { |
2980 return ((1 << kHasInstanceCallHandler) & bit_field()) != 0; | 2984 return ((1 << kHasInstanceCallHandler) & bit_field()) != 0; |
2981 } | 2985 } |
2982 | 2986 |
2983 inline void set_is_extensible() { | 2987 inline void set_is_extensible(bool value); |
2984 set_bit_field2(bit_field2() | (1 << kIsExtensible)); | 2988 inline bool is_extensible(); |
2985 } | |
2986 | |
2987 inline bool is_extensible() { | |
2988 return ((1 << kIsExtensible) & bit_field2()) != 0; | |
2989 } | |
2990 | 2989 |
2991 // Tells whether the instance has fast elements. | 2990 // Tells whether the instance has fast elements. |
2992 void set_has_fast_elements(bool value) { | 2991 void set_has_fast_elements(bool value) { |
2993 if (value) { | 2992 if (value) { |
2994 set_bit_field2(bit_field2() | (1 << kHasFastElements)); | 2993 set_bit_field2(bit_field2() | (1 << kHasFastElements)); |
2995 } else { | 2994 } else { |
2996 set_bit_field2(bit_field2() & ~(1 << kHasFastElements)); | 2995 set_bit_field2(bit_field2() & ~(1 << kHasFastElements)); |
2997 } | 2996 } |
2998 } | 2997 } |
2999 | 2998 |
(...skipping 2334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5334 } else { | 5333 } else { |
5335 value &= ~(1 << bit_position); | 5334 value &= ~(1 << bit_position); |
5336 } | 5335 } |
5337 return value; | 5336 return value; |
5338 } | 5337 } |
5339 }; | 5338 }; |
5340 | 5339 |
5341 } } // namespace v8::internal | 5340 } } // namespace v8::internal |
5342 | 5341 |
5343 #endif // V8_OBJECTS_H_ | 5342 #endif // V8_OBJECTS_H_ |
OLD | NEW |