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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 | 544 |
545 bool Object::IsJSReceiver() { | 545 bool Object::IsJSReceiver() { |
546 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 546 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
547 return IsHeapObject() && | 547 return IsHeapObject() && |
548 HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_RECEIVER_TYPE; | 548 HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_RECEIVER_TYPE; |
549 } | 549 } |
550 | 550 |
551 | 551 |
552 bool Object::IsJSObject() { | 552 bool Object::IsJSObject() { |
553 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); | 553 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); |
554 return IsHeapObject() && | 554 return IsHeapObject() && HeapObject::cast(this)->map()->is_jsobject_map(); |
555 HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_OBJECT_TYPE; | |
556 } | 555 } |
557 | 556 |
558 | 557 |
559 bool Object::IsJSProxy() { | 558 bool Object::IsJSProxy() { |
560 if (!Object::IsHeapObject()) return false; | 559 if (!Object::IsHeapObject()) return false; |
561 InstanceType type = HeapObject::cast(this)->map()->instance_type(); | 560 InstanceType type = HeapObject::cast(this)->map()->instance_type(); |
562 return FIRST_JS_PROXY_TYPE <= type && type <= LAST_JS_PROXY_TYPE; | 561 return FIRST_JS_PROXY_TYPE <= type && type <= LAST_JS_PROXY_TYPE; |
563 } | 562 } |
564 | 563 |
565 | 564 |
(...skipping 2935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3501 | 3500 |
3502 void Map::set_non_instance_prototype(bool value) { | 3501 void Map::set_non_instance_prototype(bool value) { |
3503 if (value) { | 3502 if (value) { |
3504 set_bit_field(bit_field() | (1 << kHasNonInstancePrototype)); | 3503 set_bit_field(bit_field() | (1 << kHasNonInstancePrototype)); |
3505 } else { | 3504 } else { |
3506 set_bit_field(bit_field() & ~(1 << kHasNonInstancePrototype)); | 3505 set_bit_field(bit_field() & ~(1 << kHasNonInstancePrototype)); |
3507 } | 3506 } |
3508 } | 3507 } |
3509 | 3508 |
3510 | 3509 |
| 3510 bool Map::is_jsobject_map() { |
| 3511 return instance_type() >= FIRST_JS_OBJECT_TYPE; |
| 3512 } |
| 3513 |
| 3514 |
3511 bool Map::has_non_instance_prototype() { | 3515 bool Map::has_non_instance_prototype() { |
3512 return ((1 << kHasNonInstancePrototype) & bit_field()) != 0; | 3516 return ((1 << kHasNonInstancePrototype) & bit_field()) != 0; |
3513 } | 3517 } |
3514 | 3518 |
3515 | 3519 |
3516 void Map::set_function_with_prototype(bool value) { | 3520 void Map::set_function_with_prototype(bool value) { |
3517 set_bit_field3(FunctionWithPrototype::update(bit_field3(), value)); | 3521 set_bit_field3(FunctionWithPrototype::update(bit_field3(), value)); |
3518 } | 3522 } |
3519 | 3523 |
3520 | 3524 |
(...skipping 2778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6299 #undef WRITE_UINT32_FIELD | 6303 #undef WRITE_UINT32_FIELD |
6300 #undef READ_SHORT_FIELD | 6304 #undef READ_SHORT_FIELD |
6301 #undef WRITE_SHORT_FIELD | 6305 #undef WRITE_SHORT_FIELD |
6302 #undef READ_BYTE_FIELD | 6306 #undef READ_BYTE_FIELD |
6303 #undef WRITE_BYTE_FIELD | 6307 #undef WRITE_BYTE_FIELD |
6304 | 6308 |
6305 | 6309 |
6306 } } // namespace v8::internal | 6310 } } // namespace v8::internal |
6307 | 6311 |
6308 #endif // V8_OBJECTS_INL_H_ | 6312 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |