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 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 if (!fun->shared()->IsApiFunction()) | 745 if (!fun->shared()->IsApiFunction()) |
746 return true; | 746 return true; |
747 // If the object is fully fast case and has the same map it was | 747 // If the object is fully fast case and has the same map it was |
748 // created with then no changes can have been made to it. | 748 // created with then no changes can have been made to it. |
749 return map() != fun->initial_map() | 749 return map() != fun->initial_map() |
750 || !HasFastObjectElements() | 750 || !HasFastObjectElements() |
751 || !HasFastProperties(); | 751 || !HasFastProperties(); |
752 } | 752 } |
753 | 753 |
754 | 754 |
| 755 #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ <= 4) |
| 756 // Work around bad optimization by GCC 4.4.6 on PPC Linux |
| 757 #pragma GCC optimize "O0" |
| 758 #endif |
755 MaybeHandle<Object> Object::GetElementWithReceiver(Isolate* isolate, | 759 MaybeHandle<Object> Object::GetElementWithReceiver(Isolate* isolate, |
756 Handle<Object> object, | 760 Handle<Object> object, |
757 Handle<Object> receiver, | 761 Handle<Object> receiver, |
758 uint32_t index) { | 762 uint32_t index) { |
759 if (object->IsUndefined()) { | 763 if (object->IsUndefined()) { |
760 // TODO(verwaest): Why is this check here? | 764 // TODO(verwaest): Why is this check here? |
761 UNREACHABLE(); | 765 UNREACHABLE(); |
762 return isolate->factory()->undefined_value(); | 766 return isolate->factory()->undefined_value(); |
763 } | 767 } |
764 | 768 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 ASSIGN_RETURN_ON_EXCEPTION( | 803 ASSIGN_RETURN_ON_EXCEPTION( |
800 isolate, result, | 804 isolate, result, |
801 js_object->GetElementsAccessor()->Get(receiver, js_object, index), | 805 js_object->GetElementsAccessor()->Get(receiver, js_object, index), |
802 Object); | 806 Object); |
803 if (!result->IsTheHole()) return result; | 807 if (!result->IsTheHole()) return result; |
804 } | 808 } |
805 } | 809 } |
806 | 810 |
807 return isolate->factory()->undefined_value(); | 811 return isolate->factory()->undefined_value(); |
808 } | 812 } |
| 813 #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ <= 4) |
| 814 #pragma GCC reset_options |
| 815 #endif |
809 | 816 |
810 | 817 |
811 Map* Object::GetRootMap(Isolate* isolate) { | 818 Map* Object::GetRootMap(Isolate* isolate) { |
812 DisallowHeapAllocation no_alloc; | 819 DisallowHeapAllocation no_alloc; |
813 if (IsSmi()) { | 820 if (IsSmi()) { |
814 Context* context = isolate->context()->native_context(); | 821 Context* context = isolate->context()->native_context(); |
815 return context->number_function()->initial_map(); | 822 return context->number_function()->initial_map(); |
816 } | 823 } |
817 | 824 |
818 HeapObject* heap_object = HeapObject::cast(this); | 825 HeapObject* heap_object = HeapObject::cast(this); |
(...skipping 10387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11206 os << "\n"; | 11213 os << "\n"; |
11207 } | 11214 } |
11208 #endif | 11215 #endif |
11209 } | 11216 } |
11210 | 11217 |
11211 os << "RelocInfo (size = " << relocation_size() << ")\n"; | 11218 os << "RelocInfo (size = " << relocation_size() << ")\n"; |
11212 for (RelocIterator it(this); !it.done(); it.next()) { | 11219 for (RelocIterator it(this); !it.done(); it.next()) { |
11213 it.rinfo()->Print(GetIsolate(), os); | 11220 it.rinfo()->Print(GetIsolate(), os); |
11214 } | 11221 } |
11215 os << "\n"; | 11222 os << "\n"; |
| 11223 |
| 11224 if (FLAG_enable_ool_constant_pool) { |
| 11225 ConstantPoolArray* pool = constant_pool(); |
| 11226 if (pool->length()) { |
| 11227 os << "Constant Pool\n"; |
| 11228 pool->Print(os); |
| 11229 os << "\n"; |
| 11230 } |
| 11231 } |
11216 } | 11232 } |
11217 #endif // ENABLE_DISASSEMBLER | 11233 #endif // ENABLE_DISASSEMBLER |
11218 | 11234 |
11219 | 11235 |
11220 Handle<FixedArray> JSObject::SetFastElementsCapacityAndLength( | 11236 Handle<FixedArray> JSObject::SetFastElementsCapacityAndLength( |
11221 Handle<JSObject> object, | 11237 Handle<JSObject> object, |
11222 int capacity, | 11238 int capacity, |
11223 int length, | 11239 int length, |
11224 SetFastElementsCapacitySmiMode smi_mode) { | 11240 SetFastElementsCapacitySmiMode smi_mode) { |
11225 // We should never end in here with a pixel or external array. | 11241 // We should never end in here with a pixel or external array. |
(...skipping 5433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16659 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16675 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16660 static const char* error_messages_[] = { | 16676 static const char* error_messages_[] = { |
16661 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16677 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16662 }; | 16678 }; |
16663 #undef ERROR_MESSAGES_TEXTS | 16679 #undef ERROR_MESSAGES_TEXTS |
16664 return error_messages_[reason]; | 16680 return error_messages_[reason]; |
16665 } | 16681 } |
16666 | 16682 |
16667 | 16683 |
16668 } } // namespace v8::internal | 16684 } } // namespace v8::internal |
OLD | NEW |