| 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 4496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4507 return receiver->FastPropertyAt(result.representation(), offset); | 4507 return receiver->FastPropertyAt(result.representation(), offset); |
| 4508 } | 4508 } |
| 4509 } else { | 4509 } else { |
| 4510 // Attempt dictionary lookup. | 4510 // Attempt dictionary lookup. |
| 4511 NameDictionary* dictionary = receiver->property_dictionary(); | 4511 NameDictionary* dictionary = receiver->property_dictionary(); |
| 4512 int entry = dictionary->FindEntry(key); | 4512 int entry = dictionary->FindEntry(key); |
| 4513 if ((entry != NameDictionary::kNotFound) && | 4513 if ((entry != NameDictionary::kNotFound) && |
| 4514 (dictionary->DetailsAt(entry).type() == NORMAL)) { | 4514 (dictionary->DetailsAt(entry).type() == NORMAL)) { |
| 4515 Object* value = dictionary->ValueAt(entry); | 4515 Object* value = dictionary->ValueAt(entry); |
| 4516 if (!receiver->IsGlobalObject()) return value; | 4516 if (!receiver->IsGlobalObject()) return value; |
| 4517 value = JSGlobalPropertyCell::cast(value)->value(); | 4517 value = PropertyCell::cast(value)->value(); |
| 4518 if (!value->IsTheHole()) return value; | 4518 if (!value->IsTheHole()) return value; |
| 4519 // If value is the hole do the general lookup. | 4519 // If value is the hole do the general lookup. |
| 4520 } | 4520 } |
| 4521 } | 4521 } |
| 4522 } else if (FLAG_smi_only_arrays && args.at<Object>(1)->IsSmi()) { | 4522 } else if (FLAG_smi_only_arrays && args.at<Object>(1)->IsSmi()) { |
| 4523 // JSObject without a name key. If the key is a Smi, check for a | 4523 // JSObject without a name key. If the key is a Smi, check for a |
| 4524 // definite out-of-bounds access to elements, which is a strong indicator | 4524 // definite out-of-bounds access to elements, which is a strong indicator |
| 4525 // that subsequent accesses will also call the runtime. Proactively | 4525 // that subsequent accesses will also call the runtime. Proactively |
| 4526 // transition elements to FAST_*_ELEMENTS to avoid excessive boxing of | 4526 // transition elements to FAST_*_ELEMENTS to avoid excessive boxing of |
| 4527 // doubles for those future calls in the case that the elements would | 4527 // doubles for those future calls in the case that the elements would |
| (...skipping 9107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13635 // Handle last resort GC and make sure to allow future allocations | 13635 // Handle last resort GC and make sure to allow future allocations |
| 13636 // to grow the heap without causing GCs (if possible). | 13636 // to grow the heap without causing GCs (if possible). |
| 13637 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13637 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13638 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13638 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13639 "Runtime::PerformGC"); | 13639 "Runtime::PerformGC"); |
| 13640 } | 13640 } |
| 13641 } | 13641 } |
| 13642 | 13642 |
| 13643 | 13643 |
| 13644 } } // namespace v8::internal | 13644 } } // namespace v8::internal |
| OLD | NEW |