Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: src/assembler.cc

Issue 6529032: Merge 6168:6800 from bleeding_edge to experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/assembler.h ('k') | src/ast.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 #error "Unknown architecture." 60 #error "Unknown architecture."
61 #endif // Target architecture. 61 #endif // Target architecture.
62 #endif // V8_INTERPRETED_REGEXP 62 #endif // V8_INTERPRETED_REGEXP
63 63
64 namespace v8 { 64 namespace v8 {
65 namespace internal { 65 namespace internal {
66 66
67 67
68 const double DoubleConstant::min_int = kMinInt; 68 const double DoubleConstant::min_int = kMinInt;
69 const double DoubleConstant::one_half = 0.5; 69 const double DoubleConstant::one_half = 0.5;
70 const double DoubleConstant::minus_zero = -0.0;
70 const double DoubleConstant::negative_infinity = -V8_INFINITY; 71 const double DoubleConstant::negative_infinity = -V8_INFINITY;
71 72 const char* RelocInfo::kFillerCommentString = "DEOPTIMIZATION PADDING";
72 73
73 // ----------------------------------------------------------------------------- 74 // -----------------------------------------------------------------------------
74 // Implementation of Label 75 // Implementation of Label
75 76
76 int Label::pos() const { 77 int Label::pos() const {
77 if (pos_ < 0) return -pos_ - 1; 78 if (pos_ < 0) return -pos_ - 1;
78 if (pos_ > 0) return pos_ - 1; 79 if (pos_ > 0) return pos_ - 1;
79 UNREACHABLE(); 80 UNREACHABLE();
80 return 0; 81 return 0;
81 } 82 }
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 #endif // DEBUG 547 #endif // DEBUG
547 548
548 549
549 // ----------------------------------------------------------------------------- 550 // -----------------------------------------------------------------------------
550 // Implementation of ExternalReference 551 // Implementation of ExternalReference
551 552
552 ExternalReference::ExternalReference(Builtins::CFunctionId id) 553 ExternalReference::ExternalReference(Builtins::CFunctionId id)
553 : address_(Redirect(Builtins::c_function_address(id))) {} 554 : address_(Redirect(Builtins::c_function_address(id))) {}
554 555
555 556
556 ExternalReference::ExternalReference(ApiFunction* fun) 557 ExternalReference::ExternalReference(
557 : address_(Redirect(fun->address())) {} 558 ApiFunction* fun, Type type = ExternalReference::BUILTIN_CALL)
559 : address_(Redirect(fun->address(), type)) {}
558 560
559 561
560 ExternalReference::ExternalReference(Builtins::Name name) 562 ExternalReference::ExternalReference(Builtins::Name name)
561 : address_(Builtins::builtin_address(name)) {} 563 : address_(Builtins::builtin_address(name)) {}
562 564
563 565
564 ExternalReference::ExternalReference(Runtime::FunctionId id) 566 ExternalReference::ExternalReference(Runtime::FunctionId id)
565 : address_(Redirect(Runtime::FunctionForId(id)->entry)) {} 567 : address_(Redirect(Runtime::FunctionForId(id)->entry)) {}
566 568
567 569
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 ExternalReference ExternalReference::keyed_lookup_cache_field_offsets() { 643 ExternalReference ExternalReference::keyed_lookup_cache_field_offsets() {
642 return ExternalReference(KeyedLookupCache::field_offsets_address()); 644 return ExternalReference(KeyedLookupCache::field_offsets_address());
643 } 645 }
644 646
645 647
646 ExternalReference ExternalReference::the_hole_value_location() { 648 ExternalReference ExternalReference::the_hole_value_location() {
647 return ExternalReference(Factory::the_hole_value().location()); 649 return ExternalReference(Factory::the_hole_value().location());
648 } 650 }
649 651
650 652
653 ExternalReference ExternalReference::arguments_marker_location() {
654 return ExternalReference(Factory::arguments_marker().location());
655 }
656
657
651 ExternalReference ExternalReference::roots_address() { 658 ExternalReference ExternalReference::roots_address() {
652 return ExternalReference(Heap::roots_address()); 659 return ExternalReference(Heap::roots_address());
653 } 660 }
654 661
655 662
656 ExternalReference ExternalReference::address_of_stack_limit() { 663 ExternalReference ExternalReference::address_of_stack_limit() {
657 return ExternalReference(StackGuard::address_of_jslimit()); 664 return ExternalReference(StackGuard::address_of_jslimit());
658 } 665 }
659 666
660 667
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 const_cast<double*>(&DoubleConstant::min_int))); 730 const_cast<double*>(&DoubleConstant::min_int)));
724 } 731 }
725 732
726 733
727 ExternalReference ExternalReference::address_of_one_half() { 734 ExternalReference ExternalReference::address_of_one_half() {
728 return ExternalReference(reinterpret_cast<void*>( 735 return ExternalReference(reinterpret_cast<void*>(
729 const_cast<double*>(&DoubleConstant::one_half))); 736 const_cast<double*>(&DoubleConstant::one_half)));
730 } 737 }
731 738
732 739
740 ExternalReference ExternalReference::address_of_minus_zero() {
741 return ExternalReference(reinterpret_cast<void*>(
742 const_cast<double*>(&DoubleConstant::minus_zero)));
743 }
744
745
733 ExternalReference ExternalReference::address_of_negative_infinity() { 746 ExternalReference ExternalReference::address_of_negative_infinity() {
734 return ExternalReference(reinterpret_cast<void*>( 747 return ExternalReference(reinterpret_cast<void*>(
735 const_cast<double*>(&DoubleConstant::negative_infinity))); 748 const_cast<double*>(&DoubleConstant::negative_infinity)));
736 } 749 }
737 750
738 751
739 #ifndef V8_INTERPRETED_REGEXP 752 #ifndef V8_INTERPRETED_REGEXP
740 753
741 ExternalReference ExternalReference::re_check_stack_guard_state() { 754 ExternalReference ExternalReference::re_check_stack_guard_state() {
742 Address function; 755 Address function;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 return p; 838 return p;
826 } 839 }
827 840
828 841
829 double power_double_double(double x, double y) { 842 double power_double_double(double x, double y) {
830 int y_int = static_cast<int>(y); 843 int y_int = static_cast<int>(y);
831 if (y == y_int) { 844 if (y == y_int) {
832 return power_double_int(x, y_int); // Returns 1.0 for exponent 0. 845 return power_double_int(x, y_int); // Returns 1.0 for exponent 0.
833 } 846 }
834 if (!isinf(x)) { 847 if (!isinf(x)) {
835 if (y == 0.5) return sqrt(x); 848 if (y == 0.5) return sqrt(x + 0.0); // -0 must be converted to +0.
836 if (y == -0.5) return 1.0 / sqrt(x); 849 if (y == -0.5) return 1.0 / sqrt(x + 0.0);
837 } 850 }
838 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) { 851 if (isnan(y) || ((x == 1 || x == -1) && isinf(y))) {
839 return OS::nan_value(); 852 return OS::nan_value();
840 } 853 }
841 return pow(x, y); 854 return pow(x, y);
842 } 855 }
843 856
844 857
845 ExternalReference ExternalReference::power_double_double_function() { 858 ExternalReference ExternalReference::power_double_double_function() {
846 return ExternalReference(Redirect(FUNCTION_ADDR(power_double_double))); 859 return ExternalReference(Redirect(FUNCTION_ADDR(power_double_double)));
(...skipping 28 matching lines...) Expand all
875 case Token::DIV: 888 case Token::DIV:
876 function = &div_two_doubles; 889 function = &div_two_doubles;
877 break; 890 break;
878 case Token::MOD: 891 case Token::MOD:
879 function = &mod_two_doubles; 892 function = &mod_two_doubles;
880 break; 893 break;
881 default: 894 default:
882 UNREACHABLE(); 895 UNREACHABLE();
883 } 896 }
884 // Passing true as 2nd parameter indicates that they return an fp value. 897 // Passing true as 2nd parameter indicates that they return an fp value.
885 return ExternalReference(Redirect(FUNCTION_ADDR(function), true)); 898 return ExternalReference(Redirect(FUNCTION_ADDR(function), FP_RETURN_CALL));
886 } 899 }
887 900
888 901
889 ExternalReference ExternalReference::compare_doubles() { 902 ExternalReference ExternalReference::compare_doubles() {
890 return ExternalReference(Redirect(FUNCTION_ADDR(native_compare_doubles), 903 return ExternalReference(Redirect(FUNCTION_ADDR(native_compare_doubles),
891 false)); 904 BUILTIN_CALL));
892 } 905 }
893 906
894 907
895 ExternalReferenceRedirector* ExternalReference::redirector_ = NULL; 908 ExternalReference::ExternalReferenceRedirector*
909 ExternalReference::redirector_ = NULL;
896 910
897 911
898 #ifdef ENABLE_DEBUGGER_SUPPORT 912 #ifdef ENABLE_DEBUGGER_SUPPORT
899 ExternalReference ExternalReference::debug_break() { 913 ExternalReference ExternalReference::debug_break() {
900 return ExternalReference(Redirect(FUNCTION_ADDR(Debug::Break))); 914 return ExternalReference(Redirect(FUNCTION_ADDR(Debug::Break)));
901 } 915 }
902 916
903 917
904 ExternalReference ExternalReference::debug_step_in_fp_address() { 918 ExternalReference ExternalReference::debug_step_in_fp_address() {
905 return ExternalReference(Debug::step_in_fp_addr()); 919 return ExternalReference(Debug::step_in_fp_addr());
906 } 920 }
907 #endif 921 #endif
908 922
909 923
910 void PositionsRecorder::RecordPosition(int pos) { 924 void PositionsRecorder::RecordPosition(int pos) {
911 ASSERT(pos != RelocInfo::kNoPosition); 925 ASSERT(pos != RelocInfo::kNoPosition);
912 ASSERT(pos >= 0); 926 ASSERT(pos >= 0);
913 state_.current_position = pos; 927 state_.current_position = pos;
928 #ifdef ENABLE_GDB_JIT_INTERFACE
929 if (gdbjit_lineinfo_ != NULL) {
930 gdbjit_lineinfo_->SetPosition(assembler_->pc_offset(), pos, false);
931 }
932 #endif
914 } 933 }
915 934
916 935
917 void PositionsRecorder::RecordStatementPosition(int pos) { 936 void PositionsRecorder::RecordStatementPosition(int pos) {
918 ASSERT(pos != RelocInfo::kNoPosition); 937 ASSERT(pos != RelocInfo::kNoPosition);
919 ASSERT(pos >= 0); 938 ASSERT(pos >= 0);
920 state_.current_statement_position = pos; 939 state_.current_statement_position = pos;
940 #ifdef ENABLE_GDB_JIT_INTERFACE
941 if (gdbjit_lineinfo_ != NULL) {
942 gdbjit_lineinfo_->SetPosition(assembler_->pc_offset(), pos, true);
943 }
944 #endif
921 } 945 }
922 946
923 947
924 bool PositionsRecorder::WriteRecordedPositions() { 948 bool PositionsRecorder::WriteRecordedPositions() {
925 bool written = false; 949 bool written = false;
926 950
927 // Write the statement position if it is different from what was written last 951 // Write the statement position if it is different from what was written last
928 // time. 952 // time.
929 if (state_.current_statement_position != state_.written_statement_position) { 953 if (state_.current_statement_position != state_.written_statement_position) {
930 EnsureSpace ensure_space(assembler_); 954 EnsureSpace ensure_space(assembler_);
(...skipping 11 matching lines...) Expand all
942 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); 966 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position);
943 state_.written_position = state_.current_position; 967 state_.written_position = state_.current_position;
944 written = true; 968 written = true;
945 } 969 }
946 970
947 // Return whether something was written. 971 // Return whether something was written.
948 return written; 972 return written;
949 } 973 }
950 974
951 } } // namespace v8::internal 975 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/assembler.h ('k') | src/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698