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

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

Issue 272203002: Reland and fix r21225 and r21226 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/x64/full-codegen-x64.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 4015 matching lines...) Expand 10 before | Expand all | Expand 10 after
4026 } 4026 }
4027 } 4027 }
4028 4028
4029 4029
4030 bool Map::has_non_instance_prototype() { 4030 bool Map::has_non_instance_prototype() {
4031 return ((1 << kHasNonInstancePrototype) & bit_field()) != 0; 4031 return ((1 << kHasNonInstancePrototype) & bit_field()) != 0;
4032 } 4032 }
4033 4033
4034 4034
4035 void Map::set_function_with_prototype(bool value) { 4035 void Map::set_function_with_prototype(bool value) {
4036 set_bit_field3(FunctionWithPrototype::update(bit_field3(), value)); 4036 set_bit_field(FunctionWithPrototype::update(bit_field(), value));
4037 } 4037 }
4038 4038
4039 4039
4040 bool Map::function_with_prototype() { 4040 bool Map::function_with_prototype() {
4041 return FunctionWithPrototype::decode(bit_field3()); 4041 return FunctionWithPrototype::decode(bit_field());
4042 } 4042 }
4043 4043
4044 4044
4045 void Map::set_is_access_check_needed(bool access_check_needed) { 4045 void Map::set_is_access_check_needed(bool access_check_needed) {
4046 if (access_check_needed) { 4046 if (access_check_needed) {
4047 set_bit_field(bit_field() | (1 << kIsAccessCheckNeeded)); 4047 set_bit_field(bit_field() | (1 << kIsAccessCheckNeeded));
4048 } else { 4048 } else {
4049 set_bit_field(bit_field() & ~(1 << kIsAccessCheckNeeded)); 4049 set_bit_field(bit_field() & ~(1 << kIsAccessCheckNeeded));
4050 } 4050 }
4051 } 4051 }
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
4746 int len = descriptors->number_of_descriptors(); 4746 int len = descriptors->number_of_descriptors();
4747 set_instance_descriptors(descriptors); 4747 set_instance_descriptors(descriptors);
4748 SetNumberOfOwnDescriptors(len); 4748 SetNumberOfOwnDescriptors(len);
4749 } 4749 }
4750 4750
4751 4751
4752 ACCESSORS(Map, instance_descriptors, DescriptorArray, kDescriptorsOffset) 4752 ACCESSORS(Map, instance_descriptors, DescriptorArray, kDescriptorsOffset)
4753 4753
4754 4754
4755 void Map::set_bit_field3(uint32_t bits) { 4755 void Map::set_bit_field3(uint32_t bits) {
4756 // Ensure the upper 2 bits have the same value by sign extending it. This is 4756 if (kInt32Size != kPointerSize) {
4757 // necessary to be able to use the 31st bit. 4757 WRITE_UINT32_FIELD(this, kBitField3Offset + kInt32Size, 0);
4758 int value = bits << 1; 4758 }
4759 WRITE_FIELD(this, kBitField3Offset, Smi::FromInt(value >> 1)); 4759 WRITE_UINT32_FIELD(this, kBitField3Offset, bits);
4760 } 4760 }
4761 4761
4762 4762
4763 uint32_t Map::bit_field3() { 4763 uint32_t Map::bit_field3() {
4764 Object* value = READ_FIELD(this, kBitField3Offset); 4764 return READ_UINT32_FIELD(this, kBitField3Offset);
4765 return Smi::cast(value)->value();
4766 } 4765 }
4767 4766
4768 4767
4769 void Map::AppendDescriptor(Descriptor* desc) { 4768 void Map::AppendDescriptor(Descriptor* desc) {
4770 DescriptorArray* descriptors = instance_descriptors(); 4769 DescriptorArray* descriptors = instance_descriptors();
4771 int number_of_own_descriptors = NumberOfOwnDescriptors(); 4770 int number_of_own_descriptors = NumberOfOwnDescriptors();
4772 ASSERT(descriptors->number_of_descriptors() == number_of_own_descriptors); 4771 ASSERT(descriptors->number_of_descriptors() == number_of_own_descriptors);
4773 descriptors->Append(desc); 4772 descriptors->Append(desc);
4774 SetNumberOfOwnDescriptors(number_of_own_descriptors + 1); 4773 SetNumberOfOwnDescriptors(number_of_own_descriptors + 1);
4775 } 4774 }
(...skipping 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after
6856 #undef READ_SHORT_FIELD 6855 #undef READ_SHORT_FIELD
6857 #undef WRITE_SHORT_FIELD 6856 #undef WRITE_SHORT_FIELD
6858 #undef READ_BYTE_FIELD 6857 #undef READ_BYTE_FIELD
6859 #undef WRITE_BYTE_FIELD 6858 #undef WRITE_BYTE_FIELD
6860 #undef NOBARRIER_READ_BYTE_FIELD 6859 #undef NOBARRIER_READ_BYTE_FIELD
6861 #undef NOBARRIER_WRITE_BYTE_FIELD 6860 #undef NOBARRIER_WRITE_BYTE_FIELD
6862 6861
6863 } } // namespace v8::internal 6862 } } // namespace v8::internal
6864 6863
6865 #endif // V8_OBJECTS_INL_H_ 6864 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698