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

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: Addressed Kevin's comments. 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 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after
3502 3509
3503 3510
3504 void JSBuiltinsObject::set_javascript_builtin_code(Builtins::JavaScript id, 3511 void JSBuiltinsObject::set_javascript_builtin_code(Builtins::JavaScript id,
3505 Code* value) { 3512 Code* value) {
3506 ASSERT(id < kJSBuiltinsCount); // id is unsigned. 3513 ASSERT(id < kJSBuiltinsCount); // id is unsigned.
3507 WRITE_FIELD(this, OffsetOfCodeWithId(id), value); 3514 WRITE_FIELD(this, OffsetOfCodeWithId(id), value);
3508 ASSERT(!HEAP->InNewSpace(value)); 3515 ASSERT(!HEAP->InNewSpace(value));
3509 } 3516 }
3510 3517
3511 3518
3519 ACCESSORS(JSProxy, handler, Object, kHandlerOffset)
3520
3521
3512 Address Proxy::proxy() { 3522 Address Proxy::proxy() {
3513 return AddressFrom<Address>(READ_INTPTR_FIELD(this, kProxyOffset)); 3523 return AddressFrom<Address>(READ_INTPTR_FIELD(this, kProxyOffset));
3514 } 3524 }
3515 3525
3516 3526
3517 void Proxy::set_proxy(Address value) { 3527 void Proxy::set_proxy(Address value) {
3518 WRITE_INTPTR_FIELD(this, kProxyOffset, OffsetFrom(value)); 3528 WRITE_INTPTR_FIELD(this, kProxyOffset, OffsetFrom(value));
3519 } 3529 }
3520 3530
3521 3531
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
4206 #undef WRITE_INT_FIELD 4216 #undef WRITE_INT_FIELD
4207 #undef READ_SHORT_FIELD 4217 #undef READ_SHORT_FIELD
4208 #undef WRITE_SHORT_FIELD 4218 #undef WRITE_SHORT_FIELD
4209 #undef READ_BYTE_FIELD 4219 #undef READ_BYTE_FIELD
4210 #undef WRITE_BYTE_FIELD 4220 #undef WRITE_BYTE_FIELD
4211 4221
4212 4222
4213 } } // namespace v8::internal 4223 } } // namespace v8::internal
4214 4224
4215 #endif // V8_OBJECTS_INL_H_ 4225 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698