Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Side by Side Diff: src/objects.h

Issue 6793013: Cache optimized code on shared function info. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mark-compact.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4033 matching lines...) Expand 10 before | Expand all | Expand 10 after
4044 // SharedFunctionInfo describes the JSFunction information that can be 4044 // SharedFunctionInfo describes the JSFunction information that can be
4045 // shared by multiple instances of the function. 4045 // shared by multiple instances of the function.
4046 class SharedFunctionInfo: public HeapObject { 4046 class SharedFunctionInfo: public HeapObject {
4047 public: 4047 public:
4048 // [name]: Function name. 4048 // [name]: Function name.
4049 DECL_ACCESSORS(name, Object) 4049 DECL_ACCESSORS(name, Object)
4050 4050
4051 // [code]: Function code. 4051 // [code]: Function code.
4052 DECL_ACCESSORS(code, Code) 4052 DECL_ACCESSORS(code, Code)
4053 4053
4054 // [optimized_code_map]: Map from global context to optimized code
4055 // or Smi 0 if none.
4056 DECL_ACCESSORS(optimized_code_map, Object)
4057
4058 Code* SearchOptimizedCodeMap(Context* global_context);
4059
4054 // [scope_info]: Scope info. 4060 // [scope_info]: Scope info.
4055 DECL_ACCESSORS(scope_info, SerializedScopeInfo) 4061 DECL_ACCESSORS(scope_info, SerializedScopeInfo)
4056 4062
4057 // [construct stub]: Code stub for constructing instances of this function. 4063 // [construct stub]: Code stub for constructing instances of this function.
4058 DECL_ACCESSORS(construct_stub, Code) 4064 DECL_ACCESSORS(construct_stub, Code)
4059 4065
4060 inline Code* unchecked_code(); 4066 inline Code* unchecked_code();
4061 4067
4062 // Returns if this function has been compiled to native code yet. 4068 // Returns if this function has been compiled to native code yet.
4063 inline bool is_compiled(); 4069 inline bool is_compiled();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
4151 // Stores the initial map and installs the countdown stub. 4157 // Stores the initial map and installs the countdown stub.
4152 // IsInobjectSlackTrackingInProgress is normally true after this call, 4158 // IsInobjectSlackTrackingInProgress is normally true after this call,
4153 // except when tracking have not been started (e.g. the map has no unused 4159 // except when tracking have not been started (e.g. the map has no unused
4154 // properties or the snapshot is being built). 4160 // properties or the snapshot is being built).
4155 void StartInobjectSlackTracking(Map* map); 4161 void StartInobjectSlackTracking(Map* map);
4156 4162
4157 // Completes the tracking. 4163 // Completes the tracking.
4158 // IsInobjectSlackTrackingInProgress is false after this call. 4164 // IsInobjectSlackTrackingInProgress is false after this call.
4159 void CompleteInobjectSlackTracking(); 4165 void CompleteInobjectSlackTracking();
4160 4166
4167 // Invoked before pointers in SharedFunctionInfo are being marked.
4168 inline void BeforeVisitingPointers();
4169
4161 // Clears the initial_map before the GC marking phase to ensure the reference 4170 // Clears the initial_map before the GC marking phase to ensure the reference
4162 // is weak. IsInobjectSlackTrackingInProgress is false after this call. 4171 // is weak. IsInobjectSlackTrackingInProgress is false after this call.
4163 void DetachInitialMap(); 4172 void DetachInitialMap();
4164 4173
4165 // Restores the link to the initial map after the GC marking phase. 4174 // Restores the link to the initial map after the GC marking phase.
4166 // IsInobjectSlackTrackingInProgress is true after this call. 4175 // IsInobjectSlackTrackingInProgress is true after this call.
4167 void AttachInitialMap(Map* map); 4176 void AttachInitialMap(Map* map);
4168 4177
4169 // False if there are definitely no live objects created from this function. 4178 // False if there are definitely no live objects created from this function.
4170 // True if live objects _may_ exist (existence not guaranteed). 4179 // True if live objects _may_ exist (existence not guaranteed).
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
4346 // Casting. 4355 // Casting.
4347 static inline SharedFunctionInfo* cast(Object* obj); 4356 static inline SharedFunctionInfo* cast(Object* obj);
4348 4357
4349 // Constants. 4358 // Constants.
4350 static const int kDontAdaptArgumentsSentinel = -1; 4359 static const int kDontAdaptArgumentsSentinel = -1;
4351 4360
4352 // Layout description. 4361 // Layout description.
4353 // Pointer fields. 4362 // Pointer fields.
4354 static const int kNameOffset = HeapObject::kHeaderSize; 4363 static const int kNameOffset = HeapObject::kHeaderSize;
4355 static const int kCodeOffset = kNameOffset + kPointerSize; 4364 static const int kCodeOffset = kNameOffset + kPointerSize;
4356 static const int kScopeInfoOffset = kCodeOffset + kPointerSize; 4365 static const int kOptimizedCodeMapOffset = kCodeOffset + kPointerSize;
4366 static const int kScopeInfoOffset = kOptimizedCodeMapOffset + kPointerSize;
4357 static const int kConstructStubOffset = kScopeInfoOffset + kPointerSize; 4367 static const int kConstructStubOffset = kScopeInfoOffset + kPointerSize;
4358 static const int kInstanceClassNameOffset = 4368 static const int kInstanceClassNameOffset =
4359 kConstructStubOffset + kPointerSize; 4369 kConstructStubOffset + kPointerSize;
4360 static const int kFunctionDataOffset = 4370 static const int kFunctionDataOffset =
4361 kInstanceClassNameOffset + kPointerSize; 4371 kInstanceClassNameOffset + kPointerSize;
4362 static const int kScriptOffset = kFunctionDataOffset + kPointerSize; 4372 static const int kScriptOffset = kFunctionDataOffset + kPointerSize;
4363 static const int kDebugInfoOffset = kScriptOffset + kPointerSize; 4373 static const int kDebugInfoOffset = kScriptOffset + kPointerSize;
4364 static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize; 4374 static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize;
4365 static const int kInitialMapOffset = 4375 static const int kInitialMapOffset =
4366 kInferredNameOffset + kPointerSize; 4376 kInferredNameOffset + kPointerSize;
(...skipping 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after
6653 } else { 6663 } else {
6654 value &= ~(1 << bit_position); 6664 value &= ~(1 << bit_position);
6655 } 6665 }
6656 return value; 6666 return value;
6657 } 6667 }
6658 }; 6668 };
6659 6669
6660 } } // namespace v8::internal 6670 } } // namespace v8::internal
6661 6671
6662 #endif // V8_OBJECTS_H_ 6672 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698