X87: Refactor HType to get rid of various hacks.

port r21578 (dcf13aa)

Original commit message:
- Move HType to it's own file.
- Add HType::HeapObject and some other useful types.
- Get rid of the broken and useless HType::NonPrimitive.
- Introduce HType::FromType() to convert from HeapType to HType.
- Also add unit tests for HType.
- Fix types in Crankshaft.

BUG=

Review URL: https://codereview.chromium.org/307903002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21579 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e9357a5e
......@@ -2533,7 +2533,7 @@ void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) {
Register temp = ToRegister(instr->temp());
SmiCheck check_needed =
instr->hydrogen()->value()->IsHeapObject()
instr->hydrogen()->value()->type().IsHeapObject()
? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
Condition true_cond = EmitIsString(
......@@ -2555,7 +2555,7 @@ void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) {
Register input = ToRegister(instr->value());
Register temp = ToRegister(instr->temp());
if (!instr->hydrogen()->value()->IsHeapObject()) {
if (!instr->hydrogen()->value()->type().IsHeapObject()) {
STATIC_ASSERT(kSmiTag == 0);
__ JumpIfSmi(input, instr->FalseLabel(chunk_));
}
......@@ -2623,7 +2623,7 @@ void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
Register input = ToRegister(instr->value());
Register temp = ToRegister(instr->temp());
if (!instr->hydrogen()->value()->IsHeapObject()) {
if (!instr->hydrogen()->value()->type().IsHeapObject()) {
__ JumpIfSmi(input, instr->FalseLabel(chunk_));
}
......@@ -3029,7 +3029,7 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
__ mov(target, value);
if (instr->hydrogen()->NeedsWriteBarrier()) {
SmiCheck check_needed =
instr->hydrogen()->value()->IsHeapObject()
instr->hydrogen()->value()->type().IsHeapObject()
? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
Register temp = ToRegister(instr->temp());
int offset = Context::SlotOffset(instr->slot_index());
......@@ -4147,7 +4147,7 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) {
Register value = ToRegister(instr->value());
ASSERT(!instr->key()->IsConstantOperand());
SmiCheck check_needed =
instr->hydrogen()->value()->IsHeapObject()
instr->hydrogen()->value()->type().IsHeapObject()
? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
// Compute address of modified element and store it into key register.
__ lea(key, operand);
......@@ -4828,7 +4828,7 @@ void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
if (!instr->hydrogen()->value()->IsHeapObject()) {
if (!instr->hydrogen()->value()->type().IsHeapObject()) {
LOperand* input = instr->value();
__ test(ToOperand(input), Immediate(kSmiTagMask));
DeoptimizeIf(zero, instr->environment());
......
......@@ -1958,7 +1958,9 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) {
LOperand* value = UseAtStart(instr->value());
LInstruction* result = new(zone()) LCheckNonSmi(value);
if (!instr->value()->IsHeapObject()) result = AssignEnvironment(result);
if (!instr->value()->type().IsHeapObject()) {
result = AssignEnvironment(result);
}
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment