| 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 if (check_type_ == RECEIVER_MAP_CHECK) { | 513 if (check_type_ == RECEIVER_MAP_CHECK) { |
| 514 // For primitive checks the holder is set up to point to the corresponding | 514 // For primitive checks the holder is set up to point to the corresponding |
| 515 // prototype object, i.e. one step of the algorithm below has been already | 515 // prototype object, i.e. one step of the algorithm below has been already |
| 516 // performed. For non-primitive checks we clear it to allow computing | 516 // performed. For non-primitive checks we clear it to allow computing |
| 517 // targets for polymorphic calls. | 517 // targets for polymorphic calls. |
| 518 holder_ = Handle<JSObject>::null(); | 518 holder_ = Handle<JSObject>::null(); |
| 519 } | 519 } |
| 520 LookupResult lookup(type->GetIsolate()); | 520 LookupResult lookup(type->GetIsolate()); |
| 521 while (true) { | 521 while (true) { |
| 522 type->LookupInDescriptors(NULL, *name, &lookup); | 522 type->LookupInDescriptors(NULL, *name, &lookup); |
| 523 // For properties we know the target iff we have a constant function. | 523 if (lookup.IsFound()) { |
| 524 if (lookup.IsFound() && lookup.IsProperty()) { | 524 switch (lookup.type()) { |
| 525 if (lookup.type() == CONSTANT_FUNCTION) { | 525 case CONSTANT_FUNCTION: |
| 526 target_ = Handle<JSFunction>(lookup.GetConstantFunctionFromMap(*type)); | 526 // We surely know the target for a constant function. |
| 527 return true; | 527 target_ = Handle<JSFunction>(lookup.GetConstantFunctionFromMap(*type))
; |
| 528 return true; |
| 529 case NORMAL: |
| 530 case FIELD: |
| 531 case CALLBACKS: |
| 532 case HANDLER: |
| 533 case INTERCEPTOR: |
| 534 // We don't know the target. |
| 535 return false; |
| 536 case MAP_TRANSITION: |
| 537 case ELEMENTS_TRANSITION: |
| 538 case CONSTANT_TRANSITION: |
| 539 case NULL_DESCRIPTOR: |
| 540 // Perhaps something interesting is up in the prototype chain... |
| 541 break; |
| 528 } | 542 } |
| 529 return false; | |
| 530 } | 543 } |
| 531 // If we reach the end of the prototype chain, we don't know the target. | 544 // If we reach the end of the prototype chain, we don't know the target. |
| 532 if (!type->prototype()->IsJSObject()) return false; | 545 if (!type->prototype()->IsJSObject()) return false; |
| 533 // Go up the prototype chain, recording where we are currently. | 546 // Go up the prototype chain, recording where we are currently. |
| 534 holder_ = Handle<JSObject>(JSObject::cast(type->prototype())); | 547 holder_ = Handle<JSObject>(JSObject::cast(type->prototype())); |
| 535 type = Handle<Map>(holder()->map()); | 548 type = Handle<Map>(holder()->map()); |
| 536 } | 549 } |
| 537 } | 550 } |
| 538 | 551 |
| 539 | 552 |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 (node->name()->IsEqualTo(CStrVector("_ArgumentsLength")) || | 1158 (node->name()->IsEqualTo(CStrVector("_ArgumentsLength")) || |
| 1146 node->name()->IsEqualTo(CStrVector("_Arguments")))) { | 1159 node->name()->IsEqualTo(CStrVector("_Arguments")))) { |
| 1147 // Don't inline the %_ArgumentsLength or %_Arguments because their | 1160 // Don't inline the %_ArgumentsLength or %_Arguments because their |
| 1148 // implementation will not work. There is no stack frame to get them | 1161 // implementation will not work. There is no stack frame to get them |
| 1149 // from. | 1162 // from. |
| 1150 add_flag(kDontInline); | 1163 add_flag(kDontInline); |
| 1151 } | 1164 } |
| 1152 } | 1165 } |
| 1153 | 1166 |
| 1154 } } // namespace v8::internal | 1167 } } // namespace v8::internal |
| OLD | NEW |