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

Side by Side Diff: src/objects-inl.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/objects-debug.cc ('k') | src/runtime-profiler.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 3013 matching lines...) Expand 10 before | Expand all | Expand 10 after
3024 ACCESSORS(DebugInfo, code, Code, kPatchedCodeIndex) 3024 ACCESSORS(DebugInfo, code, Code, kPatchedCodeIndex)
3025 ACCESSORS(DebugInfo, break_points, FixedArray, kBreakPointsStateIndex) 3025 ACCESSORS(DebugInfo, break_points, FixedArray, kBreakPointsStateIndex)
3026 3026
3027 ACCESSORS(BreakPointInfo, code_position, Smi, kCodePositionIndex) 3027 ACCESSORS(BreakPointInfo, code_position, Smi, kCodePositionIndex)
3028 ACCESSORS(BreakPointInfo, source_position, Smi, kSourcePositionIndex) 3028 ACCESSORS(BreakPointInfo, source_position, Smi, kSourcePositionIndex)
3029 ACCESSORS(BreakPointInfo, statement_position, Smi, kStatementPositionIndex) 3029 ACCESSORS(BreakPointInfo, statement_position, Smi, kStatementPositionIndex)
3030 ACCESSORS(BreakPointInfo, break_point_objects, Object, kBreakPointObjectsIndex) 3030 ACCESSORS(BreakPointInfo, break_point_objects, Object, kBreakPointObjectsIndex)
3031 #endif 3031 #endif
3032 3032
3033 ACCESSORS(SharedFunctionInfo, name, Object, kNameOffset) 3033 ACCESSORS(SharedFunctionInfo, name, Object, kNameOffset)
3034 ACCESSORS_GCSAFE(SharedFunctionInfo, optimized_code_map, Object,
3035 kOptimizedCodeMapOffset)
3034 ACCESSORS_GCSAFE(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset) 3036 ACCESSORS_GCSAFE(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset)
3035 ACCESSORS_GCSAFE(SharedFunctionInfo, initial_map, Object, kInitialMapOffset) 3037 ACCESSORS_GCSAFE(SharedFunctionInfo, initial_map, Object, kInitialMapOffset)
3036 ACCESSORS(SharedFunctionInfo, instance_class_name, Object, 3038 ACCESSORS(SharedFunctionInfo, instance_class_name, Object,
3037 kInstanceClassNameOffset) 3039 kInstanceClassNameOffset)
3038 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset) 3040 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset)
3039 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset) 3041 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset)
3040 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset) 3042 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset)
3041 ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset) 3043 ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset)
3042 ACCESSORS(SharedFunctionInfo, this_property_assignments, Object, 3044 ACCESSORS(SharedFunctionInfo, this_property_assignments, Object,
3043 kThisPropertyAssignmentsOffset) 3045 kThisPropertyAssignmentsOffset)
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
3182 } 3184 }
3183 3185
3184 3186
3185 void SharedFunctionInfo::set_strict_mode(bool value) { 3187 void SharedFunctionInfo::set_strict_mode(bool value) {
3186 set_compiler_hints(BooleanBit::set(compiler_hints(), 3188 set_compiler_hints(BooleanBit::set(compiler_hints(),
3187 kStrictModeFunction, 3189 kStrictModeFunction,
3188 value)); 3190 value));
3189 } 3191 }
3190 3192
3191 3193
3194 void SharedFunctionInfo::BeforeVisitingPointers() {
3195 if (IsInobjectSlackTrackingInProgress()) DetachInitialMap();
3196
3197 // Flush optimized code map on major GC.
3198 // Note: we may experiment with rebuilding it or retaining entries
3199 // which should survive as we iterate through optimized functions
3200 // anyway.
3201 set_optimized_code_map(Smi::FromInt(0));
3202 }
3203
3204
3192 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset) 3205 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset)
3193 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset) 3206 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset)
3194 3207
3195 bool Script::HasValidSource() { 3208 bool Script::HasValidSource() {
3196 Object* src = this->source(); 3209 Object* src = this->source();
3197 if (!src->IsString()) return true; 3210 if (!src->IsString()) return true;
3198 String* src_str = String::cast(src); 3211 String* src_str = String::cast(src);
3199 if (!StringShape(src_str).IsExternal()) return true; 3212 if (!StringShape(src_str).IsExternal()) return true;
3200 if (src_str->IsAsciiRepresentation()) { 3213 if (src_str->IsAsciiRepresentation()) {
3201 return ExternalAsciiString::cast(src)->resource() != NULL; 3214 return ExternalAsciiString::cast(src)->resource() != NULL;
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
4157 #undef WRITE_INT_FIELD 4170 #undef WRITE_INT_FIELD
4158 #undef READ_SHORT_FIELD 4171 #undef READ_SHORT_FIELD
4159 #undef WRITE_SHORT_FIELD 4172 #undef WRITE_SHORT_FIELD
4160 #undef READ_BYTE_FIELD 4173 #undef READ_BYTE_FIELD
4161 #undef WRITE_BYTE_FIELD 4174 #undef WRITE_BYTE_FIELD
4162 4175
4163 4176
4164 } } // namespace v8::internal 4177 } } // namespace v8::internal
4165 4178
4166 #endif // V8_OBJECTS_INL_H_ 4179 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects-debug.cc ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698