OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 if (!fun->shared()->IsApiFunction()) | 788 if (!fun->shared()->IsApiFunction()) |
789 return true; | 789 return true; |
790 // If the object is fully fast case and has the same map it was | 790 // If the object is fully fast case and has the same map it was |
791 // created with then no changes can have been made to it. | 791 // created with then no changes can have been made to it. |
792 return map() != fun->initial_map() | 792 return map() != fun->initial_map() |
793 || !HasFastObjectElements() | 793 || !HasFastObjectElements() |
794 || !HasFastProperties(); | 794 || !HasFastProperties(); |
795 } | 795 } |
796 | 796 |
797 | 797 |
| 798 #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ <= 4) |
| 799 // Work around bad optimization by GCC 4.4.6 on PPC Linux |
| 800 #pragma GCC optimize "O0" |
| 801 #endif |
798 MaybeHandle<Object> Object::GetElementWithReceiver(Isolate* isolate, | 802 MaybeHandle<Object> Object::GetElementWithReceiver(Isolate* isolate, |
799 Handle<Object> object, | 803 Handle<Object> object, |
800 Handle<Object> receiver, | 804 Handle<Object> receiver, |
801 uint32_t index) { | 805 uint32_t index) { |
802 if (object->IsUndefined()) { | 806 if (object->IsUndefined()) { |
803 // TODO(verwaest): Why is this check here? | 807 // TODO(verwaest): Why is this check here? |
804 UNREACHABLE(); | 808 UNREACHABLE(); |
805 return isolate->factory()->undefined_value(); | 809 return isolate->factory()->undefined_value(); |
806 } | 810 } |
807 | 811 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 ASSIGN_RETURN_ON_EXCEPTION( | 846 ASSIGN_RETURN_ON_EXCEPTION( |
843 isolate, result, | 847 isolate, result, |
844 js_object->GetElementsAccessor()->Get(receiver, js_object, index), | 848 js_object->GetElementsAccessor()->Get(receiver, js_object, index), |
845 Object); | 849 Object); |
846 if (!result->IsTheHole()) return result; | 850 if (!result->IsTheHole()) return result; |
847 } | 851 } |
848 } | 852 } |
849 | 853 |
850 return isolate->factory()->undefined_value(); | 854 return isolate->factory()->undefined_value(); |
851 } | 855 } |
| 856 #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ <= 4) |
| 857 #pragma GCC reset_options |
| 858 #endif |
852 | 859 |
853 | 860 |
854 Map* Object::GetRootMap(Isolate* isolate) { | 861 Map* Object::GetRootMap(Isolate* isolate) { |
855 DisallowHeapAllocation no_alloc; | 862 DisallowHeapAllocation no_alloc; |
856 if (IsSmi()) { | 863 if (IsSmi()) { |
857 Context* context = isolate->context()->native_context(); | 864 Context* context = isolate->context()->native_context(); |
858 return context->number_function()->initial_map(); | 865 return context->number_function()->initial_map(); |
859 } | 866 } |
860 | 867 |
861 HeapObject* heap_object = HeapObject::cast(this); | 868 HeapObject* heap_object = HeapObject::cast(this); |
(...skipping 10639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11501 os << "\n"; | 11508 os << "\n"; |
11502 } | 11509 } |
11503 #endif | 11510 #endif |
11504 } | 11511 } |
11505 | 11512 |
11506 os << "RelocInfo (size = " << relocation_size() << ")\n"; | 11513 os << "RelocInfo (size = " << relocation_size() << ")\n"; |
11507 for (RelocIterator it(this); !it.done(); it.next()) { | 11514 for (RelocIterator it(this); !it.done(); it.next()) { |
11508 it.rinfo()->Print(GetIsolate(), os); | 11515 it.rinfo()->Print(GetIsolate(), os); |
11509 } | 11516 } |
11510 os << "\n"; | 11517 os << "\n"; |
| 11518 |
| 11519 if (FLAG_enable_ool_constant_pool) { |
| 11520 ConstantPoolArray *pool = constant_pool(); |
| 11521 if (pool->length()) { |
| 11522 os << "Constant Pool\n"; |
| 11523 pool->Print(os); |
| 11524 os << "\n"; |
| 11525 } |
| 11526 } |
11511 } | 11527 } |
11512 #endif // ENABLE_DISASSEMBLER | 11528 #endif // ENABLE_DISASSEMBLER |
11513 | 11529 |
11514 | 11530 |
11515 Handle<FixedArray> JSObject::SetFastElementsCapacityAndLength( | 11531 Handle<FixedArray> JSObject::SetFastElementsCapacityAndLength( |
11516 Handle<JSObject> object, | 11532 Handle<JSObject> object, |
11517 int capacity, | 11533 int capacity, |
11518 int length, | 11534 int length, |
11519 SetFastElementsCapacitySmiMode smi_mode) { | 11535 SetFastElementsCapacitySmiMode smi_mode) { |
11520 // We should never end in here with a pixel or external array. | 11536 // We should never end in here with a pixel or external array. |
(...skipping 5425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16946 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16962 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16947 static const char* error_messages_[] = { | 16963 static const char* error_messages_[] = { |
16948 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16964 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16949 }; | 16965 }; |
16950 #undef ERROR_MESSAGES_TEXTS | 16966 #undef ERROR_MESSAGES_TEXTS |
16951 return error_messages_[reason]; | 16967 return error_messages_[reason]; |
16952 } | 16968 } |
16953 | 16969 |
16954 | 16970 |
16955 } } // namespace v8::internal | 16971 } } // namespace v8::internal |
OLD | NEW |