OLD | NEW |
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 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 } | 1601 } |
1602 } | 1602 } |
1603 while (offset < size) { | 1603 while (offset < size) { |
1604 WRITE_FIELD(this, offset, filler_value); | 1604 WRITE_FIELD(this, offset, filler_value); |
1605 offset += kPointerSize; | 1605 offset += kPointerSize; |
1606 } | 1606 } |
1607 } | 1607 } |
1608 | 1608 |
1609 | 1609 |
1610 bool JSObject::HasFastProperties() { | 1610 bool JSObject::HasFastProperties() { |
| 1611 ASSERT(properties()->IsDictionary() == map()->is_dictionary_map()); |
1611 return !properties()->IsDictionary(); | 1612 return !properties()->IsDictionary(); |
1612 } | 1613 } |
1613 | 1614 |
1614 | 1615 |
1615 bool JSObject::TooManyFastProperties(int properties, | 1616 bool JSObject::TooManyFastProperties(int properties, |
1616 JSObject::StoreFromKeyed store_mode) { | 1617 JSObject::StoreFromKeyed store_mode) { |
1617 // Allow extra fast properties if the object has more than | 1618 // Allow extra fast properties if the object has more than |
1618 // kFastPropertiesSoftLimit in-object properties. When this is the case, | 1619 // kFastPropertiesSoftLimit in-object properties. When this is the case, |
1619 // it is very unlikely that the object is being used as a dictionary | 1620 // it is very unlikely that the object is being used as a dictionary |
1620 // and there is a good chance that allowing more map transitions | 1621 // and there is a good chance that allowing more map transitions |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3000 | 3001 |
3001 bool Map::attached_to_shared_function_info() { | 3002 bool Map::attached_to_shared_function_info() { |
3002 return ((1 << kAttachedToSharedFunctionInfo) & bit_field2()) != 0; | 3003 return ((1 << kAttachedToSharedFunctionInfo) & bit_field2()) != 0; |
3003 } | 3004 } |
3004 | 3005 |
3005 | 3006 |
3006 void Map::set_is_shared(bool value) { | 3007 void Map::set_is_shared(bool value) { |
3007 set_bit_field3(IsShared::update(bit_field3(), value)); | 3008 set_bit_field3(IsShared::update(bit_field3(), value)); |
3008 } | 3009 } |
3009 | 3010 |
| 3011 |
3010 bool Map::is_shared() { | 3012 bool Map::is_shared() { |
3011 return IsShared::decode(bit_field3()); | 3013 return IsShared::decode(bit_field3()); |
3012 } | 3014 } |
3013 | 3015 |
3014 | 3016 |
| 3017 void Map::set_dictionary_map(bool value) { |
| 3018 set_bit_field3(DictionaryMap::update(bit_field3(), value)); |
| 3019 } |
| 3020 |
| 3021 |
| 3022 bool Map::is_dictionary_map() { |
| 3023 return DictionaryMap::decode(bit_field3()); |
| 3024 } |
| 3025 |
| 3026 |
3015 JSFunction* Map::unchecked_constructor() { | 3027 JSFunction* Map::unchecked_constructor() { |
3016 return reinterpret_cast<JSFunction*>(READ_FIELD(this, kConstructorOffset)); | 3028 return reinterpret_cast<JSFunction*>(READ_FIELD(this, kConstructorOffset)); |
3017 } | 3029 } |
3018 | 3030 |
3019 | 3031 |
3020 Code::Flags Code::flags() { | 3032 Code::Flags Code::flags() { |
3021 return static_cast<Flags>(READ_INT_FIELD(this, kFlagsOffset)); | 3033 return static_cast<Flags>(READ_INT_FIELD(this, kFlagsOffset)); |
3022 } | 3034 } |
3023 | 3035 |
3024 | 3036 |
(...skipping 2365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5390 #undef WRITE_UINT32_FIELD | 5402 #undef WRITE_UINT32_FIELD |
5391 #undef READ_SHORT_FIELD | 5403 #undef READ_SHORT_FIELD |
5392 #undef WRITE_SHORT_FIELD | 5404 #undef WRITE_SHORT_FIELD |
5393 #undef READ_BYTE_FIELD | 5405 #undef READ_BYTE_FIELD |
5394 #undef WRITE_BYTE_FIELD | 5406 #undef WRITE_BYTE_FIELD |
5395 | 5407 |
5396 | 5408 |
5397 } } // namespace v8::internal | 5409 } } // namespace v8::internal |
5398 | 5410 |
5399 #endif // V8_OBJECTS_INL_H_ | 5411 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |