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

Side by Side Diff: src/property.h

Issue 7799026: Make proxies work as prototypes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing Kevin's comments. Created 9 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.cc ('k') | src/runtime.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 number_ = -1; 195 number_ = -1;
196 } 196 }
197 197
198 void DictionaryResult(JSObject* holder, int entry) { 198 void DictionaryResult(JSObject* holder, int entry) {
199 lookup_type_ = DICTIONARY_TYPE; 199 lookup_type_ = DICTIONARY_TYPE;
200 holder_ = holder; 200 holder_ = holder;
201 details_ = holder->property_dictionary()->DetailsAt(entry); 201 details_ = holder->property_dictionary()->DetailsAt(entry);
202 number_ = entry; 202 number_ = entry;
203 } 203 }
204 204
205 void HandlerResult() { 205 void HandlerResult(JSProxy* proxy) {
206 lookup_type_ = HANDLER_TYPE; 206 lookup_type_ = HANDLER_TYPE;
207 holder_ = NULL; 207 holder_ = proxy;
208 details_ = PropertyDetails(NONE, HANDLER); 208 details_ = PropertyDetails(NONE, HANDLER);
209 cacheable_ = false; 209 cacheable_ = false;
210 } 210 }
211 211
212 void InterceptorResult(JSObject* holder) { 212 void InterceptorResult(JSObject* holder) {
213 lookup_type_ = INTERCEPTOR_TYPE; 213 lookup_type_ = INTERCEPTOR_TYPE;
214 holder_ = holder; 214 holder_ = holder;
215 details_ = PropertyDetails(NONE, INTERCEPTOR); 215 details_ = PropertyDetails(NONE, INTERCEPTOR);
216 } 216 }
217 217
218 void NotFound() { 218 void NotFound() {
219 lookup_type_ = NOT_FOUND; 219 lookup_type_ = NOT_FOUND;
220 } 220 }
221 221
222 JSObject* holder() { 222 JSObject* holder() {
223 ASSERT(IsFound()); 223 ASSERT(IsFound());
224 return holder_; 224 return JSObject::cast(holder_);
225 }
226
227 JSProxy* proxy() {
228 ASSERT(IsFound());
229 return JSProxy::cast(holder_);
225 } 230 }
226 231
227 PropertyType type() { 232 PropertyType type() {
228 ASSERT(IsFound()); 233 ASSERT(IsFound());
229 return details_.type(); 234 return details_.type();
230 } 235 }
231 236
232 PropertyAttributes GetAttributes() { 237 PropertyAttributes GetAttributes() {
233 ASSERT(IsFound()); 238 ASSERT(IsFound());
234 return details_.attributes(); 239 return details_.attributes();
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 // Where did we find the result; 352 // Where did we find the result;
348 enum { 353 enum {
349 NOT_FOUND, 354 NOT_FOUND,
350 DESCRIPTOR_TYPE, 355 DESCRIPTOR_TYPE,
351 DICTIONARY_TYPE, 356 DICTIONARY_TYPE,
352 HANDLER_TYPE, 357 HANDLER_TYPE,
353 INTERCEPTOR_TYPE, 358 INTERCEPTOR_TYPE,
354 CONSTANT_TYPE 359 CONSTANT_TYPE
355 } lookup_type_; 360 } lookup_type_;
356 361
357 JSObject* holder_; 362 JSReceiver* holder_;
358 int number_; 363 int number_;
359 bool cacheable_; 364 bool cacheable_;
360 PropertyDetails details_; 365 PropertyDetails details_;
361 }; 366 };
362 367
363 368
364 } } // namespace v8::internal 369 } } // namespace v8::internal
365 370
366 #endif // V8_PROPERTY_H_ 371 #endif // V8_PROPERTY_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698