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

Side by Side Diff: src/objects-inl.h

Issue 248953002: Sort functions in polymorphic calls based on overall profiling ticks and inlined AST size. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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.h ('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 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 5181 matching lines...) Expand 10 before | Expand all | Expand 10 after
5192 ACCESSORS(SharedFunctionInfo, optimized_code_map, Object, 5192 ACCESSORS(SharedFunctionInfo, optimized_code_map, Object,
5193 kOptimizedCodeMapOffset) 5193 kOptimizedCodeMapOffset)
5194 ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset) 5194 ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset)
5195 ACCESSORS(SharedFunctionInfo, initial_map, Object, kInitialMapOffset) 5195 ACCESSORS(SharedFunctionInfo, initial_map, Object, kInitialMapOffset)
5196 ACCESSORS(SharedFunctionInfo, instance_class_name, Object, 5196 ACCESSORS(SharedFunctionInfo, instance_class_name, Object,
5197 kInstanceClassNameOffset) 5197 kInstanceClassNameOffset)
5198 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset) 5198 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset)
5199 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset) 5199 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset)
5200 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset) 5200 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset)
5201 ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset) 5201 ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset)
5202 SMI_ACCESSORS(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset)
5203 5202
5204 5203
5205 SMI_ACCESSORS(FunctionTemplateInfo, length, kLengthOffset) 5204 SMI_ACCESSORS(FunctionTemplateInfo, length, kLengthOffset)
5206 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, 5205 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype,
5207 kHiddenPrototypeBit) 5206 kHiddenPrototypeBit)
5208 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) 5207 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit)
5209 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, 5208 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check,
5210 kNeedsAccessCheckBit) 5209 kNeedsAccessCheckBit)
5211 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype, 5210 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype,
5212 kReadOnlyPrototypeBit) 5211 kReadOnlyPrototypeBit)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
5247 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, 5246 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type,
5248 kStartPositionAndTypeOffset) 5247 kStartPositionAndTypeOffset)
5249 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) 5248 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset)
5250 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, 5249 SMI_ACCESSORS(SharedFunctionInfo, function_token_position,
5251 kFunctionTokenPositionOffset) 5250 kFunctionTokenPositionOffset)
5252 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, 5251 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints,
5253 kCompilerHintsOffset) 5252 kCompilerHintsOffset)
5254 SMI_ACCESSORS(SharedFunctionInfo, opt_count_and_bailout_reason, 5253 SMI_ACCESSORS(SharedFunctionInfo, opt_count_and_bailout_reason,
5255 kOptCountAndBailoutReasonOffset) 5254 kOptCountAndBailoutReasonOffset)
5256 SMI_ACCESSORS(SharedFunctionInfo, counters, kCountersOffset) 5255 SMI_ACCESSORS(SharedFunctionInfo, counters, kCountersOffset)
5256 SMI_ACCESSORS(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset)
5257 SMI_ACCESSORS(SharedFunctionInfo, profiler_ticks, kProfilerTicksOffset)
5257 5258
5258 #else 5259 #else
5259 5260
5260 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ 5261 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \
5261 STATIC_ASSERT(holder::offset % kPointerSize == 0); \ 5262 STATIC_ASSERT(holder::offset % kPointerSize == 0); \
5262 int holder::name() { \ 5263 int holder::name() { \
5263 int value = READ_INT_FIELD(this, offset); \ 5264 int value = READ_INT_FIELD(this, offset); \
5264 ASSERT(kHeapObjectTag == 1); \ 5265 ASSERT(kHeapObjectTag == 1); \
5265 ASSERT((value & kHeapObjectTag) == 0); \ 5266 ASSERT((value & kHeapObjectTag) == 0); \
5266 return value >> 1; \ 5267 return value >> 1; \
(...skipping 30 matching lines...) Expand all
5297 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, 5298 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo,
5298 function_token_position, 5299 function_token_position,
5299 kFunctionTokenPositionOffset) 5300 kFunctionTokenPositionOffset)
5300 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, 5301 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo,
5301 compiler_hints, 5302 compiler_hints,
5302 kCompilerHintsOffset) 5303 kCompilerHintsOffset)
5303 5304
5304 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, 5305 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo,
5305 opt_count_and_bailout_reason, 5306 opt_count_and_bailout_reason,
5306 kOptCountAndBailoutReasonOffset) 5307 kOptCountAndBailoutReasonOffset)
5308 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, counters, kCountersOffset)
5307 5309
5308 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, counters, kCountersOffset) 5310 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo,
5311 ast_node_count,
5312 kAstNodeCountOffset)
5313 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo,
5314 profiler_ticks,
5315 kProfilerTicksOffset)
5309 5316
5310 #endif 5317 #endif
5311 5318
5312 5319
5313 int SharedFunctionInfo::construction_count() { 5320 int SharedFunctionInfo::construction_count() {
5314 return READ_BYTE_FIELD(this, kConstructionCountOffset); 5321 return READ_BYTE_FIELD(this, kConstructionCountOffset);
5315 } 5322 }
5316 5323
5317 5324
5318 void SharedFunctionInfo::set_construction_count(int value) { 5325 void SharedFunctionInfo::set_construction_count(int value) {
(...skipping 24 matching lines...) Expand all
5343 kOptimizationDisabled, 5350 kOptimizationDisabled,
5344 disable)); 5351 disable));
5345 // If disabling optimizations we reflect that in the code object so 5352 // If disabling optimizations we reflect that in the code object so
5346 // it will not be counted as optimizable code. 5353 // it will not be counted as optimizable code.
5347 if ((code()->kind() == Code::FUNCTION) && disable) { 5354 if ((code()->kind() == Code::FUNCTION) && disable) {
5348 code()->set_optimizable(false); 5355 code()->set_optimizable(false);
5349 } 5356 }
5350 } 5357 }
5351 5358
5352 5359
5353 int SharedFunctionInfo::profiler_ticks() {
5354 if (code()->kind() != Code::FUNCTION) return 0;
5355 return code()->profiler_ticks();
5356 }
5357
5358
5359 StrictMode SharedFunctionInfo::strict_mode() { 5360 StrictMode SharedFunctionInfo::strict_mode() {
5360 return BooleanBit::get(compiler_hints(), kStrictModeFunction) 5361 return BooleanBit::get(compiler_hints(), kStrictModeFunction)
5361 ? STRICT : SLOPPY; 5362 ? STRICT : SLOPPY;
5362 } 5363 }
5363 5364
5364 5365
5365 void SharedFunctionInfo::set_strict_mode(StrictMode strict_mode) { 5366 void SharedFunctionInfo::set_strict_mode(StrictMode strict_mode) {
5366 // We only allow mode transitions from sloppy to strict. 5367 // We only allow mode transitions from sloppy to strict.
5367 ASSERT(this->strict_mode() == SLOPPY || this->strict_mode() == strict_mode); 5368 ASSERT(this->strict_mode() == SLOPPY || this->strict_mode() == strict_mode);
5368 int hints = compiler_hints(); 5369 int hints = compiler_hints();
(...skipping 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after
7019 #undef READ_SHORT_FIELD 7020 #undef READ_SHORT_FIELD
7020 #undef WRITE_SHORT_FIELD 7021 #undef WRITE_SHORT_FIELD
7021 #undef READ_BYTE_FIELD 7022 #undef READ_BYTE_FIELD
7022 #undef WRITE_BYTE_FIELD 7023 #undef WRITE_BYTE_FIELD
7023 #undef NOBARRIER_READ_BYTE_FIELD 7024 #undef NOBARRIER_READ_BYTE_FIELD
7024 #undef NOBARRIER_WRITE_BYTE_FIELD 7025 #undef NOBARRIER_WRITE_BYTE_FIELD
7025 7026
7026 } } // namespace v8::internal 7027 } } // namespace v8::internal
7027 7028
7028 #endif // V8_OBJECTS_INL_H_ 7029 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698