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

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

Issue 10442129: Implement implicit instance checks for API accessors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Daniel Clifford. Created 8 years, 6 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/stub-cache.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 3496 matching lines...) Expand 10 before | Expand all | Expand 10 after
3507 Object* object = READ_FIELD(this, kPrototypeTransitionsOrBackPointerOffset); 3507 Object* object = READ_FIELD(this, kPrototypeTransitionsOrBackPointerOffset);
3508 return reinterpret_cast<HeapObject*>(object); 3508 return reinterpret_cast<HeapObject*>(object);
3509 } 3509 }
3510 3510
3511 3511
3512 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) 3512 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset)
3513 ACCESSORS(Map, constructor, Object, kConstructorOffset) 3513 ACCESSORS(Map, constructor, Object, kConstructorOffset)
3514 3514
3515 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) 3515 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset)
3516 ACCESSORS(JSFunction, literals_or_bindings, FixedArray, kLiteralsOffset) 3516 ACCESSORS(JSFunction, literals_or_bindings, FixedArray, kLiteralsOffset)
3517 ACCESSORS(JSFunction, 3517 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset)
3518 next_function_link,
3519 Object,
3520 kNextFunctionLinkOffset)
3521 3518
3522 ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset) 3519 ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset)
3523 ACCESSORS(GlobalObject, global_context, Context, kGlobalContextOffset) 3520 ACCESSORS(GlobalObject, global_context, Context, kGlobalContextOffset)
3524 ACCESSORS(GlobalObject, global_receiver, JSObject, kGlobalReceiverOffset) 3521 ACCESSORS(GlobalObject, global_receiver, JSObject, kGlobalReceiverOffset)
3525 3522
3526 ACCESSORS(JSGlobalProxy, context, Object, kContextOffset) 3523 ACCESSORS(JSGlobalProxy, context, Object, kContextOffset)
3527 3524
3528 ACCESSORS(AccessorInfo, getter, Object, kGetterOffset) 3525 ACCESSORS(AccessorInfo, getter, Object, kGetterOffset)
3529 ACCESSORS(AccessorInfo, setter, Object, kSetterOffset) 3526 ACCESSORS(AccessorInfo, setter, Object, kSetterOffset)
3530 ACCESSORS(AccessorInfo, data, Object, kDataOffset) 3527 ACCESSORS(AccessorInfo, data, Object, kDataOffset)
3531 ACCESSORS(AccessorInfo, name, Object, kNameOffset) 3528 ACCESSORS(AccessorInfo, name, Object, kNameOffset)
3532 ACCESSORS_TO_SMI(AccessorInfo, flag, kFlagOffset) 3529 ACCESSORS_TO_SMI(AccessorInfo, flag, kFlagOffset)
3530 ACCESSORS(AccessorInfo, expected_receiver_type, Object,
3531 kExpectedReceiverTypeOffset)
3533 3532
3534 ACCESSORS(AccessorPair, getter, Object, kGetterOffset) 3533 ACCESSORS(AccessorPair, getter, Object, kGetterOffset)
3535 ACCESSORS(AccessorPair, setter, Object, kSetterOffset) 3534 ACCESSORS(AccessorPair, setter, Object, kSetterOffset)
3536 3535
3537 ACCESSORS(AccessCheckInfo, named_callback, Object, kNamedCallbackOffset) 3536 ACCESSORS(AccessCheckInfo, named_callback, Object, kNamedCallbackOffset)
3538 ACCESSORS(AccessCheckInfo, indexed_callback, Object, kIndexedCallbackOffset) 3537 ACCESSORS(AccessCheckInfo, indexed_callback, Object, kIndexedCallbackOffset)
3539 ACCESSORS(AccessCheckInfo, data, Object, kDataOffset) 3538 ACCESSORS(AccessCheckInfo, data, Object, kDataOffset)
3540 3539
3541 ACCESSORS(InterceptorInfo, getter, Object, kGetterOffset) 3540 ACCESSORS(InterceptorInfo, getter, Object, kGetterOffset)
3542 ACCESSORS(InterceptorInfo, setter, Object, kSetterOffset) 3541 ACCESSORS(InterceptorInfo, setter, Object, kSetterOffset)
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
4734 PropertyAttributes AccessorInfo::property_attributes() { 4733 PropertyAttributes AccessorInfo::property_attributes() {
4735 return AttributesField::decode(static_cast<uint32_t>(flag()->value())); 4734 return AttributesField::decode(static_cast<uint32_t>(flag()->value()));
4736 } 4735 }
4737 4736
4738 4737
4739 void AccessorInfo::set_property_attributes(PropertyAttributes attributes) { 4738 void AccessorInfo::set_property_attributes(PropertyAttributes attributes) {
4740 set_flag(Smi::FromInt(AttributesField::update(flag()->value(), attributes))); 4739 set_flag(Smi::FromInt(AttributesField::update(flag()->value(), attributes)));
4741 } 4740 }
4742 4741
4743 4742
4743 bool AccessorInfo::IsCompatibleReceiver(Object* receiver) {
4744 Object* function_template = expected_receiver_type();
4745 if (!function_template->IsFunctionTemplateInfo()) return true;
4746 return receiver->IsInstanceOf(FunctionTemplateInfo::cast(function_template));
4747 }
4748
4749
4744 template<typename Shape, typename Key> 4750 template<typename Shape, typename Key>
4745 void Dictionary<Shape, Key>::SetEntry(int entry, 4751 void Dictionary<Shape, Key>::SetEntry(int entry,
4746 Object* key, 4752 Object* key,
4747 Object* value) { 4753 Object* value) {
4748 SetEntry(entry, key, value, PropertyDetails(Smi::FromInt(0))); 4754 SetEntry(entry, key, value, PropertyDetails(Smi::FromInt(0)));
4749 } 4755 }
4750 4756
4751 4757
4752 template<typename Shape, typename Key> 4758 template<typename Shape, typename Key>
4753 void Dictionary<Shape, Key>::SetEntry(int entry, 4759 void Dictionary<Shape, Key>::SetEntry(int entry,
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
5066 #undef WRITE_UINT32_FIELD 5072 #undef WRITE_UINT32_FIELD
5067 #undef READ_SHORT_FIELD 5073 #undef READ_SHORT_FIELD
5068 #undef WRITE_SHORT_FIELD 5074 #undef WRITE_SHORT_FIELD
5069 #undef READ_BYTE_FIELD 5075 #undef READ_BYTE_FIELD
5070 #undef WRITE_BYTE_FIELD 5076 #undef WRITE_BYTE_FIELD
5071 5077
5072 5078
5073 } } // namespace v8::internal 5079 } } // namespace v8::internal
5074 5080
5075 #endif // V8_OBJECTS_INL_H_ 5081 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects-debug.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698