| Index: src/crankshaft/x87/lithium-codegen-x87.cc
|
| diff --git a/src/crankshaft/x87/lithium-codegen-x87.cc b/src/crankshaft/x87/lithium-codegen-x87.cc
|
| index 612f8e57cb6726d67a4868803299c4e8d8a7fd9b..c77cddb96058f3641abc22e7661226b68559c37a 100644
|
| --- a/src/crankshaft/x87/lithium-codegen-x87.cc
|
| +++ b/src/crankshaft/x87/lithium-codegen-x87.cc
|
| @@ -2170,7 +2170,7 @@ void LCodeGen::DoBranch(LBranch* instr) {
|
| if (expected.CanBeUndetectable()) {
|
| // Undetectable -> false.
|
| __ test_b(FieldOperand(map, Map::kBitFieldOffset),
|
| - 1 << Map::kIsUndetectable);
|
| + Immediate(1 << Map::kIsUndetectable));
|
| __ j(not_zero, instr->FalseLabel(chunk_));
|
| }
|
| }
|
| @@ -2412,7 +2412,7 @@ void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) {
|
| }
|
| __ mov(temp, FieldOperand(input, HeapObject::kMapOffset));
|
| __ test_b(FieldOperand(temp, Map::kBitFieldOffset),
|
| - 1 << Map::kIsUndetectable);
|
| + Immediate(1 << Map::kIsUndetectable));
|
| EmitBranch(instr, not_zero);
|
| }
|
|
|
| @@ -2603,7 +2603,7 @@ void LCodeGen::DoHasInPrototypeChainAndBranch(
|
|
|
| // Deoptimize if the object needs to be access checked.
|
| __ test_b(FieldOperand(object_map, Map::kBitFieldOffset),
|
| - 1 << Map::kIsAccessCheckNeeded);
|
| + Immediate(1 << Map::kIsAccessCheckNeeded));
|
| DeoptimizeIf(not_zero, instr, Deoptimizer::kAccessCheck);
|
| // Deoptimize for proxies.
|
| __ CmpInstanceType(object_map, JS_PROXY_TYPE);
|
| @@ -3129,6 +3129,7 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
| // object as a receiver to normal functions. Values have to be
|
| // passed unchanged to builtins and strict-mode functions.
|
| Label receiver_ok, global_object;
|
| + Label::Distance dist = DeoptEveryNTimes() ? Label::kFar : Label::kNear;
|
| Register scratch = ToRegister(instr->temp());
|
|
|
| if (!instr->hydrogen()->known_function()) {
|
| @@ -3137,20 +3138,20 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
| __ mov(scratch,
|
| FieldOperand(function, JSFunction::kSharedFunctionInfoOffset));
|
| __ test_b(FieldOperand(scratch, SharedFunctionInfo::kStrictModeByteOffset),
|
| - 1 << SharedFunctionInfo::kStrictModeBitWithinByte);
|
| - __ j(not_equal, &receiver_ok);
|
| + Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte));
|
| + __ j(not_equal, &receiver_ok, dist);
|
|
|
| // Do not transform the receiver to object for builtins.
|
| __ test_b(FieldOperand(scratch, SharedFunctionInfo::kNativeByteOffset),
|
| - 1 << SharedFunctionInfo::kNativeBitWithinByte);
|
| - __ j(not_equal, &receiver_ok);
|
| + Immediate(1 << SharedFunctionInfo::kNativeBitWithinByte));
|
| + __ j(not_equal, &receiver_ok, dist);
|
| }
|
|
|
| // Normal function. Replace undefined or null with global receiver.
|
| __ cmp(receiver, factory()->null_value());
|
| - __ j(equal, &global_object);
|
| + __ j(equal, &global_object, Label::kNear);
|
| __ cmp(receiver, factory()->undefined_value());
|
| - __ j(equal, &global_object);
|
| + __ j(equal, &global_object, Label::kNear);
|
|
|
| // The receiver should be a JS object.
|
| __ test(receiver, Immediate(kSmiTagMask));
|
| @@ -5061,7 +5062,7 @@ void LCodeGen::DoCheckArrayBufferNotNeutered(
|
|
|
| __ mov(scratch, FieldOperand(view, JSArrayBufferView::kBufferOffset));
|
| __ test_b(FieldOperand(scratch, JSArrayBuffer::kBitFieldOffset),
|
| - 1 << JSArrayBuffer::WasNeutered::kShift);
|
| + Immediate(1 << JSArrayBuffer::WasNeutered::kShift));
|
| DeoptimizeIf(not_zero, instr, Deoptimizer::kOutOfBounds);
|
| }
|
|
|
| @@ -5077,8 +5078,7 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
|
| InstanceType last;
|
| instr->hydrogen()->GetCheckInterval(&first, &last);
|
|
|
| - __ cmpb(FieldOperand(temp, Map::kInstanceTypeOffset),
|
| - static_cast<int8_t>(first));
|
| + __ cmpb(FieldOperand(temp, Map::kInstanceTypeOffset), Immediate(first));
|
|
|
| // If there is only one type in the interval check for equality.
|
| if (first == last) {
|
| @@ -5087,8 +5087,7 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
|
| DeoptimizeIf(below, instr, Deoptimizer::kWrongInstanceType);
|
| // Omit check for the last type.
|
| if (last != LAST_TYPE) {
|
| - __ cmpb(FieldOperand(temp, Map::kInstanceTypeOffset),
|
| - static_cast<int8_t>(last));
|
| + __ cmpb(FieldOperand(temp, Map::kInstanceTypeOffset), Immediate(last));
|
| DeoptimizeIf(above, instr, Deoptimizer::kWrongInstanceType);
|
| }
|
| }
|
| @@ -5099,7 +5098,7 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
|
|
|
| if (base::bits::IsPowerOfTwo32(mask)) {
|
| DCHECK(tag == 0 || base::bits::IsPowerOfTwo32(tag));
|
| - __ test_b(FieldOperand(temp, Map::kInstanceTypeOffset), mask);
|
| + __ test_b(FieldOperand(temp, Map::kInstanceTypeOffset), Immediate(mask));
|
| DeoptimizeIf(tag == 0 ? not_zero : zero, instr,
|
| Deoptimizer::kWrongInstanceType);
|
| } else {
|
| @@ -5535,7 +5534,7 @@ Condition LCodeGen::EmitTypeofIs(LTypeofIsAndBranch* instr, Register input) {
|
| // Check for undetectable objects => true.
|
| __ mov(input, FieldOperand(input, HeapObject::kMapOffset));
|
| __ test_b(FieldOperand(input, Map::kBitFieldOffset),
|
| - 1 << Map::kIsUndetectable);
|
| + Immediate(1 << Map::kIsUndetectable));
|
| final_branch_condition = not_zero;
|
|
|
| } else if (String::Equals(type_name, factory()->function_string())) {
|
| @@ -5556,7 +5555,7 @@ Condition LCodeGen::EmitTypeofIs(LTypeofIsAndBranch* instr, Register input) {
|
| __ j(below, false_label, false_distance);
|
| // Check for callable or undetectable objects => false.
|
| __ test_b(FieldOperand(input, Map::kBitFieldOffset),
|
| - (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable));
|
| + Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
|
| final_branch_condition = zero;
|
|
|
| // clang-format off
|
|
|