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

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

Issue 22903012: js accessor creation on Template (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: grokdump Created 7 years, 3 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
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4436 matching lines...) Expand 10 before | Expand all | Expand 10 after
4447 kDescriptorOffset) 4447 kDescriptorOffset)
4448 4448
4449 ACCESSORS(ExecutableAccessorInfo, getter, Object, kGetterOffset) 4449 ACCESSORS(ExecutableAccessorInfo, getter, Object, kGetterOffset)
4450 ACCESSORS(ExecutableAccessorInfo, setter, Object, kSetterOffset) 4450 ACCESSORS(ExecutableAccessorInfo, setter, Object, kSetterOffset)
4451 ACCESSORS(ExecutableAccessorInfo, data, Object, kDataOffset) 4451 ACCESSORS(ExecutableAccessorInfo, data, Object, kDataOffset)
4452 4452
4453 ACCESSORS(Box, value, Object, kValueOffset) 4453 ACCESSORS(Box, value, Object, kValueOffset)
4454 4454
4455 ACCESSORS(AccessorPair, getter, Object, kGetterOffset) 4455 ACCESSORS(AccessorPair, getter, Object, kGetterOffset)
4456 ACCESSORS(AccessorPair, setter, Object, kSetterOffset) 4456 ACCESSORS(AccessorPair, setter, Object, kSetterOffset)
4457 ACCESSORS_TO_SMI(AccessorPair, access_flags, kAccessFlagsOffset)
4457 4458
4458 ACCESSORS(AccessCheckInfo, named_callback, Object, kNamedCallbackOffset) 4459 ACCESSORS(AccessCheckInfo, named_callback, Object, kNamedCallbackOffset)
4459 ACCESSORS(AccessCheckInfo, indexed_callback, Object, kIndexedCallbackOffset) 4460 ACCESSORS(AccessCheckInfo, indexed_callback, Object, kIndexedCallbackOffset)
4460 ACCESSORS(AccessCheckInfo, data, Object, kDataOffset) 4461 ACCESSORS(AccessCheckInfo, data, Object, kDataOffset)
4461 4462
4462 ACCESSORS(InterceptorInfo, getter, Object, kGetterOffset) 4463 ACCESSORS(InterceptorInfo, getter, Object, kGetterOffset)
4463 ACCESSORS(InterceptorInfo, setter, Object, kSetterOffset) 4464 ACCESSORS(InterceptorInfo, setter, Object, kSetterOffset)
4464 ACCESSORS(InterceptorInfo, query, Object, kQueryOffset) 4465 ACCESSORS(InterceptorInfo, query, Object, kQueryOffset)
4465 ACCESSORS(InterceptorInfo, deleter, Object, kDeleterOffset) 4466 ACCESSORS(InterceptorInfo, deleter, Object, kDeleterOffset)
4466 ACCESSORS(InterceptorInfo, enumerator, Object, kEnumeratorOffset) 4467 ACCESSORS(InterceptorInfo, enumerator, Object, kEnumeratorOffset)
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after
5843 } 5844 }
5844 5845
5845 5846
5846 bool AccessorInfo::IsCompatibleReceiver(Object* receiver) { 5847 bool AccessorInfo::IsCompatibleReceiver(Object* receiver) {
5847 Object* function_template = expected_receiver_type(); 5848 Object* function_template = expected_receiver_type();
5848 if (!function_template->IsFunctionTemplateInfo()) return true; 5849 if (!function_template->IsFunctionTemplateInfo()) return true;
5849 return receiver->IsInstanceOf(FunctionTemplateInfo::cast(function_template)); 5850 return receiver->IsInstanceOf(FunctionTemplateInfo::cast(function_template));
5850 } 5851 }
5851 5852
5852 5853
5854 void AccessorPair::set_access_flags(v8::AccessControl access_control) {
5855 int current = access_flags()->value();
5856 current = BooleanBit::set(current,
5857 kProhibitsOverwritingBit,
5858 access_control & PROHIBITS_OVERWRITING);
5859 current = BooleanBit::set(current,
5860 kAllCanReadBit,
5861 access_control & ALL_CAN_READ);
5862 current = BooleanBit::set(current,
5863 kAllCanWriteBit,
5864 access_control & ALL_CAN_WRITE);
5865 set_access_flags(Smi::FromInt(current));
5866 }
5867
5868
5869 bool AccessorPair::all_can_read() {
5870 return BooleanBit::get(access_flags(), kAllCanReadBit);
5871 }
5872
5873
5874 bool AccessorPair::all_can_write() {
5875 return BooleanBit::get(access_flags(), kAllCanWriteBit);
5876 }
5877
5878
5879 bool AccessorPair::prohibits_overwriting() {
5880 return BooleanBit::get(access_flags(), kProhibitsOverwritingBit);
5881 }
5882
5883
5853 template<typename Shape, typename Key> 5884 template<typename Shape, typename Key>
5854 void Dictionary<Shape, Key>::SetEntry(int entry, 5885 void Dictionary<Shape, Key>::SetEntry(int entry,
5855 Object* key, 5886 Object* key,
5856 Object* value) { 5887 Object* value) {
5857 SetEntry(entry, key, value, PropertyDetails(Smi::FromInt(0))); 5888 SetEntry(entry, key, value, PropertyDetails(Smi::FromInt(0)));
5858 } 5889 }
5859 5890
5860 5891
5861 template<typename Shape, typename Key> 5892 template<typename Shape, typename Key>
5862 void Dictionary<Shape, Key>::SetEntry(int entry, 5893 void Dictionary<Shape, Key>::SetEntry(int entry,
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
6258 #undef WRITE_UINT32_FIELD 6289 #undef WRITE_UINT32_FIELD
6259 #undef READ_SHORT_FIELD 6290 #undef READ_SHORT_FIELD
6260 #undef WRITE_SHORT_FIELD 6291 #undef WRITE_SHORT_FIELD
6261 #undef READ_BYTE_FIELD 6292 #undef READ_BYTE_FIELD
6262 #undef WRITE_BYTE_FIELD 6293 #undef WRITE_BYTE_FIELD
6263 6294
6264 6295
6265 } } // namespace v8::internal 6296 } } // namespace v8::internal
6266 6297
6267 #endif // V8_OBJECTS_INL_H_ 6298 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698