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

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

Issue 6932068: A first skeleton for introducing Harmony proxies (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 7 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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after
3501 3508
3502 3509
3503 void JSBuiltinsObject::set_javascript_builtin_code(Builtins::JavaScript id, 3510 void JSBuiltinsObject::set_javascript_builtin_code(Builtins::JavaScript id,
3504 Code* value) { 3511 Code* value) {
3505 ASSERT(id < kJSBuiltinsCount); // id is unsigned. 3512 ASSERT(id < kJSBuiltinsCount); // id is unsigned.
3506 WRITE_FIELD(this, OffsetOfCodeWithId(id), value); 3513 WRITE_FIELD(this, OffsetOfCodeWithId(id), value);
3507 ASSERT(!HEAP->InNewSpace(value)); 3514 ASSERT(!HEAP->InNewSpace(value));
3508 } 3515 }
3509 3516
3510 3517
3518 ACCESSORS(JSProxy, handler, Object, kHandlerOffset)
3519
3520
3511 Address Proxy::proxy() { 3521 Address Proxy::proxy() {
3512 return AddressFrom<Address>(READ_INTPTR_FIELD(this, kProxyOffset)); 3522 return AddressFrom<Address>(READ_INTPTR_FIELD(this, kProxyOffset));
3513 } 3523 }
3514 3524
3515 3525
3516 void Proxy::set_proxy(Address value) { 3526 void Proxy::set_proxy(Address value) {
3517 WRITE_INTPTR_FIELD(this, kProxyOffset, OffsetFrom(value)); 3527 WRITE_INTPTR_FIELD(this, kProxyOffset, OffsetFrom(value));
3518 } 3528 }
3519 3529
3520 3530
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
4205 #undef WRITE_INT_FIELD 4215 #undef WRITE_INT_FIELD
4206 #undef READ_SHORT_FIELD 4216 #undef READ_SHORT_FIELD
4207 #undef WRITE_SHORT_FIELD 4217 #undef WRITE_SHORT_FIELD
4208 #undef READ_BYTE_FIELD 4218 #undef READ_BYTE_FIELD
4209 #undef WRITE_BYTE_FIELD 4219 #undef WRITE_BYTE_FIELD
4210 4220
4211 4221
4212 } } // namespace v8::internal 4222 } } // namespace v8::internal
4213 4223
4214 #endif // V8_OBJECTS_INL_H_ 4224 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698