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

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

Powered by Google App Engine
This is Rietveld 408576698