| OLD | NEW |
| 1 // Copyright (c) 2011 Sun Microsystems Inc. | 1 // Copyright (c) 2011 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // The original source code covered by the above license above has been | 31 // The original source code covered by the above license above has been |
| 32 // modified significantly by Google Inc. | 32 // modified significantly by Google Inc. |
| 33 // Copyright 2011 the V8 project authors. All rights reserved. | 33 // Copyright 2011 the V8 project authors. All rights reserved. |
| 34 | 34 |
| 35 #include "v8.h" | 35 #include "v8.h" |
| 36 | 36 |
| 37 #include "arguments.h" | 37 #include "arguments.h" |
| 38 #include "deoptimizer.h" | 38 #include "deoptimizer.h" |
| 39 #include "execution.h" | 39 #include "execution.h" |
| 40 #include "ic-inl.h" | 40 #include "ic-inl.h" |
| 41 #include "incremental-marking.h" |
| 41 #include "factory.h" | 42 #include "factory.h" |
| 42 #include "runtime.h" | 43 #include "runtime.h" |
| 43 #include "runtime-profiler.h" | 44 #include "runtime-profiler.h" |
| 44 #include "serialize.h" | 45 #include "serialize.h" |
| 45 #include "stub-cache.h" | 46 #include "stub-cache.h" |
| 46 #include "regexp-stack.h" | 47 #include "regexp-stack.h" |
| 47 #include "ast.h" | 48 #include "ast.h" |
| 48 #include "regexp-macro-assembler.h" | 49 #include "regexp-macro-assembler.h" |
| 49 #include "platform.h" | 50 #include "platform.h" |
| 51 #include "store-buffer.h" |
| 50 // Include native regexp-macro-assembler. | 52 // Include native regexp-macro-assembler. |
| 51 #ifndef V8_INTERPRETED_REGEXP | 53 #ifndef V8_INTERPRETED_REGEXP |
| 52 #if V8_TARGET_ARCH_IA32 | 54 #if V8_TARGET_ARCH_IA32 |
| 53 #include "ia32/regexp-macro-assembler-ia32.h" | 55 #include "ia32/regexp-macro-assembler-ia32.h" |
| 54 #elif V8_TARGET_ARCH_X64 | 56 #elif V8_TARGET_ARCH_X64 |
| 55 #include "x64/regexp-macro-assembler-x64.h" | 57 #include "x64/regexp-macro-assembler-x64.h" |
| 56 #elif V8_TARGET_ARCH_ARM | 58 #elif V8_TARGET_ARCH_ARM |
| 57 #include "arm/regexp-macro-assembler-arm.h" | 59 #include "arm/regexp-macro-assembler-arm.h" |
| 58 #elif V8_TARGET_ARCH_MIPS | 60 #elif V8_TARGET_ARCH_MIPS |
| 59 #include "mips/regexp-macro-assembler-mips.h" | 61 #include "mips/regexp-macro-assembler-mips.h" |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 int rmode = extra_tag + RelocInfo::LAST_COMPACT_ENUM; | 511 int rmode = extra_tag + RelocInfo::LAST_COMPACT_ENUM; |
| 510 if (SetMode(static_cast<RelocInfo::Mode>(rmode))) return; | 512 if (SetMode(static_cast<RelocInfo::Mode>(rmode))) return; |
| 511 } | 513 } |
| 512 } | 514 } |
| 513 } | 515 } |
| 514 done_ = true; | 516 done_ = true; |
| 515 } | 517 } |
| 516 | 518 |
| 517 | 519 |
| 518 RelocIterator::RelocIterator(Code* code, int mode_mask) { | 520 RelocIterator::RelocIterator(Code* code, int mode_mask) { |
| 521 rinfo_.host_ = code; |
| 519 rinfo_.pc_ = code->instruction_start(); | 522 rinfo_.pc_ = code->instruction_start(); |
| 520 rinfo_.data_ = 0; | 523 rinfo_.data_ = 0; |
| 521 // Relocation info is read backwards. | 524 // Relocation info is read backwards. |
| 522 pos_ = code->relocation_start() + code->relocation_size(); | 525 pos_ = code->relocation_start() + code->relocation_size(); |
| 523 end_ = code->relocation_start(); | 526 end_ = code->relocation_start(); |
| 524 done_ = false; | 527 done_ = false; |
| 525 mode_mask_ = mode_mask; | 528 mode_mask_ = mode_mask; |
| 526 last_id_ = 0; | 529 last_id_ = 0; |
| 527 last_position_ = 0; | 530 last_position_ = 0; |
| 528 if (mode_mask_ == 0) pos_ = end_; | 531 if (mode_mask_ == 0) pos_ = end_; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 | 732 |
| 730 | 733 |
| 731 ExternalReference::ExternalReference(Isolate::AddressId id, Isolate* isolate) | 734 ExternalReference::ExternalReference(Isolate::AddressId id, Isolate* isolate) |
| 732 : address_(isolate->get_address_from_id(id)) {} | 735 : address_(isolate->get_address_from_id(id)) {} |
| 733 | 736 |
| 734 | 737 |
| 735 ExternalReference::ExternalReference(const SCTableReference& table_ref) | 738 ExternalReference::ExternalReference(const SCTableReference& table_ref) |
| 736 : address_(table_ref.address()) {} | 739 : address_(table_ref.address()) {} |
| 737 | 740 |
| 738 | 741 |
| 739 ExternalReference ExternalReference::perform_gc_function(Isolate* isolate) { | 742 ExternalReference ExternalReference:: |
| 740 return ExternalReference(Redirect(isolate, | 743 incremental_marking_record_write_function(Isolate* isolate) { |
| 741 FUNCTION_ADDR(Runtime::PerformGC))); | 744 return ExternalReference(Redirect( |
| 745 isolate, |
| 746 FUNCTION_ADDR(IncrementalMarking::RecordWriteFromCode))); |
| 742 } | 747 } |
| 743 | 748 |
| 744 | 749 |
| 750 ExternalReference ExternalReference:: |
| 751 incremental_evacuation_record_write_function(Isolate* isolate) { |
| 752 return ExternalReference(Redirect( |
| 753 isolate, |
| 754 FUNCTION_ADDR(IncrementalMarking::RecordWriteForEvacuationFromCode))); |
| 755 } |
| 756 |
| 757 |
| 758 ExternalReference ExternalReference:: |
| 759 store_buffer_overflow_function(Isolate* isolate) { |
| 760 return ExternalReference(Redirect( |
| 761 isolate, |
| 762 FUNCTION_ADDR(StoreBuffer::StoreBufferOverflow))); |
| 763 } |
| 764 |
| 765 |
| 766 ExternalReference ExternalReference::flush_icache_function(Isolate* isolate) { |
| 767 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(CPU::FlushICache))); |
| 768 } |
| 769 |
| 770 |
| 771 ExternalReference ExternalReference::perform_gc_function(Isolate* isolate) { |
| 772 return |
| 773 ExternalReference(Redirect(isolate, FUNCTION_ADDR(Runtime::PerformGC))); |
| 774 } |
| 775 |
| 776 |
| 745 ExternalReference ExternalReference::fill_heap_number_with_random_function( | 777 ExternalReference ExternalReference::fill_heap_number_with_random_function( |
| 746 Isolate* isolate) { | 778 Isolate* isolate) { |
| 747 return ExternalReference(Redirect( | 779 return ExternalReference(Redirect( |
| 748 isolate, | 780 isolate, |
| 749 FUNCTION_ADDR(V8::FillHeapNumberWithRandom))); | 781 FUNCTION_ADDR(V8::FillHeapNumberWithRandom))); |
| 750 } | 782 } |
| 751 | 783 |
| 752 | 784 |
| 753 ExternalReference ExternalReference::delete_handle_scope_extensions( | 785 ExternalReference ExternalReference::delete_handle_scope_extensions( |
| 754 Isolate* isolate) { | 786 Isolate* isolate) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 } | 827 } |
| 796 | 828 |
| 797 | 829 |
| 798 ExternalReference ExternalReference::keyed_lookup_cache_field_offsets( | 830 ExternalReference ExternalReference::keyed_lookup_cache_field_offsets( |
| 799 Isolate* isolate) { | 831 Isolate* isolate) { |
| 800 return ExternalReference( | 832 return ExternalReference( |
| 801 isolate->keyed_lookup_cache()->field_offsets_address()); | 833 isolate->keyed_lookup_cache()->field_offsets_address()); |
| 802 } | 834 } |
| 803 | 835 |
| 804 | 836 |
| 805 ExternalReference ExternalReference::the_hole_value_location(Isolate* isolate) { | |
| 806 return ExternalReference(isolate->factory()->the_hole_value().location()); | |
| 807 } | |
| 808 | |
| 809 | |
| 810 ExternalReference ExternalReference::arguments_marker_location( | |
| 811 Isolate* isolate) { | |
| 812 return ExternalReference(isolate->factory()->arguments_marker().location()); | |
| 813 } | |
| 814 | |
| 815 | |
| 816 ExternalReference ExternalReference::roots_address(Isolate* isolate) { | 837 ExternalReference ExternalReference::roots_address(Isolate* isolate) { |
| 817 return ExternalReference(isolate->heap()->roots_address()); | 838 return ExternalReference(isolate->heap()->roots_address()); |
| 818 } | 839 } |
| 819 | 840 |
| 820 | 841 |
| 821 ExternalReference ExternalReference::address_of_stack_limit(Isolate* isolate) { | 842 ExternalReference ExternalReference::address_of_stack_limit(Isolate* isolate) { |
| 822 return ExternalReference(isolate->stack_guard()->address_of_jslimit()); | 843 return ExternalReference(isolate->stack_guard()->address_of_jslimit()); |
| 823 } | 844 } |
| 824 | 845 |
| 825 | 846 |
| 826 ExternalReference ExternalReference::address_of_real_stack_limit( | 847 ExternalReference ExternalReference::address_of_real_stack_limit( |
| 827 Isolate* isolate) { | 848 Isolate* isolate) { |
| 828 return ExternalReference(isolate->stack_guard()->address_of_real_jslimit()); | 849 return ExternalReference(isolate->stack_guard()->address_of_real_jslimit()); |
| 829 } | 850 } |
| 830 | 851 |
| 831 | 852 |
| 832 ExternalReference ExternalReference::address_of_regexp_stack_limit( | 853 ExternalReference ExternalReference::address_of_regexp_stack_limit( |
| 833 Isolate* isolate) { | 854 Isolate* isolate) { |
| 834 return ExternalReference(isolate->regexp_stack()->limit_address()); | 855 return ExternalReference(isolate->regexp_stack()->limit_address()); |
| 835 } | 856 } |
| 836 | 857 |
| 837 | 858 |
| 838 ExternalReference ExternalReference::new_space_start(Isolate* isolate) { | 859 ExternalReference ExternalReference::new_space_start(Isolate* isolate) { |
| 839 return ExternalReference(isolate->heap()->NewSpaceStart()); | 860 return ExternalReference(isolate->heap()->NewSpaceStart()); |
| 840 } | 861 } |
| 841 | 862 |
| 842 | 863 |
| 864 ExternalReference ExternalReference::store_buffer_top(Isolate* isolate) { |
| 865 return ExternalReference(isolate->heap()->store_buffer()->TopAddress()); |
| 866 } |
| 867 |
| 868 |
| 843 ExternalReference ExternalReference::new_space_mask(Isolate* isolate) { | 869 ExternalReference ExternalReference::new_space_mask(Isolate* isolate) { |
| 844 Address mask = reinterpret_cast<Address>(isolate->heap()->NewSpaceMask()); | 870 return ExternalReference(reinterpret_cast<Address>( |
| 845 return ExternalReference(mask); | 871 isolate->heap()->NewSpaceMask())); |
| 846 } | 872 } |
| 847 | 873 |
| 848 | 874 |
| 849 ExternalReference ExternalReference::new_space_allocation_top_address( | 875 ExternalReference ExternalReference::new_space_allocation_top_address( |
| 850 Isolate* isolate) { | 876 Isolate* isolate) { |
| 851 return ExternalReference(isolate->heap()->NewSpaceAllocationTopAddress()); | 877 return ExternalReference(isolate->heap()->NewSpaceAllocationTopAddress()); |
| 852 } | 878 } |
| 853 | 879 |
| 854 | 880 |
| 855 ExternalReference ExternalReference::heap_always_allocate_scope_depth( | 881 ExternalReference ExternalReference::heap_always_allocate_scope_depth( |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); | 1231 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); |
| 1206 state_.written_position = state_.current_position; | 1232 state_.written_position = state_.current_position; |
| 1207 written = true; | 1233 written = true; |
| 1208 } | 1234 } |
| 1209 | 1235 |
| 1210 // Return whether something was written. | 1236 // Return whether something was written. |
| 1211 return written; | 1237 return written; |
| 1212 } | 1238 } |
| 1213 | 1239 |
| 1214 } } // namespace v8::internal | 1240 } } // namespace v8::internal |
| OLD | NEW |