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

Unified Diff: src/sh4/code-stubs-sh4.h

Issue 11275184: First draft of the sh4 port Base URL: http://github.com/v8/v8.git@master
Patch Set: Use GYP and fixe some typos Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/sh4/checks-sh4.h ('k') | src/sh4/code-stubs-sh4.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sh4/code-stubs-sh4.h
diff --git a/src/arm/code-stubs-arm.h b/src/sh4/code-stubs-sh4.h
similarity index 90%
copy from src/arm/code-stubs-arm.h
copy to src/sh4/code-stubs-sh4.h
index 3e796249c8435f97f7a14f0454f5c2e8835446ed..374a2e8dd1a8ea239194c003dcb2596fdeb3f8be 100644
--- a/src/arm/code-stubs-arm.h
+++ b/src/sh4/code-stubs-sh4.h
@@ -1,4 +1,4 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
+// Copyright 2011-2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_ARM_CODE_STUBS_ARM_H_
-#define V8_ARM_CODE_STUBS_ARM_H_
+#ifndef V8_SH4_CODE_STUBS_SH4_H_
+#define V8_SH4_CODE_STUBS_SH4_H_
#include "ic-inl.h"
@@ -149,7 +149,7 @@ class BinaryOpStub: public CodeStub {
mode_(mode),
operands_type_(BinaryOpIC::UNINITIALIZED),
result_type_(BinaryOpIC::UNINITIALIZED) {
- use_vfp2_ = CpuFeatures::IsSupported(VFP2);
+ use_fpu_ = CpuFeatures::IsSupported(FPU);
ASSERT(OpBits::is_valid(Token::NUM_TOKENS));
}
@@ -159,7 +159,7 @@ class BinaryOpStub: public CodeStub {
BinaryOpIC::TypeInfo result_type = BinaryOpIC::UNINITIALIZED)
: op_(OpBits::decode(key)),
mode_(ModeBits::decode(key)),
- use_vfp2_(VFP2Bits::decode(key)),
+ use_fpu_(FPUBits::decode(key)),
operands_type_(operands_type),
result_type_(result_type) { }
@@ -171,7 +171,7 @@ class BinaryOpStub: public CodeStub {
Token::Value op_;
OverwriteMode mode_;
- bool use_vfp2_;
+ bool use_fpu_;
// Operand type information determined at runtime.
BinaryOpIC::TypeInfo operands_type_;
@@ -182,7 +182,7 @@ class BinaryOpStub: public CodeStub {
// Minor key encoding in 16 bits RRRTTTVOOOOOOOMM.
class ModeBits: public BitField<OverwriteMode, 0, 2> {};
class OpBits: public BitField<Token::Value, 2, 7> {};
- class VFP2Bits: public BitField<bool, 9, 1> {};
+ class FPUBits: public BitField<bool, 9, 1> {};
class OperandTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 10, 3> {};
class ResultTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 13, 3> {};
@@ -190,7 +190,7 @@ class BinaryOpStub: public CodeStub {
int MinorKey() {
return OpBits::encode(op_)
| ModeBits::encode(mode_)
- | VFP2Bits::encode(use_vfp2_)
+ | FPUBits::encode(use_fpu_)
| OperandTypeInfoBits::encode(operands_type_)
| ResultTypeInfoBits::encode(result_type_);
}
@@ -294,14 +294,17 @@ class StringHelper : public AllStatic {
// Generate string hash.
static void GenerateHashInit(MacroAssembler* masm,
Register hash,
- Register character);
+ Register character,
+ Register scratch);
static void GenerateHashAddCharacter(MacroAssembler* masm,
Register hash,
- Register character);
+ Register character,
+ Register scratch);
static void GenerateHashGetHash(MacroAssembler* masm,
- Register hash);
+ Register hash,
+ Register scratch);
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper);
@@ -485,57 +488,20 @@ class RecordWriteStub: public CodeStub {
virtual bool SometimesSetsUpAFrame() { return false; }
static void PatchBranchIntoNop(MacroAssembler* masm, int pos) {
- masm->instr_at_put(pos, (masm->instr_at(pos) & ~B27) | (B24 | B20));
- ASSERT(Assembler::IsTstImmediate(masm->instr_at(pos)));
+ UNIMPLEMENTED();
}
static void PatchNopIntoBranch(MacroAssembler* masm, int pos) {
- masm->instr_at_put(pos, (masm->instr_at(pos) & ~(B24 | B20)) | B27);
- ASSERT(Assembler::IsBranch(masm->instr_at(pos)));
+ UNIMPLEMENTED();
}
static Mode GetMode(Code* stub) {
- Instr first_instruction = Assembler::instr_at(stub->instruction_start());
- Instr second_instruction = Assembler::instr_at(stub->instruction_start() +
- Assembler::kInstrSize);
-
- if (Assembler::IsBranch(first_instruction)) {
- return INCREMENTAL;
- }
-
- ASSERT(Assembler::IsTstImmediate(first_instruction));
-
- if (Assembler::IsBranch(second_instruction)) {
- return INCREMENTAL_COMPACTION;
- }
-
- ASSERT(Assembler::IsTstImmediate(second_instruction));
-
+ // TODO(STM): UNIMPLEMENTED
return STORE_BUFFER_ONLY;
}
static void Patch(Code* stub, Mode mode) {
- MacroAssembler masm(NULL,
- stub->instruction_start(),
- stub->instruction_size());
- switch (mode) {
- case STORE_BUFFER_ONLY:
- ASSERT(GetMode(stub) == INCREMENTAL ||
- GetMode(stub) == INCREMENTAL_COMPACTION);
- PatchBranchIntoNop(&masm, 0);
- PatchBranchIntoNop(&masm, Assembler::kInstrSize);
- break;
- case INCREMENTAL:
- ASSERT(GetMode(stub) == STORE_BUFFER_ONLY);
- PatchNopIntoBranch(&masm, 0);
- break;
- case INCREMENTAL_COMPACTION:
- ASSERT(GetMode(stub) == STORE_BUFFER_ONLY);
- PatchNopIntoBranch(&masm, Assembler::kInstrSize);
- break;
- }
- ASSERT(GetMode(stub) == mode);
- CPU::FlushICache(stub->instruction_start(), 2 * Assembler::kInstrSize);
+ UNIMPLEMENTED();
}
private:
@@ -569,34 +535,18 @@ class RecordWriteStub: public CodeStub {
// saved registers that were not already preserved. The scratch registers
// will be restored by other means so we don't bother pushing them here.
void SaveCallerSaveRegisters(MacroAssembler* masm, SaveFPRegsMode mode) {
- masm->stm(db_w, sp, (kCallerSaved | lr.bit()) & ~scratch1_.bit());
+ masm->pushm((kJSCallerSaved | pr.bit()) & ~scratch1_.bit());
if (mode == kSaveFPRegs) {
- CpuFeatures::Scope scope(VFP2);
- masm->sub(sp,
- sp,
- Operand(kDoubleSize * (DwVfpRegister::kNumRegisters - 1)));
- // Save all VFP registers except d0.
- for (int i = DwVfpRegister::kNumRegisters - 1; i > 0; i--) {
- DwVfpRegister reg = DwVfpRegister::from_code(i);
- masm->vstr(reg, MemOperand(sp, (i - 1) * kDoubleSize));
- }
+ UNIMPLEMENTED();
}
}
inline void RestoreCallerSaveRegisters(MacroAssembler*masm,
SaveFPRegsMode mode) {
if (mode == kSaveFPRegs) {
- CpuFeatures::Scope scope(VFP2);
- // Restore all VFP registers except d0.
- for (int i = DwVfpRegister::kNumRegisters - 1; i > 0; i--) {
- DwVfpRegister reg = DwVfpRegister::from_code(i);
- masm->vldr(reg, MemOperand(sp, (i - 1) * kDoubleSize));
- }
- masm->add(sp,
- sp,
- Operand(kDoubleSize * (DwVfpRegister::kNumRegisters - 1)));
+ UNIMPLEMENTED();
}
- masm->ldm(ia_w, sp, (kCallerSaved | lr.bit()) & ~scratch1_.bit());
+ masm->popm((kJSCallerSaved | pr.bit()) & ~scratch1_.bit());
}
inline Register object() { return object_; }
@@ -693,14 +643,16 @@ class RegExpCEntryStub: public CodeStub {
// moved by GC
class DirectCEntryStub: public CodeStub {
public:
- DirectCEntryStub() {}
+ explicit DirectCEntryStub(Register scratch) : scratch_(scratch) {}
void Generate(MacroAssembler* masm);
- void GenerateCall(MacroAssembler* masm, ExternalReference function);
- void GenerateCall(MacroAssembler* masm, Register target);
+ void GenerateCall(MacroAssembler* masm, ExternalReference function,
+ Register scratch1, Register scratch2);
+ void GenerateCall(MacroAssembler* masm, Register target, Register scratch1);
private:
Major MajorKey() { return DirectCEntry; }
int MinorKey() { return 0; }
+ Register scratch_;
bool NeedsImmovableCode() { return true; }
};
@@ -773,7 +725,6 @@ class FloatingPointHelper : public AllStatic {
Register object,
Destination destination,
DwVfpRegister double_dst,
- DwVfpRegister double_scratch,
Register dst1,
Register dst2,
Register heap_number_map,
@@ -795,8 +746,7 @@ class FloatingPointHelper : public AllStatic {
Register scratch1,
Register scratch2,
Register scratch3,
- DwVfpRegister double_scratch0,
- DwVfpRegister double_scratch1,
+ DwVfpRegister double_scratch,
Label* not_int32);
// Generate non VFP3 code to check if a double can be exactly represented by a
@@ -902,4 +852,4 @@ class StringDictionaryLookupStub: public CodeStub {
} } // namespace v8::internal
-#endif // V8_ARM_CODE_STUBS_ARM_H_
+#endif // V8_SH4_CODE_STUBS_SH4_H_
« no previous file with comments | « src/sh4/checks-sh4.h ('k') | src/sh4/code-stubs-sh4.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698