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

Side by Side Diff: src/mips/assembler-mips.cc

Issue 7860035: Merge bleeding edge up to 9192 into the GC branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 3 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/mips/assembler-mips.h ('k') | src/mips/builtins-mips.cc » ('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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 namespace v8 { 43 namespace v8 {
44 namespace internal { 44 namespace internal {
45 45
46 #ifdef DEBUG 46 #ifdef DEBUG
47 bool CpuFeatures::initialized_ = false; 47 bool CpuFeatures::initialized_ = false;
48 #endif 48 #endif
49 unsigned CpuFeatures::supported_ = 0; 49 unsigned CpuFeatures::supported_ = 0;
50 unsigned CpuFeatures::found_by_runtime_probing_ = 0; 50 unsigned CpuFeatures::found_by_runtime_probing_ = 0;
51 51
52
53 // Get the CPU features enabled by the build. For cross compilation the
54 // preprocessor symbols CAN_USE_FPU_INSTRUCTIONS
55 // can be defined to enable FPU instructions when building the
56 // snapshot.
57 static uint64_t CpuFeaturesImpliedByCompiler() {
58 uint64_t answer = 0;
59 #ifdef CAN_USE_FPU_INSTRUCTIONS
60 answer |= 1u << FPU;
61 #endif // def CAN_USE_FPU_INSTRUCTIONS
62
63 #ifdef __mips__
64 // If the compiler is allowed to use FPU then we can use FPU too in our code
65 // generation even when generating snapshots. This won't work for cross
66 // compilation.
67 #if(defined(__mips_hard_float) && __mips_hard_float != 0)
68 answer |= 1u << FPU;
69 #endif // defined(__mips_hard_float) && __mips_hard_float != 0
70 #endif // def __mips__
71
72 return answer;
73 }
74
75
52 void CpuFeatures::Probe() { 76 void CpuFeatures::Probe() {
53 ASSERT(!initialized_); 77 ASSERT(!initialized_);
54 #ifdef DEBUG 78 #ifdef DEBUG
55 initialized_ = true; 79 initialized_ = true;
56 #endif 80 #endif
81
82 // Get the features implied by the OS and the compiler settings. This is the
83 // minimal set of features which is also allowed for generated code in the
84 // snapshot.
85 supported_ |= OS::CpuFeaturesImpliedByPlatform();
86 supported_ |= CpuFeaturesImpliedByCompiler();
87
88 if (Serializer::enabled()) {
89 // No probing for features if we might serialize (generate snapshot).
90 return;
91 }
92
57 // If the compiler is allowed to use fpu then we can use fpu too in our 93 // If the compiler is allowed to use fpu then we can use fpu too in our
58 // code generation. 94 // code generation.
59 #if !defined(__mips__) 95 #if !defined(__mips__)
60 // For the simulator=mips build, use FPU when FLAG_enable_fpu is enabled. 96 // For the simulator=mips build, use FPU when FLAG_enable_fpu is enabled.
61 if (FLAG_enable_fpu) { 97 if (FLAG_enable_fpu) {
62 supported_ |= 1u << FPU; 98 supported_ |= 1u << FPU;
63 } 99 }
64 #else 100 #else
65 if (Serializer::enabled()) { 101 // Probe for additional features not already known to be available.
66 supported_ |= OS::CpuFeaturesImpliedByPlatform();
67 return; // No features if we might serialize.
68 }
69
70 if (OS::MipsCpuHasFeature(FPU)) { 102 if (OS::MipsCpuHasFeature(FPU)) {
71 // This implementation also sets the FPU flags if 103 // This implementation also sets the FPU flags if
72 // runtime detection of FPU returns true. 104 // runtime detection of FPU returns true.
73 supported_ |= 1u << FPU; 105 supported_ |= 1u << FPU;
74 found_by_runtime_probing_ |= 1u << FPU; 106 found_by_runtime_probing_ |= 1u << FPU;
75 } 107 }
76 #endif 108 #endif
77 } 109 }
78 110
79 111
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 805
774 void Assembler::bind(Label* L) { 806 void Assembler::bind(Label* L) {
775 ASSERT(!L->is_bound()); // Label can only be bound once. 807 ASSERT(!L->is_bound()); // Label can only be bound once.
776 bind_to(L, pc_offset()); 808 bind_to(L, pc_offset());
777 } 809 }
778 810
779 811
780 void Assembler::next(Label* L) { 812 void Assembler::next(Label* L) {
781 ASSERT(L->is_linked()); 813 ASSERT(L->is_linked());
782 int link = target_at(L->pos()); 814 int link = target_at(L->pos());
783 ASSERT(link > 0 || link == kEndOfChain);
784 if (link == kEndOfChain) { 815 if (link == kEndOfChain) {
785 L->Unuse(); 816 L->Unuse();
786 } else if (link > 0) { 817 } else {
818 ASSERT(link >= 0);
787 L->link_to(link); 819 L->link_to(link);
788 } 820 }
789 } 821 }
790 822
791 bool Assembler::is_near(Label* L) { 823 bool Assembler::is_near(Label* L) {
792 if (L->is_bound()) { 824 if (L->is_bound()) {
793 return ((pc_offset() - L->pos()) < kMaxBranchOffset - 4 * kInstrSize); 825 return ((pc_offset() - L->pos()) < kMaxBranchOffset - 4 * kInstrSize);
794 } 826 }
795 return false; 827 return false;
796 } 828 }
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 *p = LUI | rt_code | ((itarget & kHiMask) >> kLuiShift); 2091 *p = LUI | rt_code | ((itarget & kHiMask) >> kLuiShift);
2060 *(p+1) = ORI | rt_code | (rt_code << 5) | (itarget & kImm16Mask); 2092 *(p+1) = ORI | rt_code | (rt_code << 5) | (itarget & kImm16Mask);
2061 2093
2062 CPU::FlushICache(pc, 2 * sizeof(int32_t)); 2094 CPU::FlushICache(pc, 2 * sizeof(int32_t));
2063 } 2095 }
2064 2096
2065 2097
2066 } } // namespace v8::internal 2098 } } // namespace v8::internal
2067 2099
2068 #endif // V8_TARGET_ARCH_MIPS 2100 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/assembler-mips.h ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698