OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 && (HeapObject::cast(this)->map()->instance_type() == | 577 && (HeapObject::cast(this)->map()->instance_type() == |
578 JS_MESSAGE_OBJECT_TYPE); | 578 JS_MESSAGE_OBJECT_TYPE); |
579 } | 579 } |
580 | 580 |
581 | 581 |
582 bool Object::IsStringWrapper() { | 582 bool Object::IsStringWrapper() { |
583 return IsJSValue() && JSValue::cast(this)->value()->IsString(); | 583 return IsJSValue() && JSValue::cast(this)->value()->IsString(); |
584 } | 584 } |
585 | 585 |
586 | 586 |
| 587 bool Object::IsJSProxy() { |
| 588 return Object::IsHeapObject() |
| 589 && HeapObject::cast(this)->map()->instance_type() == JS_PROXY_TYPE; |
| 590 } |
| 591 |
| 592 |
587 bool Object::IsProxy() { | 593 bool Object::IsProxy() { |
588 return Object::IsHeapObject() | 594 return Object::IsHeapObject() |
589 && HeapObject::cast(this)->map()->instance_type() == PROXY_TYPE; | 595 && HeapObject::cast(this)->map()->instance_type() == PROXY_TYPE; |
590 } | 596 } |
591 | 597 |
592 | 598 |
593 bool Object::IsBoolean() { | 599 bool Object::IsBoolean() { |
594 return IsOddball() && | 600 return IsOddball() && |
595 ((Oddball::cast(this)->kind() & Oddball::kNotBooleanMask) == 0); | 601 ((Oddball::cast(this)->kind() & Oddball::kNotBooleanMask) == 0); |
596 } | 602 } |
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1891 CAST_ACCESSOR(SharedFunctionInfo) | 1897 CAST_ACCESSOR(SharedFunctionInfo) |
1892 CAST_ACCESSOR(Map) | 1898 CAST_ACCESSOR(Map) |
1893 CAST_ACCESSOR(JSFunction) | 1899 CAST_ACCESSOR(JSFunction) |
1894 CAST_ACCESSOR(GlobalObject) | 1900 CAST_ACCESSOR(GlobalObject) |
1895 CAST_ACCESSOR(JSGlobalProxy) | 1901 CAST_ACCESSOR(JSGlobalProxy) |
1896 CAST_ACCESSOR(JSGlobalObject) | 1902 CAST_ACCESSOR(JSGlobalObject) |
1897 CAST_ACCESSOR(JSBuiltinsObject) | 1903 CAST_ACCESSOR(JSBuiltinsObject) |
1898 CAST_ACCESSOR(Code) | 1904 CAST_ACCESSOR(Code) |
1899 CAST_ACCESSOR(JSArray) | 1905 CAST_ACCESSOR(JSArray) |
1900 CAST_ACCESSOR(JSRegExp) | 1906 CAST_ACCESSOR(JSRegExp) |
| 1907 CAST_ACCESSOR(JSProxy) |
1901 CAST_ACCESSOR(Proxy) | 1908 CAST_ACCESSOR(Proxy) |
1902 CAST_ACCESSOR(ByteArray) | 1909 CAST_ACCESSOR(ByteArray) |
1903 CAST_ACCESSOR(ExternalArray) | 1910 CAST_ACCESSOR(ExternalArray) |
1904 CAST_ACCESSOR(ExternalByteArray) | 1911 CAST_ACCESSOR(ExternalByteArray) |
1905 CAST_ACCESSOR(ExternalUnsignedByteArray) | 1912 CAST_ACCESSOR(ExternalUnsignedByteArray) |
1906 CAST_ACCESSOR(ExternalShortArray) | 1913 CAST_ACCESSOR(ExternalShortArray) |
1907 CAST_ACCESSOR(ExternalUnsignedShortArray) | 1914 CAST_ACCESSOR(ExternalUnsignedShortArray) |
1908 CAST_ACCESSOR(ExternalIntArray) | 1915 CAST_ACCESSOR(ExternalIntArray) |
1909 CAST_ACCESSOR(ExternalUnsignedIntArray) | 1916 CAST_ACCESSOR(ExternalUnsignedIntArray) |
1910 CAST_ACCESSOR(ExternalFloatArray) | 1917 CAST_ACCESSOR(ExternalFloatArray) |
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3514 | 3521 |
3515 | 3522 |
3516 void JSBuiltinsObject::set_javascript_builtin_code(Builtins::JavaScript id, | 3523 void JSBuiltinsObject::set_javascript_builtin_code(Builtins::JavaScript id, |
3517 Code* value) { | 3524 Code* value) { |
3518 ASSERT(id < kJSBuiltinsCount); // id is unsigned. | 3525 ASSERT(id < kJSBuiltinsCount); // id is unsigned. |
3519 WRITE_FIELD(this, OffsetOfCodeWithId(id), value); | 3526 WRITE_FIELD(this, OffsetOfCodeWithId(id), value); |
3520 ASSERT(!HEAP->InNewSpace(value)); | 3527 ASSERT(!HEAP->InNewSpace(value)); |
3521 } | 3528 } |
3522 | 3529 |
3523 | 3530 |
| 3531 ACCESSORS(JSProxy, handler, Object, kHandlerOffset) |
| 3532 |
| 3533 |
3524 Address Proxy::proxy() { | 3534 Address Proxy::proxy() { |
3525 return AddressFrom<Address>(READ_INTPTR_FIELD(this, kProxyOffset)); | 3535 return AddressFrom<Address>(READ_INTPTR_FIELD(this, kProxyOffset)); |
3526 } | 3536 } |
3527 | 3537 |
3528 | 3538 |
3529 void Proxy::set_proxy(Address value) { | 3539 void Proxy::set_proxy(Address value) { |
3530 WRITE_INTPTR_FIELD(this, kProxyOffset, OffsetFrom(value)); | 3540 WRITE_INTPTR_FIELD(this, kProxyOffset, OffsetFrom(value)); |
3531 } | 3541 } |
3532 | 3542 |
3533 | 3543 |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4220 #undef WRITE_INT_FIELD | 4230 #undef WRITE_INT_FIELD |
4221 #undef READ_SHORT_FIELD | 4231 #undef READ_SHORT_FIELD |
4222 #undef WRITE_SHORT_FIELD | 4232 #undef WRITE_SHORT_FIELD |
4223 #undef READ_BYTE_FIELD | 4233 #undef READ_BYTE_FIELD |
4224 #undef WRITE_BYTE_FIELD | 4234 #undef WRITE_BYTE_FIELD |
4225 | 4235 |
4226 | 4236 |
4227 } } // namespace v8::internal | 4237 } } // namespace v8::internal |
4228 | 4238 |
4229 #endif // V8_OBJECTS_INL_H_ | 4239 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |