| OLD | NEW |
| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 number_ = number; | 196 number_ = number; |
| 197 } | 197 } |
| 198 | 198 |
| 199 void TransitionResult(JSObject* holder, int number) { | 199 void TransitionResult(JSObject* holder, int number) { |
| 200 lookup_type_ = TRANSITION_TYPE; | 200 lookup_type_ = TRANSITION_TYPE; |
| 201 details_ = PropertyDetails(NONE, TRANSITION); | 201 details_ = PropertyDetails(NONE, TRANSITION); |
| 202 holder_ = holder; | 202 holder_ = holder; |
| 203 number_ = number; | 203 number_ = number; |
| 204 } | 204 } |
| 205 | 205 |
| 206 void ConstantResult(JSObject* holder) { |
| 207 lookup_type_ = CONSTANT_TYPE; |
| 208 holder_ = holder; |
| 209 details_ = |
| 210 PropertyDetails(static_cast<PropertyAttributes>(DONT_ENUM | |
| 211 DONT_DELETE), |
| 212 CALLBACKS); |
| 213 number_ = -1; |
| 214 } |
| 215 |
| 206 void DictionaryResult(JSObject* holder, int entry) { | 216 void DictionaryResult(JSObject* holder, int entry) { |
| 207 lookup_type_ = DICTIONARY_TYPE; | 217 lookup_type_ = DICTIONARY_TYPE; |
| 208 holder_ = holder; | 218 holder_ = holder; |
| 209 details_ = holder->property_dictionary()->DetailsAt(entry); | 219 details_ = holder->property_dictionary()->DetailsAt(entry); |
| 210 number_ = entry; | 220 number_ = entry; |
| 211 } | 221 } |
| 212 | 222 |
| 213 void HandlerResult(JSProxy* proxy) { | 223 void HandlerResult(JSProxy* proxy) { |
| 214 lookup_type_ = HANDLER_TYPE; | 224 lookup_type_ = HANDLER_TYPE; |
| 215 holder_ = proxy; | 225 holder_ = proxy; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 ASSERT(type() == CONSTANT_FUNCTION); | 422 ASSERT(type() == CONSTANT_FUNCTION); |
| 413 return JSFunction::cast(GetValue()); | 423 return JSFunction::cast(GetValue()); |
| 414 } | 424 } |
| 415 | 425 |
| 416 JSFunction* GetConstantFunctionFromMap(Map* map) { | 426 JSFunction* GetConstantFunctionFromMap(Map* map) { |
| 417 ASSERT(type() == CONSTANT_FUNCTION); | 427 ASSERT(type() == CONSTANT_FUNCTION); |
| 418 return JSFunction::cast(GetValueFromMap(map)); | 428 return JSFunction::cast(GetValueFromMap(map)); |
| 419 } | 429 } |
| 420 | 430 |
| 421 Object* GetCallbackObject() { | 431 Object* GetCallbackObject() { |
| 422 ASSERT(type() == CALLBACKS && !IsTransition()); | 432 if (lookup_type_ == CONSTANT_TYPE) { |
| 433 return HEAP->prototype_accessors(); |
| 434 } |
| 435 ASSERT(!IsTransition()); |
| 423 return GetValue(); | 436 return GetValue(); |
| 424 } | 437 } |
| 425 | 438 |
| 426 #ifdef OBJECT_PRINT | 439 #ifdef OBJECT_PRINT |
| 427 void Print(FILE* out); | 440 void Print(FILE* out); |
| 428 #endif | 441 #endif |
| 429 | 442 |
| 430 Object* GetValue() { | 443 Object* GetValue() { |
| 431 if (lookup_type_ == DESCRIPTOR_TYPE) { | 444 if (lookup_type_ == DESCRIPTOR_TYPE) { |
| 432 return GetValueFromMap(holder()->map()); | 445 return GetValueFromMap(holder()->map()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 448 Isolate* isolate_; | 461 Isolate* isolate_; |
| 449 LookupResult* next_; | 462 LookupResult* next_; |
| 450 | 463 |
| 451 // Where did we find the result; | 464 // Where did we find the result; |
| 452 enum { | 465 enum { |
| 453 NOT_FOUND, | 466 NOT_FOUND, |
| 454 DESCRIPTOR_TYPE, | 467 DESCRIPTOR_TYPE, |
| 455 TRANSITION_TYPE, | 468 TRANSITION_TYPE, |
| 456 DICTIONARY_TYPE, | 469 DICTIONARY_TYPE, |
| 457 HANDLER_TYPE, | 470 HANDLER_TYPE, |
| 458 INTERCEPTOR_TYPE | 471 INTERCEPTOR_TYPE, |
| 472 CONSTANT_TYPE |
| 459 } lookup_type_; | 473 } lookup_type_; |
| 460 | 474 |
| 461 JSReceiver* holder_; | 475 JSReceiver* holder_; |
| 462 int number_; | 476 int number_; |
| 463 bool cacheable_; | 477 bool cacheable_; |
| 464 PropertyDetails details_; | 478 PropertyDetails details_; |
| 465 }; | 479 }; |
| 466 | 480 |
| 467 | 481 |
| 468 } } // namespace v8::internal | 482 } } // namespace v8::internal |
| 469 | 483 |
| 470 #endif // V8_PROPERTY_H_ | 484 #endif // V8_PROPERTY_H_ |
| OLD | NEW |