Chromium Code Reviews| 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 5138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5149 // SharedFunctionInfo describes the JSFunction information that can be | 5149 // SharedFunctionInfo describes the JSFunction information that can be |
| 5150 // shared by multiple instances of the function. | 5150 // shared by multiple instances of the function. |
| 5151 class SharedFunctionInfo: public HeapObject { | 5151 class SharedFunctionInfo: public HeapObject { |
| 5152 public: | 5152 public: |
| 5153 // [name]: Function name. | 5153 // [name]: Function name. |
| 5154 DECL_ACCESSORS(name, Object) | 5154 DECL_ACCESSORS(name, Object) |
| 5155 | 5155 |
| 5156 // [code]: Function code. | 5156 // [code]: Function code. |
| 5157 DECL_ACCESSORS(code, Code) | 5157 DECL_ACCESSORS(code, Code) |
| 5158 | 5158 |
| 5159 // [optimized_code_map]: Map from global context to optimized code | |
| 5160 // and a shared literals array or Smi 0 if none. | |
| 5161 DECL_ACCESSORS(optimized_code_map, Object) | |
| 5162 | |
| 5163 // Returns index i of the entry with the specified context. At position | |
| 5164 // i - 1 is the context, position i the code, and i + 1 the literals array. | |
|
Michael Starzinger
2012/05/23 11:16:29
Can we add a comment about what happens when no en
fschneider
2012/06/14 11:08:23
Done.
| |
| 5165 int SearchOptimizedCodeMap(Context* global_context); | |
| 5166 | |
| 5159 // [scope_info]: Scope info. | 5167 // [scope_info]: Scope info. |
| 5160 DECL_ACCESSORS(scope_info, ScopeInfo) | 5168 DECL_ACCESSORS(scope_info, ScopeInfo) |
| 5161 | 5169 |
| 5162 // [construct stub]: Code stub for constructing instances of this function. | 5170 // [construct stub]: Code stub for constructing instances of this function. |
| 5163 DECL_ACCESSORS(construct_stub, Code) | 5171 DECL_ACCESSORS(construct_stub, Code) |
| 5164 | 5172 |
| 5165 inline Code* unchecked_code(); | 5173 inline Code* unchecked_code(); |
| 5166 | 5174 |
| 5167 // Returns if this function has been compiled to native code yet. | 5175 // Returns if this function has been compiled to native code yet. |
| 5168 inline bool is_compiled(); | 5176 inline bool is_compiled(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5256 // Stores the initial map and installs the countdown stub. | 5264 // Stores the initial map and installs the countdown stub. |
| 5257 // IsInobjectSlackTrackingInProgress is normally true after this call, | 5265 // IsInobjectSlackTrackingInProgress is normally true after this call, |
| 5258 // except when tracking have not been started (e.g. the map has no unused | 5266 // except when tracking have not been started (e.g. the map has no unused |
| 5259 // properties or the snapshot is being built). | 5267 // properties or the snapshot is being built). |
| 5260 void StartInobjectSlackTracking(Map* map); | 5268 void StartInobjectSlackTracking(Map* map); |
| 5261 | 5269 |
| 5262 // Completes the tracking. | 5270 // Completes the tracking. |
| 5263 // IsInobjectSlackTrackingInProgress is false after this call. | 5271 // IsInobjectSlackTrackingInProgress is false after this call. |
| 5264 void CompleteInobjectSlackTracking(); | 5272 void CompleteInobjectSlackTracking(); |
| 5265 | 5273 |
| 5274 // Invoked before pointers in SharedFunctionInfo are being marked. | |
|
Michael Starzinger
2012/05/23 11:16:29
It would be nice to also have a short comment what
fschneider
2012/06/14 11:08:23
Done.
| |
| 5275 inline void BeforeVisitingPointers(); | |
| 5276 | |
| 5266 // Clears the initial_map before the GC marking phase to ensure the reference | 5277 // Clears the initial_map before the GC marking phase to ensure the reference |
| 5267 // is weak. IsInobjectSlackTrackingInProgress is false after this call. | 5278 // is weak. IsInobjectSlackTrackingInProgress is false after this call. |
| 5268 void DetachInitialMap(); | 5279 void DetachInitialMap(); |
| 5269 | 5280 |
| 5270 // Restores the link to the initial map after the GC marking phase. | 5281 // Restores the link to the initial map after the GC marking phase. |
| 5271 // IsInobjectSlackTrackingInProgress is true after this call. | 5282 // IsInobjectSlackTrackingInProgress is true after this call. |
| 5272 void AttachInitialMap(Map* map); | 5283 void AttachInitialMap(Map* map); |
| 5273 | 5284 |
| 5274 // False if there are definitely no live objects created from this function. | 5285 // False if there are definitely no live objects created from this function. |
| 5275 // True if live objects _may_ exist (existence not guaranteed). | 5286 // True if live objects _may_ exist (existence not guaranteed). |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5516 // Casting. | 5527 // Casting. |
| 5517 static inline SharedFunctionInfo* cast(Object* obj); | 5528 static inline SharedFunctionInfo* cast(Object* obj); |
| 5518 | 5529 |
| 5519 // Constants. | 5530 // Constants. |
| 5520 static const int kDontAdaptArgumentsSentinel = -1; | 5531 static const int kDontAdaptArgumentsSentinel = -1; |
| 5521 | 5532 |
| 5522 // Layout description. | 5533 // Layout description. |
| 5523 // Pointer fields. | 5534 // Pointer fields. |
| 5524 static const int kNameOffset = HeapObject::kHeaderSize; | 5535 static const int kNameOffset = HeapObject::kHeaderSize; |
| 5525 static const int kCodeOffset = kNameOffset + kPointerSize; | 5536 static const int kCodeOffset = kNameOffset + kPointerSize; |
| 5526 static const int kScopeInfoOffset = kCodeOffset + kPointerSize; | 5537 static const int kOptimizedCodeMapOffset = kCodeOffset + kPointerSize; |
| 5538 static const int kScopeInfoOffset = kOptimizedCodeMapOffset + kPointerSize; | |
| 5527 static const int kConstructStubOffset = kScopeInfoOffset + kPointerSize; | 5539 static const int kConstructStubOffset = kScopeInfoOffset + kPointerSize; |
| 5528 static const int kInstanceClassNameOffset = | 5540 static const int kInstanceClassNameOffset = |
| 5529 kConstructStubOffset + kPointerSize; | 5541 kConstructStubOffset + kPointerSize; |
| 5530 static const int kFunctionDataOffset = | 5542 static const int kFunctionDataOffset = |
| 5531 kInstanceClassNameOffset + kPointerSize; | 5543 kInstanceClassNameOffset + kPointerSize; |
| 5532 static const int kScriptOffset = kFunctionDataOffset + kPointerSize; | 5544 static const int kScriptOffset = kFunctionDataOffset + kPointerSize; |
| 5533 static const int kDebugInfoOffset = kScriptOffset + kPointerSize; | 5545 static const int kDebugInfoOffset = kScriptOffset + kPointerSize; |
| 5534 static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize; | 5546 static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize; |
| 5535 static const int kInitialMapOffset = | 5547 static const int kInitialMapOffset = |
| 5536 kInferredNameOffset + kPointerSize; | 5548 kInferredNameOffset + kPointerSize; |
| (...skipping 3123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8660 } else { | 8672 } else { |
| 8661 value &= ~(1 << bit_position); | 8673 value &= ~(1 << bit_position); |
| 8662 } | 8674 } |
| 8663 return value; | 8675 return value; |
| 8664 } | 8676 } |
| 8665 }; | 8677 }; |
| 8666 | 8678 |
| 8667 } } // namespace v8::internal | 8679 } } // namespace v8::internal |
| 8668 | 8680 |
| 8669 #endif // V8_OBJECTS_H_ | 8681 #endif // V8_OBJECTS_H_ |
| OLD | NEW |