Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: src/objects-inl.h

Issue 7529007: Preliminary Harmony weak maps API implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 HeapObject::cast(this)->map()->instance_type() == JS_FUNCTION_PROXY_TYPE); 473 HeapObject::cast(this)->map()->instance_type() == JS_FUNCTION_PROXY_TYPE);
474 } 474 }
475 475
476 476
477 bool Object::IsJSFunctionProxy() { 477 bool Object::IsJSFunctionProxy() {
478 return Object::IsHeapObject() && 478 return Object::IsHeapObject() &&
479 HeapObject::cast(this)->map()->instance_type() == JS_FUNCTION_PROXY_TYPE; 479 HeapObject::cast(this)->map()->instance_type() == JS_FUNCTION_PROXY_TYPE;
480 } 480 }
481 481
482 482
483 bool Object::IsJSWeakMap() {
484 return Object::IsJSObject() &&
485 HeapObject::cast(this)->map()->instance_type() == JS_WEAKMAP_TYPE;
486 }
487
488
483 bool Object::IsJSContextExtensionObject() { 489 bool Object::IsJSContextExtensionObject() {
484 return IsHeapObject() 490 return IsHeapObject()
485 && (HeapObject::cast(this)->map()->instance_type() == 491 && (HeapObject::cast(this)->map()->instance_type() ==
486 JS_CONTEXT_EXTENSION_OBJECT_TYPE); 492 JS_CONTEXT_EXTENSION_OBJECT_TYPE);
487 } 493 }
488 494
489 495
490 bool Object::IsMap() { 496 bool Object::IsMap() {
491 return Object::IsHeapObject() 497 return Object::IsHeapObject()
492 && HeapObject::cast(this)->map()->instance_type() == MAP_TYPE; 498 && HeapObject::cast(this)->map()->instance_type() == MAP_TYPE;
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after
2057 CAST_ACCESSOR(JSFunction) 2063 CAST_ACCESSOR(JSFunction)
2058 CAST_ACCESSOR(GlobalObject) 2064 CAST_ACCESSOR(GlobalObject)
2059 CAST_ACCESSOR(JSGlobalProxy) 2065 CAST_ACCESSOR(JSGlobalProxy)
2060 CAST_ACCESSOR(JSGlobalObject) 2066 CAST_ACCESSOR(JSGlobalObject)
2061 CAST_ACCESSOR(JSBuiltinsObject) 2067 CAST_ACCESSOR(JSBuiltinsObject)
2062 CAST_ACCESSOR(Code) 2068 CAST_ACCESSOR(Code)
2063 CAST_ACCESSOR(JSArray) 2069 CAST_ACCESSOR(JSArray)
2064 CAST_ACCESSOR(JSRegExp) 2070 CAST_ACCESSOR(JSRegExp)
2065 CAST_ACCESSOR(JSProxy) 2071 CAST_ACCESSOR(JSProxy)
2066 CAST_ACCESSOR(JSFunctionProxy) 2072 CAST_ACCESSOR(JSFunctionProxy)
2073 CAST_ACCESSOR(JSWeakMap)
2067 CAST_ACCESSOR(Foreign) 2074 CAST_ACCESSOR(Foreign)
2068 CAST_ACCESSOR(ByteArray) 2075 CAST_ACCESSOR(ByteArray)
2069 CAST_ACCESSOR(ExternalArray) 2076 CAST_ACCESSOR(ExternalArray)
2070 CAST_ACCESSOR(ExternalByteArray) 2077 CAST_ACCESSOR(ExternalByteArray)
2071 CAST_ACCESSOR(ExternalUnsignedByteArray) 2078 CAST_ACCESSOR(ExternalUnsignedByteArray)
2072 CAST_ACCESSOR(ExternalShortArray) 2079 CAST_ACCESSOR(ExternalShortArray)
2073 CAST_ACCESSOR(ExternalUnsignedShortArray) 2080 CAST_ACCESSOR(ExternalUnsignedShortArray)
2074 CAST_ACCESSOR(ExternalIntArray) 2081 CAST_ACCESSOR(ExternalIntArray)
2075 CAST_ACCESSOR(ExternalUnsignedIntArray) 2082 CAST_ACCESSOR(ExternalUnsignedIntArray)
2076 CAST_ACCESSOR(ExternalFloatArray) 2083 CAST_ACCESSOR(ExternalFloatArray)
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after
3787 ASSERT(id < kJSBuiltinsCount); // id is unsigned. 3794 ASSERT(id < kJSBuiltinsCount); // id is unsigned.
3788 WRITE_FIELD(this, OffsetOfCodeWithId(id), value); 3795 WRITE_FIELD(this, OffsetOfCodeWithId(id), value);
3789 ASSERT(!HEAP->InNewSpace(value)); 3796 ASSERT(!HEAP->InNewSpace(value));
3790 } 3797 }
3791 3798
3792 3799
3793 ACCESSORS(JSProxy, handler, Object, kHandlerOffset) 3800 ACCESSORS(JSProxy, handler, Object, kHandlerOffset)
3794 ACCESSORS(JSProxy, padding, Object, kPaddingOffset) 3801 ACCESSORS(JSProxy, padding, Object, kPaddingOffset)
3795 3802
3796 3803
3804 ACCESSORS(JSWeakMap, table, ObjectHashTable, kTableOffset)
3805
3806
3797 Address Foreign::address() { 3807 Address Foreign::address() {
3798 return AddressFrom<Address>(READ_INTPTR_FIELD(this, kAddressOffset)); 3808 return AddressFrom<Address>(READ_INTPTR_FIELD(this, kAddressOffset));
3799 } 3809 }
3800 3810
3801 3811
3802 void Foreign::set_address(Address value) { 3812 void Foreign::set_address(Address value) {
3803 WRITE_INTPTR_FIELD(this, kAddressOffset, OffsetFrom(value)); 3813 WRITE_INTPTR_FIELD(this, kAddressOffset, OffsetFrom(value));
3804 } 3814 }
3805 3815
3806 3816
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
4541 #undef WRITE_INT_FIELD 4551 #undef WRITE_INT_FIELD
4542 #undef READ_SHORT_FIELD 4552 #undef READ_SHORT_FIELD
4543 #undef WRITE_SHORT_FIELD 4553 #undef WRITE_SHORT_FIELD
4544 #undef READ_BYTE_FIELD 4554 #undef READ_BYTE_FIELD
4545 #undef WRITE_BYTE_FIELD 4555 #undef WRITE_BYTE_FIELD
4546 4556
4547 4557
4548 } } // namespace v8::internal 4558 } } // namespace v8::internal
4549 4559
4550 #endif // V8_OBJECTS_INL_H_ 4560 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/objects.h ('K') | « src/objects.h ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698