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

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

Issue 9221011: Collect AstNode type information (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback (embedded AstProperties and AstConstructionVisitor) Created 8 years, 10 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
« src/ast.h ('K') | « src/objects.h ('k') | src/parser.h » ('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 3538 matching lines...) Expand 10 before | Expand all | Expand 10 after
3549 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, 3549 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type,
3550 kStartPositionAndTypeOffset) 3550 kStartPositionAndTypeOffset)
3551 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) 3551 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset)
3552 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, 3552 SMI_ACCESSORS(SharedFunctionInfo, function_token_position,
3553 kFunctionTokenPositionOffset) 3553 kFunctionTokenPositionOffset)
3554 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, 3554 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints,
3555 kCompilerHintsOffset) 3555 kCompilerHintsOffset)
3556 SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count, 3556 SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count,
3557 kThisPropertyAssignmentsCountOffset) 3557 kThisPropertyAssignmentsCountOffset)
3558 SMI_ACCESSORS(SharedFunctionInfo, opt_count, kOptCountOffset) 3558 SMI_ACCESSORS(SharedFunctionInfo, opt_count, kOptCountOffset)
3559 SMI_ACCESSORS(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset)
3560 SMI_ACCESSORS(SharedFunctionInfo, deopt_counter, kDeoptCounterOffset)
3559 #else 3561 #else
3560 3562
3561 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ 3563 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \
3562 STATIC_ASSERT(holder::offset % kPointerSize == 0); \ 3564 STATIC_ASSERT(holder::offset % kPointerSize == 0); \
3563 int holder::name() { \ 3565 int holder::name() { \
3564 int value = READ_INT_FIELD(this, offset); \ 3566 int value = READ_INT_FIELD(this, offset); \
3565 ASSERT(kHeapObjectTag == 1); \ 3567 ASSERT(kHeapObjectTag == 1); \
3566 ASSERT((value & kHeapObjectTag) == 0); \ 3568 ASSERT((value & kHeapObjectTag) == 0); \
3567 return value >> 1; \ 3569 return value >> 1; \
3568 } \ 3570 } \
(...skipping 30 matching lines...) Expand all
3599 function_token_position, 3601 function_token_position,
3600 kFunctionTokenPositionOffset) 3602 kFunctionTokenPositionOffset)
3601 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, 3603 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo,
3602 compiler_hints, 3604 compiler_hints,
3603 kCompilerHintsOffset) 3605 kCompilerHintsOffset)
3604 3606
3605 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, 3607 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo,
3606 this_property_assignments_count, 3608 this_property_assignments_count,
3607 kThisPropertyAssignmentsCountOffset) 3609 kThisPropertyAssignmentsCountOffset)
3608 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, opt_count, kOptCountOffset) 3610 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, opt_count, kOptCountOffset)
3611
3612 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset)
3613 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, deopt_counter, kDeoptCounterOffset)
3609 #endif 3614 #endif
3610 3615
3611 3616
3612 int SharedFunctionInfo::construction_count() { 3617 int SharedFunctionInfo::construction_count() {
3613 return READ_BYTE_FIELD(this, kConstructionCountOffset); 3618 return READ_BYTE_FIELD(this, kConstructionCountOffset);
3614 } 3619 }
3615 3620
3616 3621
3617 void SharedFunctionInfo::set_construction_count(int value) { 3622 void SharedFunctionInfo::set_construction_count(int value) {
3618 ASSERT(0 <= value && value < 256); 3623 ASSERT(0 <= value && value < 256);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
3681 } 3686 }
3682 3687
3683 BOOL_GETTER(SharedFunctionInfo, compiler_hints, is_extended_mode, 3688 BOOL_GETTER(SharedFunctionInfo, compiler_hints, is_extended_mode,
3684 kExtendedModeFunction) 3689 kExtendedModeFunction)
3685 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative) 3690 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative)
3686 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, 3691 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints,
3687 name_should_print_as_anonymous, 3692 name_should_print_as_anonymous,
3688 kNameShouldPrintAsAnonymous) 3693 kNameShouldPrintAsAnonymous)
3689 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, bound, kBoundFunction) 3694 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, bound, kBoundFunction)
3690 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous, kIsAnonymous) 3695 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous, kIsAnonymous)
3696 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_crankshaft,
3697 kDontCrankshaft)
3698 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_inline, kDontInline)
3691 3699
3692 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset) 3700 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset)
3693 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset) 3701 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset)
3694 3702
3695 ACCESSORS(PolymorphicCodeCache, cache, Object, kCacheOffset) 3703 ACCESSORS(PolymorphicCodeCache, cache, Object, kCacheOffset)
3696 3704
3697 bool Script::HasValidSource() { 3705 bool Script::HasValidSource() {
3698 Object* src = this->source(); 3706 Object* src = this->source();
3699 if (!src->IsString()) return true; 3707 if (!src->IsString()) return true;
3700 String* src_str = String::cast(src); 3708 String* src_str = String::cast(src);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
3750 WriteBarrierMode mode) { 3758 WriteBarrierMode mode) {
3751 WRITE_FIELD(this, kScopeInfoOffset, reinterpret_cast<Object*>(value)); 3759 WRITE_FIELD(this, kScopeInfoOffset, reinterpret_cast<Object*>(value));
3752 CONDITIONAL_WRITE_BARRIER(GetHeap(), 3760 CONDITIONAL_WRITE_BARRIER(GetHeap(),
3753 this, 3761 this,
3754 kScopeInfoOffset, 3762 kScopeInfoOffset,
3755 reinterpret_cast<Object*>(value), 3763 reinterpret_cast<Object*>(value),
3756 mode); 3764 mode);
3757 } 3765 }
3758 3766
3759 3767
3760 Smi* SharedFunctionInfo::deopt_counter() {
3761 return reinterpret_cast<Smi*>(READ_FIELD(this, kDeoptCounterOffset));
3762 }
3763
3764
3765 void SharedFunctionInfo::set_deopt_counter(Smi* value) {
3766 WRITE_FIELD(this, kDeoptCounterOffset, value);
3767 }
3768
3769
3770 bool SharedFunctionInfo::is_compiled() { 3768 bool SharedFunctionInfo::is_compiled() {
3771 return code() != 3769 return code() !=
3772 Isolate::Current()->builtins()->builtin(Builtins::kLazyCompile); 3770 Isolate::Current()->builtins()->builtin(Builtins::kLazyCompile);
3773 } 3771 }
3774 3772
3775 3773
3776 bool SharedFunctionInfo::IsApiFunction() { 3774 bool SharedFunctionInfo::IsApiFunction() {
3777 return function_data()->IsFunctionTemplateInfo(); 3775 return function_data()->IsFunctionTemplateInfo();
3778 } 3776 }
3779 3777
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
4884 #undef WRITE_INT_FIELD 4882 #undef WRITE_INT_FIELD
4885 #undef READ_SHORT_FIELD 4883 #undef READ_SHORT_FIELD
4886 #undef WRITE_SHORT_FIELD 4884 #undef WRITE_SHORT_FIELD
4887 #undef READ_BYTE_FIELD 4885 #undef READ_BYTE_FIELD
4888 #undef WRITE_BYTE_FIELD 4886 #undef WRITE_BYTE_FIELD
4889 4887
4890 4888
4891 } } // namespace v8::internal 4889 } } // namespace v8::internal
4892 4890
4893 #endif // V8_OBJECTS_INL_H_ 4891 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/ast.h ('K') | « src/objects.h ('k') | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698