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

Unified Diff: src/ppc/macro-assembler-ppc.h

Issue 901083004: Contribution of PowerPC port (continuation of 422063005) - PPC dir update (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Contribution of PowerPC port (continuation of 422063005) - PPC dir update -comments and rebase Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ppc/lithium-ppc.cc ('k') | src/ppc/macro-assembler-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/macro-assembler-ppc.h
diff --git a/src/ppc/macro-assembler-ppc.h b/src/ppc/macro-assembler-ppc.h
index 8f1aeab09fc6b683ef863b23b4bcf77733855c05..146489d1310021d837a6fe26ee7139fb250d7527 100644
--- a/src/ppc/macro-assembler-ppc.h
+++ b/src/ppc/macro-assembler-ppc.h
@@ -177,9 +177,6 @@ class MacroAssembler : public Assembler {
void CheckPageFlag(Register object, Register scratch, int mask, Condition cc,
Label* condition_met);
- void CheckMapDeprecated(Handle<Map> map, Register scratch,
- Label* if_deprecated);
-
// Check if object is in new space. Jumps if the object is not in new space.
// The register scratch can be object itself, but scratch will be clobbered.
void JumpIfNotInNewSpace(Register object, Register scratch, Label* branch) {
@@ -389,7 +386,8 @@ class MacroAssembler : public Assembler {
// Expect the number of values, pushed prior to the exit frame, to
// remove in a register (or no_reg, if there is nothing to remove).
void LeaveExitFrame(bool save_doubles, Register argument_count,
- bool restore_context);
+ bool restore_context,
+ bool argument_count_is_length = false);
// Get the actual activation frame alignment for target environment.
static int ActivationFrameAlignment();
@@ -433,26 +431,26 @@ class MacroAssembler : public Assembler {
void LoadDoubleLiteral(DoubleRegister result, double value, Register scratch);
void LoadWord(Register dst, const MemOperand& mem, Register scratch);
-
void LoadWordArith(Register dst, const MemOperand& mem,
Register scratch = no_reg);
-
void StoreWord(Register src, const MemOperand& mem, Register scratch);
void LoadHalfWord(Register dst, const MemOperand& mem, Register scratch);
-
+ void LoadHalfWordArith(Register dst, const MemOperand& mem,
+ Register scratch = no_reg);
void StoreHalfWord(Register src, const MemOperand& mem, Register scratch);
void LoadByte(Register dst, const MemOperand& mem, Register scratch);
-
void StoreByte(Register src, const MemOperand& mem, Register scratch);
void LoadRepresentation(Register dst, const MemOperand& mem, Representation r,
Register scratch = no_reg);
-
void StoreRepresentation(Register src, const MemOperand& mem,
Representation r, Register scratch = no_reg);
+ void LoadDouble(DoubleRegister dst, const MemOperand& mem, Register scratch);
+ void StoreDouble(DoubleRegister src, const MemOperand& mem, Register scratch);
+
// Move values between integer and floating point registers.
void MovIntToDouble(DoubleRegister dst, Register src, Register scratch);
void MovUnsignedIntToDouble(DoubleRegister dst, Register src,
@@ -762,12 +760,22 @@ class MacroAssembler : public Assembler {
Label* fail, SmiCheckType smi_check_type);
- // Check if the map of an object is equal to a specified map and branch to a
- // specified target if equal. Skip the smi check if not required (object is
- // known to be a heap object)
- void DispatchMap(Register obj, Register scratch, Handle<Map> map,
- Handle<Code> success, SmiCheckType smi_check_type);
+ // Check if the map of an object is equal to a specified weak map and branch
+ // to a specified target if equal. Skip the smi check if not required
+ // (object is known to be a heap object)
+ void DispatchWeakMap(Register obj, Register scratch1, Register scratch2,
+ Handle<WeakCell> cell, Handle<Code> success,
+ SmiCheckType smi_check_type);
+
+ // Compare the given value and the value of weak cell.
+ void CmpWeakValue(Register value, Handle<WeakCell> cell, Register scratch,
+ CRegister cr = cr7);
+ void GetWeakValue(Register value, Handle<WeakCell> cell);
+
+ // Load the value of the weak cell in the value register. Branch to the given
+ // miss label if the weak cell was cleared.
+ void LoadWeakValue(Register value, Handle<WeakCell> cell, Label* miss);
// Compare the object in a register to a value from the root list.
// Uses the ip register as scratch.
@@ -781,7 +789,7 @@ class MacroAssembler : public Assembler {
LoadP(type, FieldMemOperand(obj, HeapObject::kMapOffset));
lbz(type, FieldMemOperand(type, Map::kInstanceTypeOffset));
andi(r0, type, Operand(kIsNotStringMask));
- DCHECK_EQ(0, kStringTag);
+ DCHECK_EQ(0u, kStringTag);
return eq;
}
@@ -965,15 +973,6 @@ class MacroAssembler : public Assembler {
void MovFromFloatParameter(DoubleRegister dst);
void MovFromFloatResult(DoubleRegister dst);
- // Calls an API function. Allocates HandleScope, extracts returned value
- // from handle and propagates exceptions. Restores context. stack_space
- // - space to be unwound on exit (includes the call JS arguments space and
- // the additional space allocated for the fast call).
- void CallApiFunctionAndReturn(Register function_address,
- ExternalReference thunk_ref, int stack_space,
- MemOperand return_value_operand,
- MemOperand* context_restore_operand);
-
// Jump to a runtime routine.
void JumpToExternalReference(const ExternalReference& builtin);
@@ -1123,7 +1122,7 @@ class MacroAssembler : public Assembler {
// ---------------------------------------------------------------------------
// Smi utilities
- // Shift left by 1
+ // Shift left by kSmiShift
void SmiTag(Register reg, RCBit rc = LeaveRC) { SmiTag(reg, reg, rc); }
void SmiTag(Register dst, Register src, RCBit rc = LeaveRC) {
ShiftLeftImm(dst, src, Operand(kSmiShift), rc);
@@ -1137,6 +1136,7 @@ class MacroAssembler : public Assembler {
inline void JumpIfNotSmiCandidate(Register value, Register scratch,
Label* not_smi_label) {
// High bits must be identical to fit into an Smi
+ STATIC_ASSERT(kSmiShift == 1);
addis(scratch, value, Operand(0x40000000u >> 16));
cmpi(scratch, Operand::Zero());
blt(not_smi_label);
@@ -1235,16 +1235,15 @@ class MacroAssembler : public Assembler {
void UntagAndJumpIfNotSmi(Register dst, Register src, Label* non_smi_case);
inline void TestIfSmi(Register value, Register scratch) {
- TestBit(value, 0, scratch); // tst(value, Operand(kSmiTagMask));
+ TestBitRange(value, kSmiTagSize - 1, 0, scratch);
}
inline void TestIfPositiveSmi(Register value, Register scratch) {
- STATIC_ASSERT((kSmiTagMask | kSmiSignMask) ==
- (intptr_t)(1UL << (kBitsPerPointer - 1) | 1));
#if V8_TARGET_ARCH_PPC64
- rldicl(scratch, value, 1, kBitsPerPointer - 2, SetRC);
+ rldicl(scratch, value, 1, kBitsPerPointer - (1 + kSmiTagSize), SetRC);
#else
- rlwinm(scratch, value, 1, kBitsPerPointer - 2, kBitsPerPointer - 1, SetRC);
+ rlwinm(scratch, value, 1, kBitsPerPointer - (1 + kSmiTagSize),
+ kBitsPerPointer - 1, SetRC);
#endif
}
@@ -1269,12 +1268,11 @@ class MacroAssembler : public Assembler {
#if V8_TARGET_ARCH_PPC64
- inline void TestIfInt32(Register value, Register scratch1, Register scratch2,
+ inline void TestIfInt32(Register value, Register scratch,
CRegister cr = cr7) {
// High bits must be identical to fit into an 32-bit integer
- srawi(scratch1, value, 31);
- sradi(scratch2, value, 32);
- cmp(scratch1, scratch2, cr);
+ extsw(scratch, value);
+ cmp(scratch, value, cr);
}
#else
inline void TestIfInt32(Register hi_word, Register lo_word, Register scratch,
@@ -1285,6 +1283,18 @@ class MacroAssembler : public Assembler {
}
#endif
+#if V8_TARGET_ARCH_PPC64
+ // Ensure it is permissable to read/write int value directly from
+ // upper half of the smi.
+ STATIC_ASSERT(kSmiTag == 0);
+ STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32);
+#endif
+#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN
+#define SmiWordOffset(offset) (offset + kPointerSize / 2)
+#else
+#define SmiWordOffset(offset) offset
+#endif
+
// Abort execution if argument is not a string, enabled via --debug-code.
void AssertString(Register object);
@@ -1369,15 +1379,18 @@ class MacroAssembler : public Assembler {
void LoadInstanceDescriptors(Register map, Register descriptors);
void EnumLength(Register dst, Register map);
void NumberOfOwnDescriptors(Register dst, Register map);
+ void LoadAccessor(Register dst, Register holder, int accessor_index,
+ AccessorComponent accessor);
template <typename Field>
- void DecodeField(Register dst, Register src) {
- ExtractBitRange(dst, src, Field::kShift + Field::kSize - 1, Field::kShift);
+ void DecodeField(Register dst, Register src, RCBit rc = LeaveRC) {
+ ExtractBitRange(dst, src, Field::kShift + Field::kSize - 1, Field::kShift,
+ rc);
}
template <typename Field>
- void DecodeField(Register reg) {
- DecodeField<Field>(reg, reg);
+ void DecodeField(Register reg, RCBit rc = LeaveRC) {
+ DecodeField<Field>(reg, reg, rc);
}
template <typename Field>
« no previous file with comments | « src/ppc/lithium-ppc.cc ('k') | src/ppc/macro-assembler-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698