OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 7156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7167 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); | 7167 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); |
7168 }; | 7168 }; |
7169 | 7169 |
7170 | 7170 |
7171 // Foreign describes objects pointing from JavaScript to C structures. | 7171 // Foreign describes objects pointing from JavaScript to C structures. |
7172 // Since they cannot contain references to JS HeapObjects they can be | 7172 // Since they cannot contain references to JS HeapObjects they can be |
7173 // placed in old_data_space. | 7173 // placed in old_data_space. |
7174 class Foreign: public HeapObject { | 7174 class Foreign: public HeapObject { |
7175 public: | 7175 public: |
7176 // [address]: field containing the address. | 7176 // [address]: field containing the address. |
7177 inline Address address(); | 7177 inline Address foreign_address(); |
7178 inline void set_address(Address value); | 7178 inline void set_foreign_address(Address value); |
| 7179 |
| 7180 Address address() { OS::DebugBreak(); return NULL; } |
7179 | 7181 |
7180 // Casting. | 7182 // Casting. |
7181 static inline Foreign* cast(Object* obj); | 7183 static inline Foreign* cast(Object* obj); |
7182 | 7184 |
7183 // Dispatched behavior. | 7185 // Dispatched behavior. |
7184 inline void ForeignIterateBody(ObjectVisitor* v); | 7186 inline void ForeignIterateBody(ObjectVisitor* v); |
7185 | 7187 |
7186 template<typename StaticVisitor> | 7188 template<typename StaticVisitor> |
7187 inline void ForeignIterateBody(); | 7189 inline void ForeignIterateBody(); |
7188 | 7190 |
7189 #ifdef OBJECT_PRINT | 7191 #ifdef OBJECT_PRINT |
7190 inline void ForeignPrint() { | 7192 inline void ForeignPrint() { |
7191 ForeignPrint(stdout); | 7193 ForeignPrint(stdout); |
7192 } | 7194 } |
7193 void ForeignPrint(FILE* out); | 7195 void ForeignPrint(FILE* out); |
7194 #endif | 7196 #endif |
7195 #ifdef DEBUG | 7197 #ifdef DEBUG |
7196 void ForeignVerify(); | 7198 void ForeignVerify(); |
7197 #endif | 7199 #endif |
7198 | 7200 |
7199 // Layout description. | 7201 // Layout description. |
7200 | 7202 |
7201 static const int kAddressOffset = HeapObject::kHeaderSize; | 7203 static const int kForeignAddressOffset = HeapObject::kHeaderSize; |
7202 static const int kSize = kAddressOffset + kPointerSize; | 7204 static const int kSize = kForeignAddressOffset + kPointerSize; |
7203 | 7205 |
7204 STATIC_CHECK(kAddressOffset == Internals::kForeignAddressOffset); | 7206 STATIC_CHECK(kForeignAddressOffset == Internals::kForeignAddressOffset); |
7205 | 7207 |
7206 private: | 7208 private: |
7207 DISALLOW_IMPLICIT_CONSTRUCTORS(Foreign); | 7209 DISALLOW_IMPLICIT_CONSTRUCTORS(Foreign); |
7208 }; | 7210 }; |
7209 | 7211 |
7210 | 7212 |
7211 // The JSArray describes JavaScript Arrays | 7213 // The JSArray describes JavaScript Arrays |
7212 // Such an array can be in one of two modes: | 7214 // Such an array can be in one of two modes: |
7213 // - fast, backing storage is a FixedArray and length <= elements.length(); | 7215 // - fast, backing storage is a FixedArray and length <= elements.length(); |
7214 // Please note: push and pop can be used to grow and shrink the array. | 7216 // Please note: push and pop can be used to grow and shrink the array. |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7806 } else { | 7808 } else { |
7807 value &= ~(1 << bit_position); | 7809 value &= ~(1 << bit_position); |
7808 } | 7810 } |
7809 return value; | 7811 return value; |
7810 } | 7812 } |
7811 }; | 7813 }; |
7812 | 7814 |
7813 } } // namespace v8::internal | 7815 } } // namespace v8::internal |
7814 | 7816 |
7815 #endif // V8_OBJECTS_H_ | 7817 #endif // V8_OBJECTS_H_ |
OLD | NEW |