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

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

Issue 11365111: Object.observe: generate change records for indexed properties. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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 5066 matching lines...) Expand 10 before | Expand all | Expand 10 after
5077 } 5077 }
5078 return GetLocalPropertyAttribute(name) != ABSENT; 5078 return GetLocalPropertyAttribute(name) != ABSENT;
5079 } 5079 }
5080 5080
5081 5081
5082 PropertyAttributes JSReceiver::GetPropertyAttribute(String* key) { 5082 PropertyAttributes JSReceiver::GetPropertyAttribute(String* key) {
5083 return GetPropertyAttributeWithReceiver(this, key); 5083 return GetPropertyAttributeWithReceiver(this, key);
5084 } 5084 }
5085 5085
5086 5086
5087 PropertyAttributes JSReceiver::GetElementAttribute(uint32_t index) {
5088 return GetElementAttributeWithReceiver(this, index);
5089 }
5090
5091
5087 // TODO(504): this may be useful in other places too where JSGlobalProxy 5092 // TODO(504): this may be useful in other places too where JSGlobalProxy
5088 // is used. 5093 // is used.
5089 Object* JSObject::BypassGlobalProxy() { 5094 Object* JSObject::BypassGlobalProxy() {
5090 if (IsJSGlobalProxy()) { 5095 if (IsJSGlobalProxy()) {
5091 Object* proto = GetPrototype(); 5096 Object* proto = GetPrototype();
5092 if (proto->IsNull()) return GetHeap()->undefined_value(); 5097 if (proto->IsNull()) return GetHeap()->undefined_value();
5093 ASSERT(proto->IsJSGlobalObject()); 5098 ASSERT(proto->IsJSGlobalObject());
5094 return proto; 5099 return proto;
5095 } 5100 }
5096 return this; 5101 return this;
5097 } 5102 }
5098 5103
5099 5104
5100 MaybeObject* JSReceiver::GetIdentityHash(CreationFlag flag) { 5105 MaybeObject* JSReceiver::GetIdentityHash(CreationFlag flag) {
5101 return IsJSProxy() 5106 return IsJSProxy()
5102 ? JSProxy::cast(this)->GetIdentityHash(flag) 5107 ? JSProxy::cast(this)->GetIdentityHash(flag)
5103 : JSObject::cast(this)->GetIdentityHash(flag); 5108 : JSObject::cast(this)->GetIdentityHash(flag);
5104 } 5109 }
5105 5110
5106 5111
5107 bool JSReceiver::HasElement(uint32_t index) { 5112 bool JSReceiver::HasElement(uint32_t index) {
5108 if (IsJSProxy()) { 5113 if (IsJSProxy()) {
5109 return JSProxy::cast(this)->HasElementWithHandler(index); 5114 return JSProxy::cast(this)->HasElementWithHandler(index);
5110 } 5115 }
5111 return JSObject::cast(this)->HasElementWithReceiver(this, index); 5116 return JSObject::cast(this)->HasElementWithReceiver(this, index);
5112 } 5117 }
5113 5118
5114 5119
5120 bool JSReceiver::HasLocalElement(uint32_t index) {
5121 if (IsJSProxy()) {
5122 return JSProxy::cast(this)->HasElementWithHandler(index);
5123 }
5124 return JSObject::cast(this)->HasLocalElement(index);
5125 }
5126
5127
5128 PropertyAttributes JSReceiver::GetLocalElementAttribute(uint32_t index) {
5129 if (IsJSProxy()) {
5130 return JSProxy::cast(this)->GetElementAttributeWithHandler(this, index);
5131 }
5132 return JSObject::cast(this)->GetLocalElementAttribute(index);
5133 }
5134
5135
5115 bool AccessorInfo::all_can_read() { 5136 bool AccessorInfo::all_can_read() {
5116 return BooleanBit::get(flag(), kAllCanReadBit); 5137 return BooleanBit::get(flag(), kAllCanReadBit);
5117 } 5138 }
5118 5139
5119 5140
5120 void AccessorInfo::set_all_can_read(bool value) { 5141 void AccessorInfo::set_all_can_read(bool value) {
5121 set_flag(BooleanBit::set(flag(), kAllCanReadBit, value)); 5142 set_flag(BooleanBit::set(flag(), kAllCanReadBit, value));
5122 } 5143 }
5123 5144
5124 5145
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
5560 #undef WRITE_UINT32_FIELD 5581 #undef WRITE_UINT32_FIELD
5561 #undef READ_SHORT_FIELD 5582 #undef READ_SHORT_FIELD
5562 #undef WRITE_SHORT_FIELD 5583 #undef WRITE_SHORT_FIELD
5563 #undef READ_BYTE_FIELD 5584 #undef READ_BYTE_FIELD
5564 #undef WRITE_BYTE_FIELD 5585 #undef WRITE_BYTE_FIELD
5565 5586
5566 5587
5567 } } // namespace v8::internal 5588 } } // namespace v8::internal
5568 5589
5569 #endif // V8_OBJECTS_INL_H_ 5590 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/objects.cc ('K') | « src/objects.cc ('k') | test/mjsunit/harmony/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698