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

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

Issue 10265008: Revert r11425 because of V8 benchmark performance regression. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 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.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 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 3493 matching lines...) Expand 10 before | Expand all | Expand 10 after
3504 ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset) 3504 ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset)
3505 ACCESSORS(SharedFunctionInfo, initial_map, Object, kInitialMapOffset) 3505 ACCESSORS(SharedFunctionInfo, initial_map, Object, kInitialMapOffset)
3506 ACCESSORS(SharedFunctionInfo, instance_class_name, Object, 3506 ACCESSORS(SharedFunctionInfo, instance_class_name, Object,
3507 kInstanceClassNameOffset) 3507 kInstanceClassNameOffset)
3508 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset) 3508 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset)
3509 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset) 3509 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset)
3510 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset) 3510 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset)
3511 ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset) 3511 ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset)
3512 ACCESSORS(SharedFunctionInfo, this_property_assignments, Object, 3512 ACCESSORS(SharedFunctionInfo, this_property_assignments, Object,
3513 kThisPropertyAssignmentsOffset) 3513 kThisPropertyAssignmentsOffset)
3514 SMI_ACCESSORS(SharedFunctionInfo, ic_age, kICAgeOffset)
3514 3515
3515 3516
3516 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, 3517 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype,
3517 kHiddenPrototypeBit) 3518 kHiddenPrototypeBit)
3518 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) 3519 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit)
3519 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, 3520 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check,
3520 kNeedsAccessCheckBit) 3521 kNeedsAccessCheckBit)
3521 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype, 3522 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype,
3522 kReadOnlyPrototypeBit) 3523 kReadOnlyPrototypeBit)
3523 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression, 3524 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression,
(...skipping 30 matching lines...) Expand all
3554 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) 3555 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset)
3555 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, 3556 SMI_ACCESSORS(SharedFunctionInfo, function_token_position,
3556 kFunctionTokenPositionOffset) 3557 kFunctionTokenPositionOffset)
3557 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, 3558 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints,
3558 kCompilerHintsOffset) 3559 kCompilerHintsOffset)
3559 SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count, 3560 SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count,
3560 kThisPropertyAssignmentsCountOffset) 3561 kThisPropertyAssignmentsCountOffset)
3561 SMI_ACCESSORS(SharedFunctionInfo, opt_count, kOptCountOffset) 3562 SMI_ACCESSORS(SharedFunctionInfo, opt_count, kOptCountOffset)
3562 SMI_ACCESSORS(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset) 3563 SMI_ACCESSORS(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset)
3563 SMI_ACCESSORS(SharedFunctionInfo, deopt_counter, kDeoptCounterOffset) 3564 SMI_ACCESSORS(SharedFunctionInfo, deopt_counter, kDeoptCounterOffset)
3564 SMI_ACCESSORS(SharedFunctionInfo, ic_age, kICAgeOffset)
3565 SMI_ACCESSORS(SharedFunctionInfo, opt_reenable_tries, kOptReenableTriesOffset)
3566 #else 3565 #else
3567 3566
3568 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ 3567 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \
3569 STATIC_ASSERT(holder::offset % kPointerSize == 0); \ 3568 STATIC_ASSERT(holder::offset % kPointerSize == 0); \
3570 int holder::name() { \ 3569 int holder::name() { \
3571 int value = READ_INT_FIELD(this, offset); \ 3570 int value = READ_INT_FIELD(this, offset); \
3572 ASSERT(kHeapObjectTag == 1); \ 3571 ASSERT(kHeapObjectTag == 1); \
3573 ASSERT((value & kHeapObjectTag) == 0); \ 3572 ASSERT((value & kHeapObjectTag) == 0); \
3574 return value >> 1; \ 3573 return value >> 1; \
3575 } \ 3574 } \
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
3609 compiler_hints, 3608 compiler_hints,
3610 kCompilerHintsOffset) 3609 kCompilerHintsOffset)
3611 3610
3612 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, 3611 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo,
3613 this_property_assignments_count, 3612 this_property_assignments_count,
3614 kThisPropertyAssignmentsCountOffset) 3613 kThisPropertyAssignmentsCountOffset)
3615 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, opt_count, kOptCountOffset) 3614 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, opt_count, kOptCountOffset)
3616 3615
3617 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset) 3616 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset)
3618 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, deopt_counter, kDeoptCounterOffset) 3617 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, deopt_counter, kDeoptCounterOffset)
3619
3620 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, ic_age, kICAgeOffset)
3621 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo,
3622 opt_reenable_tries,
3623 kOptReenableTriesOffset)
3624 #endif 3618 #endif
3625 3619
3626 3620
3627 int SharedFunctionInfo::construction_count() { 3621 int SharedFunctionInfo::construction_count() {
3628 return READ_BYTE_FIELD(this, kConstructionCountOffset); 3622 return READ_BYTE_FIELD(this, kConstructionCountOffset);
3629 } 3623 }
3630 3624
3631 3625
3632 void SharedFunctionInfo::set_construction_count(int value) { 3626 void SharedFunctionInfo::set_construction_count(int value) {
3633 ASSERT(0 <= value && value < 256); 3627 ASSERT(0 <= value && value < 256);
(...skipping 19 matching lines...) Expand all
3653 3647
3654 3648
3655 void SharedFunctionInfo::set_optimization_disabled(bool disable) { 3649 void SharedFunctionInfo::set_optimization_disabled(bool disable) {
3656 set_compiler_hints(BooleanBit::set(compiler_hints(), 3650 set_compiler_hints(BooleanBit::set(compiler_hints(),
3657 kOptimizationDisabled, 3651 kOptimizationDisabled,
3658 disable)); 3652 disable));
3659 // If disabling optimizations we reflect that in the code object so 3653 // If disabling optimizations we reflect that in the code object so
3660 // it will not be counted as optimizable code. 3654 // it will not be counted as optimizable code.
3661 if ((code()->kind() == Code::FUNCTION) && disable) { 3655 if ((code()->kind() == Code::FUNCTION) && disable) {
3662 code()->set_optimizable(false); 3656 code()->set_optimizable(false);
3663 code()->set_profiler_ticks(0);
3664 } 3657 }
3665 } 3658 }
3666 3659
3667 3660
3668 LanguageMode SharedFunctionInfo::language_mode() { 3661 LanguageMode SharedFunctionInfo::language_mode() {
3669 int hints = compiler_hints(); 3662 int hints = compiler_hints();
3670 if (BooleanBit::get(hints, kExtendedModeFunction)) { 3663 if (BooleanBit::get(hints, kExtendedModeFunction)) {
3671 ASSERT(BooleanBit::get(hints, kStrictModeFunction)); 3664 ASSERT(BooleanBit::get(hints, kStrictModeFunction));
3672 return EXTENDED_MODE; 3665 return EXTENDED_MODE;
3673 } 3666 }
(...skipping 15 matching lines...) Expand all
3689 hints = BooleanBit::set( 3682 hints = BooleanBit::set(
3690 hints, kExtendedModeFunction, language_mode == EXTENDED_MODE); 3683 hints, kExtendedModeFunction, language_mode == EXTENDED_MODE);
3691 set_compiler_hints(hints); 3684 set_compiler_hints(hints);
3692 } 3685 }
3693 3686
3694 3687
3695 bool SharedFunctionInfo::is_classic_mode() { 3688 bool SharedFunctionInfo::is_classic_mode() {
3696 return !BooleanBit::get(compiler_hints(), kStrictModeFunction); 3689 return !BooleanBit::get(compiler_hints(), kStrictModeFunction);
3697 } 3690 }
3698 3691
3699
3700 void SharedFunctionInfo::TryReenableOptimization() {
3701 int tries = opt_reenable_tries();
3702 if (tries == Smi::kMaxValue) {
3703 tries = 0;
3704 }
3705 set_opt_reenable_tries(tries + 1);
3706 // We reenable optimization whenever the number of tries is a large
3707 // enough power of 2.
3708 if (tries >= 4 && (((tries - 1) & tries) == 0)) {
3709 set_optimization_disabled(false);
3710 set_opt_count(0);
3711 code()->set_optimizable(true);
3712 }
3713 }
3714
3715
3716 BOOL_GETTER(SharedFunctionInfo, compiler_hints, is_extended_mode, 3692 BOOL_GETTER(SharedFunctionInfo, compiler_hints, is_extended_mode,
3717 kExtendedModeFunction) 3693 kExtendedModeFunction)
3718 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative) 3694 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative)
3719 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, 3695 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints,
3720 name_should_print_as_anonymous, 3696 name_should_print_as_anonymous,
3721 kNameShouldPrintAsAnonymous) 3697 kNameShouldPrintAsAnonymous)
3722 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, bound, kBoundFunction) 3698 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, bound, kBoundFunction)
3723 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous, kIsAnonymous) 3699 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous, kIsAnonymous)
3724 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_function, kIsFunction) 3700 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_function, kIsFunction)
3725 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_optimize, 3701 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_optimize,
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
4966 #undef WRITE_UINT32_FIELD 4942 #undef WRITE_UINT32_FIELD
4967 #undef READ_SHORT_FIELD 4943 #undef READ_SHORT_FIELD
4968 #undef WRITE_SHORT_FIELD 4944 #undef WRITE_SHORT_FIELD
4969 #undef READ_BYTE_FIELD 4945 #undef READ_BYTE_FIELD
4970 #undef WRITE_BYTE_FIELD 4946 #undef WRITE_BYTE_FIELD
4971 4947
4972 4948
4973 } } // namespace v8::internal 4949 } } // namespace v8::internal
4974 4950
4975 #endif // V8_OBJECTS_INL_H_ 4951 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698