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

Side by Side Diff: src/code-stubs.h

Issue 817143002: Contribution of PowerPC port (continuation of 422063005) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Contribution of PowerPC port - rebase and address initial set of comments Created 5 years, 11 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
« no previous file with comments | « src/base/platform/platform-posix.cc ('k') | src/codegen.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_CODE_STUBS_H_ 5 #ifndef V8_CODE_STUBS_H_
6 #define V8_CODE_STUBS_H_ 6 #define V8_CODE_STUBS_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/assembler.h" 9 #include "src/assembler.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 #if V8_TARGET_ARCH_ARM64 104 #if V8_TARGET_ARCH_ARM64
105 #define CODE_STUB_LIST_ARM64(V) \ 105 #define CODE_STUB_LIST_ARM64(V) \
106 V(DirectCEntry) \ 106 V(DirectCEntry) \
107 V(RestoreRegistersState) \ 107 V(RestoreRegistersState) \
108 V(StoreRegistersState) 108 V(StoreRegistersState)
109 109
110 #else 110 #else
111 #define CODE_STUB_LIST_ARM64(V) 111 #define CODE_STUB_LIST_ARM64(V)
112 #endif 112 #endif
113 113
114 // List of code stubs only used on PPC platforms.
115 #ifdef V8_TARGET_ARCH_PPC
116 #define CODE_STUB_LIST_PPC(V) \
117 V(DirectCEntry) \
118 V(StoreRegistersState) \
119 V(RestoreRegistersState)
120 #else
121 #define CODE_STUB_LIST_PPC(V)
122 #endif
123
114 // List of code stubs only used on MIPS platforms. 124 // List of code stubs only used on MIPS platforms.
115 #if V8_TARGET_ARCH_MIPS 125 #if V8_TARGET_ARCH_MIPS
116 #define CODE_STUB_LIST_MIPS(V) \ 126 #define CODE_STUB_LIST_MIPS(V) \
117 V(DirectCEntry) \ 127 V(DirectCEntry) \
118 V(RestoreRegistersState) \ 128 V(RestoreRegistersState) \
119 V(StoreRegistersState) 129 V(StoreRegistersState)
120 #elif V8_TARGET_ARCH_MIPS64 130 #elif V8_TARGET_ARCH_MIPS64
121 #define CODE_STUB_LIST_MIPS(V) \ 131 #define CODE_STUB_LIST_MIPS(V) \
122 V(DirectCEntry) \ 132 V(DirectCEntry) \
123 V(RestoreRegistersState) \ 133 V(RestoreRegistersState) \
124 V(StoreRegistersState) 134 V(StoreRegistersState)
125 #else 135 #else
126 #define CODE_STUB_LIST_MIPS(V) 136 #define CODE_STUB_LIST_MIPS(V)
127 #endif 137 #endif
128 138
129 // Combined list of code stubs. 139 // Combined list of code stubs.
130 #define CODE_STUB_LIST(V) \ 140 #define CODE_STUB_LIST(V) \
131 CODE_STUB_LIST_ALL_PLATFORMS(V) \ 141 CODE_STUB_LIST_ALL_PLATFORMS(V) \
132 CODE_STUB_LIST_ARM(V) \ 142 CODE_STUB_LIST_ARM(V) \
133 CODE_STUB_LIST_ARM64(V) \ 143 CODE_STUB_LIST_ARM64(V) \
144 CODE_STUB_LIST_PPC(V) \
134 CODE_STUB_LIST_MIPS(V) 145 CODE_STUB_LIST_MIPS(V)
135 146
136 // Stub is base classes of all stubs. 147 // Stub is base classes of all stubs.
137 class CodeStub BASE_EMBEDDED { 148 class CodeStub BASE_EMBEDDED {
138 public: 149 public:
139 enum Major { 150 enum Major {
140 // TODO(mvstanton): eliminate the NoCache key by getting rid 151 // TODO(mvstanton): eliminate the NoCache key by getting rid
141 // of the non-monomorphic-cache. 152 // of the non-monomorphic-cache.
142 NoCache = 0, // marker for stubs that do custom caching] 153 NoCache = 0, // marker for stubs that do custom caching]
143 #define DEF_ENUM(name) name, 154 #define DEF_ENUM(name) name,
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } } // namespace v8::internal 508 } } // namespace v8::internal
498 509
499 #if V8_TARGET_ARCH_IA32 510 #if V8_TARGET_ARCH_IA32
500 #include "src/ia32/code-stubs-ia32.h" 511 #include "src/ia32/code-stubs-ia32.h"
501 #elif V8_TARGET_ARCH_X64 512 #elif V8_TARGET_ARCH_X64
502 #include "src/x64/code-stubs-x64.h" 513 #include "src/x64/code-stubs-x64.h"
503 #elif V8_TARGET_ARCH_ARM64 514 #elif V8_TARGET_ARCH_ARM64
504 #include "src/arm64/code-stubs-arm64.h" 515 #include "src/arm64/code-stubs-arm64.h"
505 #elif V8_TARGET_ARCH_ARM 516 #elif V8_TARGET_ARCH_ARM
506 #include "src/arm/code-stubs-arm.h" 517 #include "src/arm/code-stubs-arm.h"
518 #elif V8_TARGET_ARCH_PPC
519 #include "src/ppc/code-stubs-ppc.h"
507 #elif V8_TARGET_ARCH_MIPS 520 #elif V8_TARGET_ARCH_MIPS
508 #include "src/mips/code-stubs-mips.h" 521 #include "src/mips/code-stubs-mips.h"
509 #elif V8_TARGET_ARCH_MIPS64 522 #elif V8_TARGET_ARCH_MIPS64
510 #include "src/mips64/code-stubs-mips64.h" 523 #include "src/mips64/code-stubs-mips64.h"
511 #elif V8_TARGET_ARCH_X87 524 #elif V8_TARGET_ARCH_X87
512 #include "src/x87/code-stubs-x87.h" 525 #include "src/x87/code-stubs-x87.h"
513 #else 526 #else
514 #error Unsupported target architecture. 527 #error Unsupported target architecture.
515 #endif 528 #endif
516 529
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 std::ostream& operator<<(std::ostream& os, const CompareNilICStub::State& s); 1466 std::ostream& operator<<(std::ostream& os, const CompareNilICStub::State& s);
1454 1467
1455 1468
1456 class CEntryStub : public PlatformCodeStub { 1469 class CEntryStub : public PlatformCodeStub {
1457 public: 1470 public:
1458 CEntryStub(Isolate* isolate, int result_size, 1471 CEntryStub(Isolate* isolate, int result_size,
1459 SaveFPRegsMode save_doubles = kDontSaveFPRegs) 1472 SaveFPRegsMode save_doubles = kDontSaveFPRegs)
1460 : PlatformCodeStub(isolate) { 1473 : PlatformCodeStub(isolate) {
1461 minor_key_ = SaveDoublesBits::encode(save_doubles == kSaveFPRegs); 1474 minor_key_ = SaveDoublesBits::encode(save_doubles == kSaveFPRegs);
1462 DCHECK(result_size == 1 || result_size == 2); 1475 DCHECK(result_size == 1 || result_size == 2);
1463 #ifdef _WIN64 1476 #if _WIN64 || (V8_TARGET_ARCH_PPC64 && !ABI_RETURNS_OBJECT_PAIRS_IN_REGS)
1464 minor_key_ = ResultSizeBits::update(minor_key_, result_size); 1477 minor_key_ = ResultSizeBits::update(minor_key_, result_size);
1465 #endif // _WIN64 1478 #endif // _WIN64
1466 } 1479 }
1467 1480
1468 // The version of this stub that doesn't save doubles is generated ahead of 1481 // The version of this stub that doesn't save doubles is generated ahead of
1469 // time, so it's OK to call it from other stubs that can't cope with GC during 1482 // time, so it's OK to call it from other stubs that can't cope with GC during
1470 // their code generation. On machines that always have gp registers (x64) we 1483 // their code generation. On machines that always have gp registers (x64) we
1471 // can generate both variants ahead of time. 1484 // can generate both variants ahead of time.
1472 static void GenerateAheadOfTime(Isolate* isolate); 1485 static void GenerateAheadOfTime(Isolate* isolate);
1473 1486
1474 private: 1487 private:
1475 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } 1488 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); }
1476 #ifdef _WIN64 1489 #if _WIN64 || (V8_TARGET_ARCH_PPC64 && !ABI_RETURNS_OBJECT_PAIRS_IN_REGS)
1477 int result_size() const { return ResultSizeBits::decode(minor_key_); } 1490 int result_size() const { return ResultSizeBits::decode(minor_key_); }
1478 #endif // _WIN64 1491 #endif // _WIN64
1479 1492
1480 bool NeedsImmovableCode() OVERRIDE; 1493 bool NeedsImmovableCode() OVERRIDE;
1481 1494
1482 class SaveDoublesBits : public BitField<bool, 0, 1> {}; 1495 class SaveDoublesBits : public BitField<bool, 0, 1> {};
1483 class ResultSizeBits : public BitField<int, 1, 3> {}; 1496 class ResultSizeBits : public BitField<int, 1, 3> {};
1484 1497
1485 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); 1498 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR();
1486 DEFINE_PLATFORM_CODE_STUB(CEntry, PlatformCodeStub); 1499 DEFINE_PLATFORM_CODE_STUB(CEntry, PlatformCodeStub);
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
2577 2590
2578 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR 2591 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR
2579 #undef DEFINE_PLATFORM_CODE_STUB 2592 #undef DEFINE_PLATFORM_CODE_STUB
2580 #undef DEFINE_HANDLER_CODE_STUB 2593 #undef DEFINE_HANDLER_CODE_STUB
2581 #undef DEFINE_HYDROGEN_CODE_STUB 2594 #undef DEFINE_HYDROGEN_CODE_STUB
2582 #undef DEFINE_CODE_STUB 2595 #undef DEFINE_CODE_STUB
2583 #undef DEFINE_CODE_STUB_BASE 2596 #undef DEFINE_CODE_STUB_BASE
2584 } } // namespace v8::internal 2597 } } // namespace v8::internal
2585 2598
2586 #endif // V8_CODE_STUBS_H_ 2599 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/base/platform/platform-posix.cc ('k') | src/codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698