| OLD | NEW |
| 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 6375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6386 bool AccessorInfo::all_can_write() { | 6386 bool AccessorInfo::all_can_write() { |
| 6387 return BooleanBit::get(flag(), kAllCanWriteBit); | 6387 return BooleanBit::get(flag(), kAllCanWriteBit); |
| 6388 } | 6388 } |
| 6389 | 6389 |
| 6390 | 6390 |
| 6391 void AccessorInfo::set_all_can_write(bool value) { | 6391 void AccessorInfo::set_all_can_write(bool value) { |
| 6392 set_flag(BooleanBit::set(flag(), kAllCanWriteBit, value)); | 6392 set_flag(BooleanBit::set(flag(), kAllCanWriteBit, value)); |
| 6393 } | 6393 } |
| 6394 | 6394 |
| 6395 | 6395 |
| 6396 bool AccessorInfo::prohibits_overwriting() { | |
| 6397 return BooleanBit::get(flag(), kProhibitsOverwritingBit); | |
| 6398 } | |
| 6399 | |
| 6400 | |
| 6401 void AccessorInfo::set_prohibits_overwriting(bool value) { | |
| 6402 set_flag(BooleanBit::set(flag(), kProhibitsOverwritingBit, value)); | |
| 6403 } | |
| 6404 | |
| 6405 | |
| 6406 PropertyAttributes AccessorInfo::property_attributes() { | 6396 PropertyAttributes AccessorInfo::property_attributes() { |
| 6407 return AttributesField::decode(static_cast<uint32_t>(flag()->value())); | 6397 return AttributesField::decode(static_cast<uint32_t>(flag()->value())); |
| 6408 } | 6398 } |
| 6409 | 6399 |
| 6410 | 6400 |
| 6411 void AccessorInfo::set_property_attributes(PropertyAttributes attributes) { | 6401 void AccessorInfo::set_property_attributes(PropertyAttributes attributes) { |
| 6412 set_flag(Smi::FromInt(AttributesField::update(flag()->value(), attributes))); | 6402 set_flag(Smi::FromInt(AttributesField::update(flag()->value(), attributes))); |
| 6413 } | 6403 } |
| 6414 | 6404 |
| 6415 | 6405 |
| 6416 bool AccessorInfo::IsCompatibleReceiver(Object* receiver) { | 6406 bool AccessorInfo::IsCompatibleReceiver(Object* receiver) { |
| 6417 Object* function_template = expected_receiver_type(); | 6407 Object* function_template = expected_receiver_type(); |
| 6418 if (!function_template->IsFunctionTemplateInfo()) return true; | 6408 if (!function_template->IsFunctionTemplateInfo()) return true; |
| 6419 return FunctionTemplateInfo::cast(function_template)->IsTemplateFor(receiver); | 6409 return FunctionTemplateInfo::cast(function_template)->IsTemplateFor(receiver); |
| 6420 } | 6410 } |
| 6421 | 6411 |
| 6422 | 6412 |
| 6423 void ExecutableAccessorInfo::clear_setter() { | 6413 void ExecutableAccessorInfo::clear_setter() { |
| 6424 set_setter(GetIsolate()->heap()->undefined_value(), SKIP_WRITE_BARRIER); | 6414 set_setter(GetIsolate()->heap()->undefined_value(), SKIP_WRITE_BARRIER); |
| 6425 } | 6415 } |
| 6426 | 6416 |
| 6427 | 6417 |
| 6428 void AccessorPair::set_access_flags(v8::AccessControl access_control) { | 6418 void AccessorPair::set_access_flags(v8::AccessControl access_control) { |
| 6429 int current = access_flags()->value(); | 6419 int current = access_flags()->value(); |
| 6430 current = BooleanBit::set(current, | 6420 current = BooleanBit::set(current, |
| 6431 kProhibitsOverwritingBit, | |
| 6432 access_control & PROHIBITS_OVERWRITING); | |
| 6433 current = BooleanBit::set(current, | |
| 6434 kAllCanReadBit, | 6421 kAllCanReadBit, |
| 6435 access_control & ALL_CAN_READ); | 6422 access_control & ALL_CAN_READ); |
| 6436 current = BooleanBit::set(current, | 6423 current = BooleanBit::set(current, |
| 6437 kAllCanWriteBit, | 6424 kAllCanWriteBit, |
| 6438 access_control & ALL_CAN_WRITE); | 6425 access_control & ALL_CAN_WRITE); |
| 6439 set_access_flags(Smi::FromInt(current)); | 6426 set_access_flags(Smi::FromInt(current)); |
| 6440 } | 6427 } |
| 6441 | 6428 |
| 6442 | 6429 |
| 6443 bool AccessorPair::all_can_read() { | 6430 bool AccessorPair::all_can_read() { |
| 6444 return BooleanBit::get(access_flags(), kAllCanReadBit); | 6431 return BooleanBit::get(access_flags(), kAllCanReadBit); |
| 6445 } | 6432 } |
| 6446 | 6433 |
| 6447 | 6434 |
| 6448 bool AccessorPair::all_can_write() { | 6435 bool AccessorPair::all_can_write() { |
| 6449 return BooleanBit::get(access_flags(), kAllCanWriteBit); | 6436 return BooleanBit::get(access_flags(), kAllCanWriteBit); |
| 6450 } | 6437 } |
| 6451 | 6438 |
| 6452 | 6439 |
| 6453 bool AccessorPair::prohibits_overwriting() { | |
| 6454 return BooleanBit::get(access_flags(), kProhibitsOverwritingBit); | |
| 6455 } | |
| 6456 | |
| 6457 | |
| 6458 template<typename Derived, typename Shape, typename Key> | 6440 template<typename Derived, typename Shape, typename Key> |
| 6459 void Dictionary<Derived, Shape, Key>::SetEntry(int entry, | 6441 void Dictionary<Derived, Shape, Key>::SetEntry(int entry, |
| 6460 Handle<Object> key, | 6442 Handle<Object> key, |
| 6461 Handle<Object> value) { | 6443 Handle<Object> value) { |
| 6462 SetEntry(entry, key, value, PropertyDetails(Smi::FromInt(0))); | 6444 SetEntry(entry, key, value, PropertyDetails(Smi::FromInt(0))); |
| 6463 } | 6445 } |
| 6464 | 6446 |
| 6465 | 6447 |
| 6466 template<typename Derived, typename Shape, typename Key> | 6448 template<typename Derived, typename Shape, typename Key> |
| 6467 void Dictionary<Derived, Shape, Key>::SetEntry(int entry, | 6449 void Dictionary<Derived, Shape, Key>::SetEntry(int entry, |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6869 #undef READ_SHORT_FIELD | 6851 #undef READ_SHORT_FIELD |
| 6870 #undef WRITE_SHORT_FIELD | 6852 #undef WRITE_SHORT_FIELD |
| 6871 #undef READ_BYTE_FIELD | 6853 #undef READ_BYTE_FIELD |
| 6872 #undef WRITE_BYTE_FIELD | 6854 #undef WRITE_BYTE_FIELD |
| 6873 #undef NOBARRIER_READ_BYTE_FIELD | 6855 #undef NOBARRIER_READ_BYTE_FIELD |
| 6874 #undef NOBARRIER_WRITE_BYTE_FIELD | 6856 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 6875 | 6857 |
| 6876 } } // namespace v8::internal | 6858 } } // namespace v8::internal |
| 6877 | 6859 |
| 6878 #endif // V8_OBJECTS_INL_H_ | 6860 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |