| Index: src/x64/lithium-x64.cc
|
| diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
|
| index 2cec68b097573eab83f941c03940b01647f2e3e9..9c6efed3d2f57ea37a8a1ed37aaeb5be97c8918c 100644
|
| --- a/src/x64/lithium-x64.cc
|
| +++ b/src/x64/lithium-x64.cc
|
| @@ -710,11 +710,6 @@ LInstruction* LChunkBuilder::DoEnvironmentMarker(HEnvironmentMarker* instr) {
|
| }
|
|
|
|
|
| -LInstruction* LChunkBuilder::DoSoftDeoptimize(HSoftDeoptimize* instr) {
|
| - return AssignEnvironment(new(zone()) LDeoptimize);
|
| -}
|
| -
|
| -
|
| LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) {
|
| return AssignEnvironment(new(zone()) LDeoptimize);
|
| }
|
| @@ -722,9 +717,9 @@ LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) {
|
|
|
| LInstruction* LChunkBuilder::DoShift(Token::Value op,
|
| HBitwiseBinaryOperation* instr) {
|
| - if (instr->representation().IsSmiOrTagged()) {
|
| - ASSERT(instr->left()->representation().IsSmiOrTagged());
|
| - ASSERT(instr->right()->representation().IsSmiOrTagged());
|
| + if (instr->representation().IsTagged()) {
|
| + ASSERT(instr->left()->representation().IsTagged());
|
| + ASSERT(instr->right()->representation().IsTagged());
|
|
|
| LOperand* left = UseFixed(instr->left(), rdx);
|
| LOperand* right = UseFixed(instr->right(), rax);
|
| @@ -732,9 +727,9 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
|
| return MarkAsCall(DefineFixed(result, rax), instr);
|
| }
|
|
|
| - ASSERT(instr->representation().IsInteger32());
|
| - ASSERT(instr->left()->representation().IsInteger32());
|
| - ASSERT(instr->right()->representation().IsInteger32());
|
| + ASSERT(instr->representation().IsSmiOrInteger32());
|
| + ASSERT(instr->left()->representation().Equals(instr->representation()));
|
| + ASSERT(instr->right()->representation().Equals(instr->representation()));
|
| LOperand* left = UseRegisterAtStart(instr->left());
|
|
|
| HValue* right_value = instr->right();
|
| @@ -792,8 +787,8 @@ LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op,
|
| op == Token::SUB);
|
| HValue* left = instr->left();
|
| HValue* right = instr->right();
|
| - ASSERT(left->representation().IsSmiOrTagged());
|
| - ASSERT(right->representation().IsSmiOrTagged());
|
| + ASSERT(left->representation().IsTagged());
|
| + ASSERT(right->representation().IsTagged());
|
| LOperand* left_operand = UseFixed(left, rdx);
|
| LOperand* right_operand = UseFixed(right, rax);
|
| LArithmeticT* result =
|
| @@ -1324,17 +1319,17 @@ LInstruction* LChunkBuilder::DoShl(HShl* instr) {
|
|
|
|
|
| LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) {
|
| - if (instr->representation().IsInteger32()) {
|
| - ASSERT(instr->left()->representation().IsInteger32());
|
| - ASSERT(instr->right()->representation().IsInteger32());
|
| + if (instr->representation().IsSmiOrInteger32()) {
|
| + ASSERT(instr->left()->representation().Equals(instr->representation()));
|
| + ASSERT(instr->right()->representation().Equals(instr->representation()));
|
|
|
| LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand());
|
| LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand());
|
| return DefineSameAsFirst(new(zone()) LBitI(left, right));
|
| } else {
|
| - ASSERT(instr->representation().IsSmiOrTagged());
|
| - ASSERT(instr->left()->representation().IsSmiOrTagged());
|
| - ASSERT(instr->right()->representation().IsSmiOrTagged());
|
| + ASSERT(instr->representation().IsTagged());
|
| + ASSERT(instr->left()->representation().IsTagged());
|
| + ASSERT(instr->right()->representation().IsTagged());
|
|
|
| LOperand* left = UseFixed(instr->left(), rdx);
|
| LOperand* right = UseFixed(instr->right(), rax);
|
| @@ -1357,7 +1352,9 @@ LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) {
|
| LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
|
| if (instr->representation().IsDouble()) {
|
| return DoArithmeticD(Token::DIV, instr);
|
| - } else if (instr->representation().IsInteger32()) {
|
| + } else if (instr->representation().IsSmiOrInteger32()) {
|
| + ASSERT(instr->left()->representation().Equals(instr->representation()));
|
| + ASSERT(instr->right()->representation().Equals(instr->representation()));
|
| if (instr->HasPowerOf2Divisor()) {
|
| ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
|
| LOperand* value = UseRegisterAtStart(instr->left());
|
| @@ -1373,7 +1370,7 @@ LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
|
| LDivI* result = new(zone()) LDivI(dividend, divisor, temp);
|
| return AssignEnvironment(DefineFixed(result, rax));
|
| } else {
|
| - ASSERT(instr->representation().IsSmiOrTagged());
|
| + ASSERT(instr->representation().IsTagged());
|
| return DoArithmeticT(Token::DIV, instr);
|
| }
|
| }
|
| @@ -1437,9 +1434,9 @@ LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) {
|
| LInstruction* LChunkBuilder::DoMod(HMod* instr) {
|
| HValue* left = instr->left();
|
| HValue* right = instr->right();
|
| - if (instr->representation().IsInteger32()) {
|
| - ASSERT(left->representation().IsInteger32());
|
| - ASSERT(right->representation().IsInteger32());
|
| + if (instr->representation().IsSmiOrInteger32()) {
|
| + ASSERT(left->representation().Equals(instr->representation()));
|
| + ASSERT(right->representation().Equals(instr->representation()));
|
| if (instr->HasPowerOf2Divisor()) {
|
| ASSERT(!right->CanBeZero());
|
| LModI* mod = new(zone()) LModI(UseRegisterAtStart(left),
|
| @@ -1472,7 +1469,7 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) {
|
| ? AssignEnvironment(result)
|
| : result;
|
| }
|
| - } else if (instr->representation().IsSmiOrTagged()) {
|
| + } else if (instr->representation().IsTagged()) {
|
| return DoArithmeticT(Token::MOD, instr);
|
| } else {
|
| ASSERT(instr->representation().IsDouble());
|
| @@ -1488,9 +1485,9 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) {
|
|
|
|
|
| LInstruction* LChunkBuilder::DoMul(HMul* instr) {
|
| - if (instr->representation().IsInteger32()) {
|
| - ASSERT(instr->left()->representation().IsInteger32());
|
| - ASSERT(instr->right()->representation().IsInteger32());
|
| + if (instr->representation().IsSmiOrInteger32()) {
|
| + ASSERT(instr->left()->representation().Equals(instr->representation()));
|
| + ASSERT(instr->right()->representation().Equals(instr->representation()));
|
| LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand());
|
| LOperand* right = UseOrConstant(instr->BetterRightOperand());
|
| LMulI* mul = new(zone()) LMulI(left, right);
|
| @@ -1502,16 +1499,16 @@ LInstruction* LChunkBuilder::DoMul(HMul* instr) {
|
| } else if (instr->representation().IsDouble()) {
|
| return DoArithmeticD(Token::MUL, instr);
|
| } else {
|
| - ASSERT(instr->representation().IsSmiOrTagged());
|
| + ASSERT(instr->representation().IsTagged());
|
| return DoArithmeticT(Token::MUL, instr);
|
| }
|
| }
|
|
|
|
|
| LInstruction* LChunkBuilder::DoSub(HSub* instr) {
|
| - if (instr->representation().IsInteger32()) {
|
| - ASSERT(instr->left()->representation().IsInteger32());
|
| - ASSERT(instr->right()->representation().IsInteger32());
|
| + if (instr->representation().IsSmiOrInteger32()) {
|
| + ASSERT(instr->left()->representation().Equals(instr->representation()));
|
| + ASSERT(instr->right()->representation().Equals(instr->representation()));
|
| LOperand* left = UseRegisterAtStart(instr->left());
|
| LOperand* right = UseOrConstantAtStart(instr->right());
|
| LSubI* sub = new(zone()) LSubI(left, right);
|
| @@ -1523,21 +1520,21 @@ LInstruction* LChunkBuilder::DoSub(HSub* instr) {
|
| } else if (instr->representation().IsDouble()) {
|
| return DoArithmeticD(Token::SUB, instr);
|
| } else {
|
| - ASSERT(instr->representation().IsSmiOrTagged());
|
| + ASSERT(instr->representation().IsTagged());
|
| return DoArithmeticT(Token::SUB, instr);
|
| }
|
| }
|
|
|
|
|
| LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
|
| - if (instr->representation().IsInteger32()) {
|
| + if (instr->representation().IsSmiOrInteger32()) {
|
| // Check to see if it would be advantageous to use an lea instruction rather
|
| // than an add. This is the case when no overflow check is needed and there
|
| // are multiple uses of the add's inputs, so using a 3-register add will
|
| // preserve all input values for later uses.
|
| bool use_lea = LAddI::UseLea(instr);
|
| - ASSERT(instr->left()->representation().IsInteger32());
|
| - ASSERT(instr->right()->representation().IsInteger32());
|
| + ASSERT(instr->left()->representation().Equals(instr->representation()));
|
| + ASSERT(instr->right()->representation().Equals(instr->representation()));
|
| LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand());
|
| HValue* right_candidate = instr->BetterRightOperand();
|
| LOperand* right = use_lea
|
| @@ -1555,7 +1552,7 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
|
| } else if (instr->representation().IsDouble()) {
|
| return DoArithmeticD(Token::ADD, instr);
|
| } else {
|
| - ASSERT(instr->representation().IsSmiOrTagged());
|
| + ASSERT(instr->representation().IsTagged());
|
| return DoArithmeticT(Token::ADD, instr);
|
| }
|
| return NULL;
|
| @@ -1565,9 +1562,9 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
|
| LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) {
|
| LOperand* left = NULL;
|
| LOperand* right = NULL;
|
| - if (instr->representation().IsInteger32()) {
|
| - ASSERT(instr->left()->representation().IsInteger32());
|
| - ASSERT(instr->right()->representation().IsInteger32());
|
| + if (instr->representation().IsSmiOrInteger32()) {
|
| + ASSERT(instr->left()->representation().Equals(instr->representation()));
|
| + ASSERT(instr->right()->representation().Equals(instr->representation()));
|
| left = UseRegisterAtStart(instr->BetterLeftOperand());
|
| right = UseOrConstantAtStart(instr->BetterRightOperand());
|
| } else {
|
| @@ -1652,13 +1649,6 @@ LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch(
|
| }
|
|
|
|
|
| -LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch(
|
| - HCompareConstantEqAndBranch* instr) {
|
| - LOperand* value = UseRegisterAtStart(instr->value());
|
| - return new(zone()) LCmpConstantEqAndBranch(value);
|
| -}
|
| -
|
| -
|
| LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) {
|
| ASSERT(instr->value()->representation().IsTagged());
|
| return new(zone()) LIsObjectAndBranch(UseRegisterAtStart(instr->value()));
|
| @@ -1949,8 +1939,10 @@ LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) {
|
|
|
|
|
| LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) {
|
| - LUnallocated* temp = TempRegister();
|
| + LUnallocated* temp = NULL;
|
| + if (!instr->CanOmitPrototypeChecks()) temp = TempRegister();
|
| LCheckPrototypeMaps* result = new(zone()) LCheckPrototypeMaps(temp);
|
| + if (instr->CanOmitPrototypeChecks()) return result;
|
| return AssignEnvironment(result);
|
| }
|
|
|
| @@ -1962,8 +1954,10 @@ LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) {
|
|
|
|
|
| LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) {
|
| - LOperand* value = UseRegisterAtStart(instr->value());
|
| + LOperand* value = NULL;
|
| + if (!instr->CanOmitMapChecks()) value = UseRegisterAtStart(instr->value());
|
| LCheckMaps* result = new(zone()) LCheckMaps(value);
|
| + if (instr->CanOmitMapChecks()) return result;
|
| return AssignEnvironment(result);
|
| }
|
|
|
| @@ -2124,13 +2118,9 @@ LInstruction* LChunkBuilder::DoLoadExternalArrayPointer(
|
|
|
|
|
| LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) {
|
| - ASSERT(instr->key()->representation().IsInteger32() ||
|
| - instr->key()->representation().IsSmi());
|
| + ASSERT(instr->key()->representation().IsInteger32());
|
| ElementsKind elements_kind = instr->elements_kind();
|
| - bool clobbers_key = instr->key()->representation().IsSmi();
|
| - LOperand* key = clobbers_key
|
| - ? UseTempRegister(instr->key())
|
| - : UseRegisterOrConstantAtStart(instr->key());
|
| + LOperand* key = UseRegisterOrConstantAtStart(instr->key());
|
| LLoadKeyed* result = NULL;
|
|
|
| if (!instr->is_external()) {
|
| @@ -2168,7 +2158,6 @@ LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
|
|
|
| LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
|
| ElementsKind elements_kind = instr->elements_kind();
|
| - bool clobbers_key = instr->key()->representation().IsSmi();
|
|
|
| if (!instr->is_external()) {
|
| ASSERT(instr->elements()->representation().IsTagged());
|
| @@ -2180,8 +2169,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
|
| if (instr->value()->representation().IsDouble()) {
|
| object = UseRegisterAtStart(instr->elements());
|
| val = UseTempRegister(instr->value());
|
| - key = clobbers_key ? UseTempRegister(instr->key())
|
| - : UseRegisterOrConstantAtStart(instr->key());
|
| + key = UseRegisterOrConstantAtStart(instr->key());
|
| } else {
|
| ASSERT(instr->value()->representation().IsSmiOrTagged());
|
| object = UseTempRegister(instr->elements());
|
| @@ -2190,12 +2178,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
|
| key = UseTempRegister(instr->key());
|
| } else {
|
| val = UseRegisterOrConstantAtStart(instr->value());
|
| -
|
| - if (clobbers_key) {
|
| - key = UseTempRegister(instr->key());
|
| - } else {
|
| - key = UseRegisterOrConstantAtStart(instr->key());
|
| - }
|
| + key = UseRegisterOrConstantAtStart(instr->key());
|
| }
|
| }
|
|
|
| @@ -2215,8 +2198,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
|
| elements_kind == EXTERNAL_FLOAT_ELEMENTS;
|
| LOperand* val = val_is_temp_register ? UseTempRegister(instr->value())
|
| : UseRegister(instr->value());
|
| - LOperand* key = clobbers_key ? UseTempRegister(instr->key())
|
| - : UseRegisterOrConstantAtStart(instr->key());
|
| + LOperand* key = UseRegisterOrConstantAtStart(instr->key());
|
| LOperand* external_pointer = UseRegister(instr->elements());
|
| return new(zone()) LStoreKeyed(external_pointer, key, val);
|
| }
|
| @@ -2247,19 +2229,10 @@ LInstruction* LChunkBuilder::DoTransitionElementsKind(
|
| LTransitionElementsKind* result =
|
| new(zone()) LTransitionElementsKind(object, new_map_reg, temp_reg);
|
| return result;
|
| - } else if (FLAG_compiled_transitions) {
|
| + } else {
|
| LTransitionElementsKind* result =
|
| new(zone()) LTransitionElementsKind(object, NULL, NULL);
|
| return AssignPointerMap(result);
|
| - } else {
|
| - LOperand* object = UseFixed(instr->object(), rax);
|
| - LOperand* fixed_object_reg = FixedTemp(rdx);
|
| - LOperand* new_map_reg = FixedTemp(rbx);
|
| - LTransitionElementsKind* result =
|
| - new(zone()) LTransitionElementsKind(object,
|
| - new_map_reg,
|
| - fixed_object_reg);
|
| - return MarkAsCall(result, instr);
|
| }
|
| }
|
|
|
|
|