OLD | NEW |
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 4290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4301 // [relocation_info]: Code relocation information | 4301 // [relocation_info]: Code relocation information |
4302 DECL_ACCESSORS(relocation_info, ByteArray) | 4302 DECL_ACCESSORS(relocation_info, ByteArray) |
4303 void InvalidateRelocation(); | 4303 void InvalidateRelocation(); |
4304 | 4304 |
4305 // [handler_table]: Fixed array containing offsets of exception handlers. | 4305 // [handler_table]: Fixed array containing offsets of exception handlers. |
4306 DECL_ACCESSORS(handler_table, FixedArray) | 4306 DECL_ACCESSORS(handler_table, FixedArray) |
4307 | 4307 |
4308 // [deoptimization_data]: Array containing data for deopt. | 4308 // [deoptimization_data]: Array containing data for deopt. |
4309 DECL_ACCESSORS(deoptimization_data, FixedArray) | 4309 DECL_ACCESSORS(deoptimization_data, FixedArray) |
4310 | 4310 |
4311 // [type_feedback_info]: Struct containing type feedback information. | 4311 // [type_feedback_info]: Struct containing type feedback information for |
| 4312 // unoptimized code. Optimized code can temporarily store the head of |
| 4313 // the list of the dependent optimized functions during deoptimization. |
4312 // STUBs can use this slot to store arbitrary information as a Smi. | 4314 // STUBs can use this slot to store arbitrary information as a Smi. |
4313 // Will contain either a TypeFeedbackInfo object, or undefined, or a Smi. | 4315 // Will contain either a TypeFeedbackInfo object, or JSFunction object, |
| 4316 // or undefined, or a Smi. |
4314 DECL_ACCESSORS(type_feedback_info, Object) | 4317 DECL_ACCESSORS(type_feedback_info, Object) |
4315 inline void InitializeTypeFeedbackInfoNoWriteBarrier(Object* value); | 4318 inline void InitializeTypeFeedbackInfoNoWriteBarrier(Object* value); |
4316 inline int stub_info(); | 4319 inline int stub_info(); |
4317 inline void set_stub_info(int info); | 4320 inline void set_stub_info(int info); |
| 4321 inline Object* deoptimizing_functions(); |
| 4322 inline void set_deoptimizing_functions(Object* value); |
4318 | 4323 |
4319 // [gc_metadata]: Field used to hold GC related metadata. The contents of this | 4324 // [gc_metadata]: Field used to hold GC related metadata. The contents of this |
4320 // field does not have to be traced during garbage collection since | 4325 // field does not have to be traced during garbage collection since |
4321 // it is only used by the garbage collector itself. | 4326 // it is only used by the garbage collector itself. |
4322 DECL_ACCESSORS(gc_metadata, Object) | 4327 DECL_ACCESSORS(gc_metadata, Object) |
4323 | 4328 |
4324 // [ic_age]: Inline caching age: the value of the Heap::global_ic_age | 4329 // [ic_age]: Inline caching age: the value of the Heap::global_ic_age |
4325 // at the moment when this object was created. | 4330 // at the moment when this object was created. |
4326 inline void set_ic_age(int count); | 4331 inline void set_ic_age(int count); |
4327 inline int ic_age(); | 4332 inline int ic_age(); |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5177 static const int kPrototypeOffset = kInstanceAttributesOffset + kIntSize; | 5182 static const int kPrototypeOffset = kInstanceAttributesOffset + kIntSize; |
5178 static const int kConstructorOffset = kPrototypeOffset + kPointerSize; | 5183 static const int kConstructorOffset = kPrototypeOffset + kPointerSize; |
5179 // Storage for the transition array is overloaded to directly contain a back | 5184 // Storage for the transition array is overloaded to directly contain a back |
5180 // pointer if unused. When the map has transitions, the back pointer is | 5185 // pointer if unused. When the map has transitions, the back pointer is |
5181 // transferred to the transition array and accessed through an extra | 5186 // transferred to the transition array and accessed through an extra |
5182 // indirection. | 5187 // indirection. |
5183 static const int kTransitionsOrBackPointerOffset = | 5188 static const int kTransitionsOrBackPointerOffset = |
5184 kConstructorOffset + kPointerSize; | 5189 kConstructorOffset + kPointerSize; |
5185 static const int kDescriptorsOffset = | 5190 static const int kDescriptorsOffset = |
5186 kTransitionsOrBackPointerOffset + kPointerSize; | 5191 kTransitionsOrBackPointerOffset + kPointerSize; |
5187 static const int kCodeCacheOffset = | 5192 static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize; |
5188 kDescriptorsOffset + kPointerSize; | |
5189 static const int kBitField3Offset = kCodeCacheOffset + kPointerSize; | 5193 static const int kBitField3Offset = kCodeCacheOffset + kPointerSize; |
5190 static const int kSize = kBitField3Offset + kPointerSize; | 5194 static const int kSize = kBitField3Offset + kPointerSize; |
5191 | 5195 |
5192 // Layout of pointer fields. Heap iteration code relies on them | 5196 // Layout of pointer fields. Heap iteration code relies on them |
5193 // being continuously allocated. | 5197 // being continuously allocated. |
5194 static const int kPointerFieldsBeginOffset = Map::kPrototypeOffset; | 5198 static const int kPointerFieldsBeginOffset = Map::kPrototypeOffset; |
5195 static const int kPointerFieldsEndOffset = kBitField3Offset + kPointerSize; | 5199 static const int kPointerFieldsEndOffset = kBitField3Offset + kPointerSize; |
5196 | 5200 |
5197 // Byte offsets within kInstanceSizesOffset. | 5201 // Byte offsets within kInstanceSizesOffset. |
5198 static const int kInstanceSizeOffset = kInstanceSizesOffset + 0; | 5202 static const int kInstanceSizeOffset = kInstanceSizesOffset + 0; |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6219 void JSFunctionPrint(FILE* out); | 6223 void JSFunctionPrint(FILE* out); |
6220 #endif | 6224 #endif |
6221 DECLARE_VERIFIER(JSFunction) | 6225 DECLARE_VERIFIER(JSFunction) |
6222 | 6226 |
6223 // Returns the number of allocated literals. | 6227 // Returns the number of allocated literals. |
6224 inline int NumberOfLiterals(); | 6228 inline int NumberOfLiterals(); |
6225 | 6229 |
6226 // Retrieve the native context from a function's literal array. | 6230 // Retrieve the native context from a function's literal array. |
6227 static Context* NativeContextFromLiterals(FixedArray* literals); | 6231 static Context* NativeContextFromLiterals(FixedArray* literals); |
6228 | 6232 |
| 6233 #ifdef DEBUG |
| 6234 bool FunctionsInFunctionListShareSameCode() { |
| 6235 Object* current = this; |
| 6236 while (!current->IsUndefined()) { |
| 6237 JSFunction* function = JSFunction::cast(current); |
| 6238 current = function->next_function_link(); |
| 6239 if (function->code() != this->code()) return false; |
| 6240 } |
| 6241 return true; |
| 6242 } |
| 6243 #endif |
| 6244 |
6229 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to | 6245 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to |
6230 // kSize) is weak and has special handling during garbage collection. | 6246 // kSize) is weak and has special handling during garbage collection. |
6231 static const int kCodeEntryOffset = JSObject::kHeaderSize; | 6247 static const int kCodeEntryOffset = JSObject::kHeaderSize; |
6232 static const int kPrototypeOrInitialMapOffset = | 6248 static const int kPrototypeOrInitialMapOffset = |
6233 kCodeEntryOffset + kPointerSize; | 6249 kCodeEntryOffset + kPointerSize; |
6234 static const int kSharedFunctionInfoOffset = | 6250 static const int kSharedFunctionInfoOffset = |
6235 kPrototypeOrInitialMapOffset + kPointerSize; | 6251 kPrototypeOrInitialMapOffset + kPointerSize; |
6236 static const int kContextOffset = kSharedFunctionInfoOffset + kPointerSize; | 6252 static const int kContextOffset = kSharedFunctionInfoOffset + kPointerSize; |
6237 static const int kLiteralsOffset = kContextOffset + kPointerSize; | 6253 static const int kLiteralsOffset = kContextOffset + kPointerSize; |
6238 static const int kNonWeakFieldsEndOffset = kLiteralsOffset + kPointerSize; | 6254 static const int kNonWeakFieldsEndOffset = kLiteralsOffset + kPointerSize; |
(...skipping 2844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9083 } else { | 9099 } else { |
9084 value &= ~(1 << bit_position); | 9100 value &= ~(1 << bit_position); |
9085 } | 9101 } |
9086 return value; | 9102 return value; |
9087 } | 9103 } |
9088 }; | 9104 }; |
9089 | 9105 |
9090 } } // namespace v8::internal | 9106 } } // namespace v8::internal |
9091 | 9107 |
9092 #endif // V8_OBJECTS_H_ | 9108 #endif // V8_OBJECTS_H_ |
OLD | NEW |