| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 Handle<Object> key) { | 730 Handle<Object> key) { |
| 731 if (key->IsSymbol()) { | 731 if (key->IsSymbol()) { |
| 732 Handle<String> name = Handle<String>::cast(key); | 732 Handle<String> name = Handle<String>::cast(key); |
| 733 | 733 |
| 734 // If the object is undefined or null it's illegal to try to get any | 734 // If the object is undefined or null it's illegal to try to get any |
| 735 // of its properties; throw a TypeError in that case. | 735 // of its properties; throw a TypeError in that case. |
| 736 if (object->IsUndefined() || object->IsNull()) { | 736 if (object->IsUndefined() || object->IsNull()) { |
| 737 return TypeError("non_object_property_load", object, name); | 737 return TypeError("non_object_property_load", object, name); |
| 738 } | 738 } |
| 739 | 739 |
| 740 // TODO(X64): Enable specialized stubs for length and prototype lookup. | |
| 741 #ifndef V8_TARGET_ARCH_X64 | |
| 742 if (FLAG_use_ic) { | 740 if (FLAG_use_ic) { |
| 743 // Use specialized code for getting the length of strings. | 741 // Use specialized code for getting the length of strings. |
| 744 if (object->IsString() && name->Equals(Heap::length_symbol())) { | 742 if (object->IsString() && name->Equals(Heap::length_symbol())) { |
| 745 Handle<String> string = Handle<String>::cast(object); | 743 Handle<String> string = Handle<String>::cast(object); |
| 746 Object* code = NULL; | 744 Object* code = NULL; |
| 747 code = StubCache::ComputeKeyedLoadStringLength(*name, *string); | 745 code = StubCache::ComputeKeyedLoadStringLength(*name, *string); |
| 748 if (code->IsFailure()) return code; | 746 if (code->IsFailure()) return code; |
| 749 set_target(Code::cast(code)); | 747 set_target(Code::cast(code)); |
| 750 #ifdef DEBUG | 748 #ifdef DEBUG |
| 751 TraceIC("KeyedLoadIC", name, state, target()); | 749 TraceIC("KeyedLoadIC", name, state, target()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 771 Object* code = | 769 Object* code = |
| 772 StubCache::ComputeKeyedLoadFunctionPrototype(*name, *function); | 770 StubCache::ComputeKeyedLoadFunctionPrototype(*name, *function); |
| 773 if (code->IsFailure()) return code; | 771 if (code->IsFailure()) return code; |
| 774 set_target(Code::cast(code)); | 772 set_target(Code::cast(code)); |
| 775 #ifdef DEBUG | 773 #ifdef DEBUG |
| 776 TraceIC("KeyedLoadIC", name, state, target()); | 774 TraceIC("KeyedLoadIC", name, state, target()); |
| 777 #endif // DEBUG | 775 #endif // DEBUG |
| 778 return Accessors::FunctionGetPrototype(*object, 0); | 776 return Accessors::FunctionGetPrototype(*object, 0); |
| 779 } | 777 } |
| 780 } | 778 } |
| 781 #endif // !V8_TARGET_ARCH_X64 | |
| 782 | 779 |
| 783 // Check if the name is trivially convertible to an index and get | 780 // Check if the name is trivially convertible to an index and get |
| 784 // the element or char if so. | 781 // the element or char if so. |
| 785 uint32_t index = 0; | 782 uint32_t index = 0; |
| 786 if (name->AsArrayIndex(&index)) { | 783 if (name->AsArrayIndex(&index)) { |
| 787 HandleScope scope; | 784 HandleScope scope; |
| 788 // Rewrite to the generic keyed load stub. | 785 // Rewrite to the generic keyed load stub. |
| 789 if (FLAG_use_ic) set_target(generic_stub()); | 786 if (FLAG_use_ic) set_target(generic_stub()); |
| 790 return Runtime::GetElementOrCharAt(object, index); | 787 return Runtime::GetElementOrCharAt(object, index); |
| 791 } | 788 } |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1362 #undef ADDR | 1359 #undef ADDR |
| 1363 }; | 1360 }; |
| 1364 | 1361 |
| 1365 | 1362 |
| 1366 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1363 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 1367 return IC_utilities[id]; | 1364 return IC_utilities[id]; |
| 1368 } | 1365 } |
| 1369 | 1366 |
| 1370 | 1367 |
| 1371 } } // namespace v8::internal | 1368 } } // namespace v8::internal |
| OLD | NEW |