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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 | 662 |
663 | 663 |
664 template <> inline bool Is<JSFunction>(Object* obj) { | 664 template <> inline bool Is<JSFunction>(Object* obj) { |
665 return obj->IsJSFunction(); | 665 return obj->IsJSFunction(); |
666 } | 666 } |
667 | 667 |
668 | 668 |
669 TYPE_CHECKER(Code, CODE_TYPE) | 669 TYPE_CHECKER(Code, CODE_TYPE) |
670 TYPE_CHECKER(Oddball, ODDBALL_TYPE) | 670 TYPE_CHECKER(Oddball, ODDBALL_TYPE) |
671 TYPE_CHECKER(Cell, CELL_TYPE) | 671 TYPE_CHECKER(Cell, CELL_TYPE) |
672 TYPE_CHECKER(JSGlobalPropertyCell, PROPERTY_CELL_TYPE) | 672 TYPE_CHECKER(PropertyCell, PROPERTY_CELL_TYPE) |
673 TYPE_CHECKER(SharedFunctionInfo, SHARED_FUNCTION_INFO_TYPE) | 673 TYPE_CHECKER(SharedFunctionInfo, SHARED_FUNCTION_INFO_TYPE) |
674 TYPE_CHECKER(JSGeneratorObject, JS_GENERATOR_OBJECT_TYPE) | 674 TYPE_CHECKER(JSGeneratorObject, JS_GENERATOR_OBJECT_TYPE) |
675 TYPE_CHECKER(JSModule, JS_MODULE_TYPE) | 675 TYPE_CHECKER(JSModule, JS_MODULE_TYPE) |
676 TYPE_CHECKER(JSValue, JS_VALUE_TYPE) | 676 TYPE_CHECKER(JSValue, JS_VALUE_TYPE) |
677 TYPE_CHECKER(JSDate, JS_DATE_TYPE) | 677 TYPE_CHECKER(JSDate, JS_DATE_TYPE) |
678 TYPE_CHECKER(JSMessageObject, JS_MESSAGE_OBJECT_TYPE) | 678 TYPE_CHECKER(JSMessageObject, JS_MESSAGE_OBJECT_TYPE) |
679 | 679 |
680 | 680 |
681 bool Object::IsStringWrapper() { | 681 bool Object::IsStringWrapper() { |
682 return IsJSValue() && JSValue::cast(this)->value()->IsString(); | 682 return IsJSValue() && JSValue::cast(this)->value()->IsString(); |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1622 } | 1622 } |
1623 | 1623 |
1624 | 1624 |
1625 Object* Cell::value() { | 1625 Object* Cell::value() { |
1626 return READ_FIELD(this, kValueOffset); | 1626 return READ_FIELD(this, kValueOffset); |
1627 } | 1627 } |
1628 | 1628 |
1629 | 1629 |
1630 void Cell::set_value(Object* val, WriteBarrierMode ignored) { | 1630 void Cell::set_value(Object* val, WriteBarrierMode ignored) { |
1631 // The write barrier is not used for global property cells. | 1631 // The write barrier is not used for global property cells. |
1632 ASSERT(!val->IsJSGlobalPropertyCell() && !val->IsCell()); | 1632 ASSERT(!val->IsPropertyCell() && !val->IsCell()); |
1633 WRITE_FIELD(this, kValueOffset, val); | 1633 WRITE_FIELD(this, kValueOffset, val); |
1634 } | 1634 } |
1635 | 1635 |
1636 | 1636 |
1637 Object* JSGlobalPropertyCell::type_raw() { | 1637 Object* PropertyCell::type_raw() { |
1638 return READ_FIELD(this, kTypeOffset); | 1638 return READ_FIELD(this, kTypeOffset); |
1639 } | 1639 } |
1640 | 1640 |
1641 | 1641 |
1642 void JSGlobalPropertyCell::set_type_raw(Object* val, WriteBarrierMode ignored) { | 1642 void PropertyCell::set_type_raw(Object* val, WriteBarrierMode ignored) { |
1643 WRITE_FIELD(this, kTypeOffset, val); | 1643 WRITE_FIELD(this, kTypeOffset, val); |
1644 } | 1644 } |
1645 | 1645 |
1646 | 1646 |
1647 int JSObject::GetHeaderSize() { | 1647 int JSObject::GetHeaderSize() { |
1648 InstanceType type = map()->instance_type(); | 1648 InstanceType type = map()->instance_type(); |
1649 // Check for the most common kind of JavaScript object before | 1649 // Check for the most common kind of JavaScript object before |
1650 // falling into the generic switch. This speeds up the internal | 1650 // falling into the generic switch. This speeds up the internal |
1651 // field operations considerably on average. | 1651 // field operations considerably on average. |
1652 if (type == JS_OBJECT_TYPE) return JSObject::kHeaderSize; | 1652 if (type == JS_OBJECT_TYPE) return JSObject::kHeaderSize; |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2557 CAST_ACCESSOR(ExternalTwoByteString) | 2557 CAST_ACCESSOR(ExternalTwoByteString) |
2558 CAST_ACCESSOR(Symbol) | 2558 CAST_ACCESSOR(Symbol) |
2559 CAST_ACCESSOR(Name) | 2559 CAST_ACCESSOR(Name) |
2560 CAST_ACCESSOR(JSReceiver) | 2560 CAST_ACCESSOR(JSReceiver) |
2561 CAST_ACCESSOR(JSObject) | 2561 CAST_ACCESSOR(JSObject) |
2562 CAST_ACCESSOR(Smi) | 2562 CAST_ACCESSOR(Smi) |
2563 CAST_ACCESSOR(HeapObject) | 2563 CAST_ACCESSOR(HeapObject) |
2564 CAST_ACCESSOR(HeapNumber) | 2564 CAST_ACCESSOR(HeapNumber) |
2565 CAST_ACCESSOR(Oddball) | 2565 CAST_ACCESSOR(Oddball) |
2566 CAST_ACCESSOR(Cell) | 2566 CAST_ACCESSOR(Cell) |
2567 CAST_ACCESSOR(JSGlobalPropertyCell) | 2567 CAST_ACCESSOR(PropertyCell) |
2568 CAST_ACCESSOR(SharedFunctionInfo) | 2568 CAST_ACCESSOR(SharedFunctionInfo) |
2569 CAST_ACCESSOR(Map) | 2569 CAST_ACCESSOR(Map) |
2570 CAST_ACCESSOR(JSFunction) | 2570 CAST_ACCESSOR(JSFunction) |
2571 CAST_ACCESSOR(GlobalObject) | 2571 CAST_ACCESSOR(GlobalObject) |
2572 CAST_ACCESSOR(JSGlobalProxy) | 2572 CAST_ACCESSOR(JSGlobalProxy) |
2573 CAST_ACCESSOR(JSGlobalObject) | 2573 CAST_ACCESSOR(JSGlobalObject) |
2574 CAST_ACCESSOR(JSBuiltinsObject) | 2574 CAST_ACCESSOR(JSBuiltinsObject) |
2575 CAST_ACCESSOR(Code) | 2575 CAST_ACCESSOR(Code) |
2576 CAST_ACCESSOR(JSArray) | 2576 CAST_ACCESSOR(JSArray) |
2577 CAST_ACCESSOR(JSArrayBuffer) | 2577 CAST_ACCESSOR(JSArrayBuffer) |
(...skipping 3668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6246 #undef WRITE_UINT32_FIELD | 6246 #undef WRITE_UINT32_FIELD |
6247 #undef READ_SHORT_FIELD | 6247 #undef READ_SHORT_FIELD |
6248 #undef WRITE_SHORT_FIELD | 6248 #undef WRITE_SHORT_FIELD |
6249 #undef READ_BYTE_FIELD | 6249 #undef READ_BYTE_FIELD |
6250 #undef WRITE_BYTE_FIELD | 6250 #undef WRITE_BYTE_FIELD |
6251 | 6251 |
6252 | 6252 |
6253 } } // namespace v8::internal | 6253 } } // namespace v8::internal |
6254 | 6254 |
6255 #endif // V8_OBJECTS_INL_H_ | 6255 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |