| Index: src/ia32/lithium-codegen-ia32.cc
|
| diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
|
| index 7b50de78d6f63fbc8e605a28f3fb0b0c69f2c11e..5f03146d5d88852fd73498b07b8a43b5810b1088 100644
|
| --- a/src/ia32/lithium-codegen-ia32.cc
|
| +++ b/src/ia32/lithium-codegen-ia32.cc
|
| @@ -103,7 +103,7 @@ void LCodeGen::FinishCode(Handle<Code> code) {
|
| ASSERT(is_done());
|
| code->set_stack_slots(GetStackSlotCount());
|
| code->set_safepoint_table_offset(safepoints_.GetCodeOffset());
|
| - RegisterDependentCodeForEmbeddedMaps(code);
|
| + if (code->is_optimized_code()) RegisterWeakObjectsInOptimizedCode(code);
|
| PopulateDeoptimizationData(code);
|
| if (!info()->IsStub()) {
|
| Deoptimizer::EnsureRelocSpaceForLazyDeoptimization(code);
|
| @@ -292,17 +292,18 @@ bool LCodeGen::GeneratePrologue() {
|
| if (heap_slots > 0) {
|
| Comment(";;; Allocate local context");
|
| // Argument to NewContext is the function, which is still in edi.
|
| - __ push(edi);
|
| if (heap_slots <= FastNewContextStub::kMaximumSlots) {
|
| FastNewContextStub stub(heap_slots);
|
| __ CallStub(&stub);
|
| } else {
|
| + __ push(edi);
|
| __ CallRuntime(Runtime::kNewFunctionContext, 1);
|
| }
|
| RecordSafepoint(Safepoint::kNoLazyDeopt);
|
| - // Context is returned in both eax and esi. It replaces the context
|
| - // passed to us. It's saved in the stack and kept live in esi.
|
| - __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi);
|
| + // Context is returned in eax. It replaces the context passed to us.
|
| + // It's saved in the stack and kept live in esi.
|
| + __ mov(esi, eax);
|
| + __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax);
|
|
|
| // Copy parameters into context if necessary.
|
| int num_parameters = scope()->num_parameters();
|
| @@ -475,7 +476,8 @@ bool LCodeGen::GenerateDeferredCode() {
|
|
|
| HValue* value =
|
| instructions_->at(code->instruction_index())->hydrogen_value();
|
| - RecordAndWritePosition(value->position());
|
| + RecordAndWritePosition(
|
| + chunk()->graph()->SourcePositionToScriptPosition(value->position()));
|
|
|
| Comment(";;; <@%d,#%d> "
|
| "-------------------- Deferred %s --------------------",
|
| @@ -1177,6 +1179,14 @@ void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) {
|
| translations_.CreateByteArray(isolate()->factory());
|
| data->SetTranslationByteArray(*translations);
|
| data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_));
|
| + data->SetOptimizationId(Smi::FromInt(info_->optimization_id()));
|
| + if (info_->IsOptimizing()) {
|
| + // Reference to shared function info does not change between phases.
|
| + AllowDeferredHandleDereference allow_handle_dereference;
|
| + data->SetSharedFunctionInfo(*info_->shared_info());
|
| + } else {
|
| + data->SetSharedFunctionInfo(Smi::FromInt(0));
|
| + }
|
|
|
| Handle<FixedArray> literals =
|
| factory()->NewFixedArray(deoptimization_literals_.length(), TENURED);
|
| @@ -1336,11 +1346,6 @@ void LCodeGen::DoCallStub(LCallStub* instr) {
|
| ASSERT(ToRegister(instr->context()).is(esi));
|
| ASSERT(ToRegister(instr->result()).is(eax));
|
| switch (instr->hydrogen()->major_key()) {
|
| - case CodeStub::RegExpConstructResult: {
|
| - RegExpConstructResultStub stub;
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| - break;
|
| - }
|
| case CodeStub::RegExpExec: {
|
| RegExpExecStub stub;
|
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| @@ -1371,7 +1376,7 @@ void LCodeGen::DoModI(LModI* instr) {
|
| HMod* hmod = instr->hydrogen();
|
| HValue* left = hmod->left();
|
| HValue* right = hmod->right();
|
| - if (hmod->HasPowerOf2Divisor()) {
|
| + if (hmod->RightIsPowerOf2()) {
|
| // TODO(svenpanne) We should really do the strength reduction on the
|
| // Hydrogen level.
|
| Register left_reg = ToRegister(instr->left());
|
| @@ -1453,56 +1458,41 @@ void LCodeGen::DoModI(LModI* instr) {
|
|
|
|
|
| void LCodeGen::DoDivI(LDivI* instr) {
|
| - if (!instr->is_flooring() && instr->hydrogen()->HasPowerOf2Divisor()) {
|
| + if (!instr->is_flooring() && instr->hydrogen()->RightIsPowerOf2()) {
|
| Register dividend = ToRegister(instr->left());
|
| - int32_t divisor = instr->hydrogen()->right()->GetInteger32Constant();
|
| - int32_t test_value = 0;
|
| - int32_t power = 0;
|
| + HDiv* hdiv = instr->hydrogen();
|
| + int32_t divisor = hdiv->right()->GetInteger32Constant();
|
| + Register result = ToRegister(instr->result());
|
| + ASSERT(!result.is(dividend));
|
|
|
| - if (divisor > 0) {
|
| - test_value = divisor - 1;
|
| - power = WhichPowerOf2(divisor);
|
| - } else {
|
| - // Check for (0 / -x) that will produce negative zero.
|
| - if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
| - __ test(dividend, Operand(dividend));
|
| - DeoptimizeIf(zero, instr->environment());
|
| - }
|
| - // Check for (kMinInt / -1).
|
| - if (divisor == -1 && instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
|
| - __ cmp(dividend, kMinInt);
|
| - DeoptimizeIf(zero, instr->environment());
|
| - }
|
| - test_value = - divisor - 1;
|
| - power = WhichPowerOf2(-divisor);
|
| + // Check for (0 / -x) that will produce negative zero.
|
| + if (hdiv->left()->RangeCanInclude(0) && divisor < 0 &&
|
| + hdiv->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
| + __ test(dividend, Operand(dividend));
|
| + DeoptimizeIf(zero, instr->environment());
|
| }
|
| -
|
| - if (test_value != 0) {
|
| - if (instr->hydrogen()->CheckFlag(
|
| - HInstruction::kAllUsesTruncatingToInt32)) {
|
| - Label done, negative;
|
| - __ cmp(dividend, 0);
|
| - __ j(less, &negative, Label::kNear);
|
| - __ sar(dividend, power);
|
| - if (divisor < 0) __ neg(dividend);
|
| - __ jmp(&done, Label::kNear);
|
| -
|
| - __ bind(&negative);
|
| - __ neg(dividend);
|
| - __ sar(dividend, power);
|
| - if (divisor > 0) __ neg(dividend);
|
| - __ bind(&done);
|
| - return; // Don't fall through to "__ neg" below.
|
| - } else {
|
| - // Deoptimize if remainder is not 0.
|
| - __ test(dividend, Immediate(test_value));
|
| + // Check for (kMinInt / -1).
|
| + if (hdiv->left()->RangeCanInclude(kMinInt) && divisor == -1 &&
|
| + hdiv->CheckFlag(HValue::kCanOverflow)) {
|
| + __ cmp(dividend, kMinInt);
|
| + DeoptimizeIf(zero, instr->environment());
|
| + }
|
| + // Deoptimize if remainder will not be 0.
|
| + if (!hdiv->CheckFlag(HInstruction::kAllUsesTruncatingToInt32) &&
|
| + Abs(divisor) != 1) {
|
| + __ test(dividend, Immediate(Abs(divisor) - 1));
|
| DeoptimizeIf(not_zero, instr->environment());
|
| - __ sar(dividend, power);
|
| - }
|
| }
|
| -
|
| - if (divisor < 0) __ neg(dividend);
|
| -
|
| + __ Move(result, dividend);
|
| + int32_t shift = WhichPowerOf2(Abs(divisor));
|
| + if (shift > 0) {
|
| + // The arithmetic shift is always OK, the 'if' is an optimization only.
|
| + if (shift > 1) __ sar(result, 31);
|
| + __ shr(result, 32 - shift);
|
| + __ add(result, dividend);
|
| + __ sar(result, shift);
|
| + }
|
| + if (divisor < 0) __ neg(result);
|
| return;
|
| }
|
|
|
| @@ -1972,43 +1962,6 @@ void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoElementsKind(LElementsKind* instr) {
|
| - Register result = ToRegister(instr->result());
|
| - Register input = ToRegister(instr->value());
|
| -
|
| - // Load map into |result|.
|
| - __ mov(result, FieldOperand(input, HeapObject::kMapOffset));
|
| - // Load the map's "bit field 2" into |result|. We only need the first byte,
|
| - // but the following masking takes care of that anyway.
|
| - __ mov(result, FieldOperand(result, Map::kBitField2Offset));
|
| - // Retrieve elements_kind from bit field 2.
|
| - __ and_(result, Map::kElementsKindMask);
|
| - __ shr(result, Map::kElementsKindShift);
|
| -}
|
| -
|
| -
|
| -void LCodeGen::DoValueOf(LValueOf* instr) {
|
| - Register input = ToRegister(instr->value());
|
| - Register result = ToRegister(instr->result());
|
| - Register map = ToRegister(instr->temp());
|
| - ASSERT(input.is(result));
|
| -
|
| - Label done;
|
| -
|
| - if (!instr->hydrogen()->value()->IsHeapObject()) {
|
| - // If the object is a smi return the object.
|
| - __ JumpIfSmi(input, &done, Label::kNear);
|
| - }
|
| -
|
| - // If the object is not a value type, return the object.
|
| - __ CmpObjectType(input, JS_VALUE_TYPE, map);
|
| - __ j(not_equal, &done, Label::kNear);
|
| - __ mov(result, FieldOperand(input, JSValue::kValueOffset));
|
| -
|
| - __ bind(&done);
|
| -}
|
| -
|
| -
|
| void LCodeGen::DoDateField(LDateField* instr) {
|
| Register object = ToRegister(instr->date());
|
| Register result = ToRegister(instr->result());
|
| @@ -2130,18 +2083,6 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoThrow(LThrow* instr) {
|
| - __ push(ToOperand(instr->value()));
|
| - ASSERT(ToRegister(instr->context()).is(esi));
|
| - CallRuntime(Runtime::kThrow, 1, instr);
|
| -
|
| - if (FLAG_debug_code) {
|
| - Comment("Unreachable code.");
|
| - __ int3();
|
| - }
|
| -}
|
| -
|
| -
|
| void LCodeGen::DoAddI(LAddI* instr) {
|
| LOperand* left = instr->left();
|
| LOperand* right = instr->right();
|
| @@ -3266,8 +3207,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
|
| }
|
|
|
| Register object = ToRegister(instr->object());
|
| - if (FLAG_track_double_fields &&
|
| - instr->hydrogen()->representation().IsDouble()) {
|
| + if (instr->hydrogen()->representation().IsDouble()) {
|
| if (CpuFeatures::IsSupported(SSE2)) {
|
| CpuFeatureScope scope(masm(), SSE2);
|
| XMMRegister result = ToDoubleRegister(instr->result());
|
| @@ -3364,15 +3304,6 @@ void LCodeGen::DoLoadRoot(LLoadRoot* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoLoadExternalArrayPointer(
|
| - LLoadExternalArrayPointer* instr) {
|
| - Register result = ToRegister(instr->result());
|
| - Register input = ToRegister(instr->object());
|
| - __ mov(result, FieldOperand(input,
|
| - ExternalArray::kExternalPointerOffset));
|
| -}
|
| -
|
| -
|
| void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
|
| Register arguments = ToRegister(instr->arguments());
|
| Register result = ToRegister(instr->result());
|
| @@ -3408,7 +3339,7 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
|
| elements_kind,
|
| 0,
|
| instr->additional_index()));
|
| - if (elements_kind == EXTERNAL_FLOAT_ELEMENTS ||
|
| + if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
|
| elements_kind == FLOAT32_ELEMENTS) {
|
| if (CpuFeatures::IsSupported(SSE2)) {
|
| CpuFeatureScope scope(masm(), SSE2);
|
| @@ -3418,7 +3349,7 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
|
| } else {
|
| X87Mov(ToX87Register(instr->result()), operand, kX87FloatOperand);
|
| }
|
| - } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS ||
|
| + } else if (elements_kind == EXTERNAL_FLOAT64_ELEMENTS ||
|
| elements_kind == FLOAT64_ELEMENTS) {
|
| if (CpuFeatures::IsSupported(SSE2)) {
|
| CpuFeatureScope scope(masm(), SSE2);
|
| @@ -3429,29 +3360,29 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
|
| } else {
|
| Register result(ToRegister(instr->result()));
|
| switch (elements_kind) {
|
| - case EXTERNAL_BYTE_ELEMENTS:
|
| + case EXTERNAL_INT8_ELEMENTS:
|
| case INT8_ELEMENTS:
|
| __ movsx_b(result, operand);
|
| break;
|
| - case EXTERNAL_PIXEL_ELEMENTS:
|
| - case EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
|
| + case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
|
| + case EXTERNAL_UINT8_ELEMENTS:
|
| case UINT8_ELEMENTS:
|
| case UINT8_CLAMPED_ELEMENTS:
|
| __ movzx_b(result, operand);
|
| break;
|
| - case EXTERNAL_SHORT_ELEMENTS:
|
| + case EXTERNAL_INT16_ELEMENTS:
|
| case INT16_ELEMENTS:
|
| __ movsx_w(result, operand);
|
| break;
|
| - case EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
|
| + case EXTERNAL_UINT16_ELEMENTS:
|
| case UINT16_ELEMENTS:
|
| __ movzx_w(result, operand);
|
| break;
|
| - case EXTERNAL_INT_ELEMENTS:
|
| + case EXTERNAL_INT32_ELEMENTS:
|
| case INT32_ELEMENTS:
|
| __ mov(result, operand);
|
| break;
|
| - case EXTERNAL_UNSIGNED_INT_ELEMENTS:
|
| + case EXTERNAL_UINT32_ELEMENTS:
|
| case UINT32_ELEMENTS:
|
| __ mov(result, operand);
|
| if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) {
|
| @@ -3459,8 +3390,8 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
|
| DeoptimizeIf(negative, instr->environment());
|
| }
|
| break;
|
| - case EXTERNAL_FLOAT_ELEMENTS:
|
| - case EXTERNAL_DOUBLE_ELEMENTS:
|
| + case EXTERNAL_FLOAT32_ELEMENTS:
|
| + case EXTERNAL_FLOAT64_ELEMENTS:
|
| case FLOAT32_ELEMENTS:
|
| case FLOAT64_ELEMENTS:
|
| case FAST_SMI_ELEMENTS:
|
| @@ -3644,26 +3575,28 @@ void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) {
|
| void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
| Register receiver = ToRegister(instr->receiver());
|
| Register function = ToRegister(instr->function());
|
| - Register scratch = ToRegister(instr->temp());
|
|
|
| // If the receiver is null or undefined, we have to pass the global
|
| // 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());
|
|
|
| - // Do not transform the receiver to object for strict mode
|
| - // functions.
|
| - __ mov(scratch,
|
| - FieldOperand(function, JSFunction::kSharedFunctionInfoOffset));
|
| - __ test_b(FieldOperand(scratch, SharedFunctionInfo::kStrictModeByteOffset),
|
| - 1 << SharedFunctionInfo::kStrictModeBitWithinByte);
|
| - __ j(not_equal, &receiver_ok, dist);
|
| + if (!instr->hydrogen()->known_function()) {
|
| + // Do not transform the receiver to object for strict mode
|
| + // functions.
|
| + __ mov(scratch,
|
| + FieldOperand(function, JSFunction::kSharedFunctionInfoOffset));
|
| + __ test_b(FieldOperand(scratch, SharedFunctionInfo::kStrictModeByteOffset),
|
| + 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, dist);
|
| + // Do not transform the receiver to object for builtins.
|
| + __ test_b(FieldOperand(scratch, SharedFunctionInfo::kNativeByteOffset),
|
| + 1 << SharedFunctionInfo::kNativeBitWithinByte);
|
| + __ j(not_equal, &receiver_ok, dist);
|
| + }
|
|
|
| // Normal function. Replace undefined or null with global receiver.
|
| __ cmp(receiver, factory()->null_value());
|
| @@ -3676,14 +3609,14 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
| DeoptimizeIf(equal, instr->environment());
|
| __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, scratch);
|
| DeoptimizeIf(below, instr->environment());
|
| - __ jmp(&receiver_ok, Label::kNear);
|
|
|
| + __ jmp(&receiver_ok, Label::kNear);
|
| __ bind(&global_object);
|
| __ mov(receiver, FieldOperand(function, JSFunction::kContextOffset));
|
| - __ mov(receiver,
|
| - Operand(receiver, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
|
| - __ mov(receiver, FieldOperand(receiver, GlobalObject::kGlobalReceiverOffset));
|
| -
|
| + const int global_offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX);
|
| + __ mov(receiver, Operand(receiver, global_offset));
|
| + const int receiver_offset = GlobalObject::kGlobalReceiverOffset;
|
| + __ mov(receiver, FieldOperand(receiver, receiver_offset));
|
| __ bind(&receiver_ok);
|
| }
|
|
|
| @@ -3761,14 +3694,6 @@ void LCodeGen::DoContext(LContext* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoOuterContext(LOuterContext* instr) {
|
| - Register context = ToRegister(instr->context());
|
| - Register result = ToRegister(instr->result());
|
| - __ mov(result,
|
| - Operand(context, Context::SlotOffset(Context::PREVIOUS_INDEX)));
|
| -}
|
| -
|
| -
|
| void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
|
| ASSERT(ToRegister(instr->context()).is(esi));
|
| __ push(esi); // The context is the first argument.
|
| @@ -3778,21 +3703,6 @@ void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
|
| - Register context = ToRegister(instr->context());
|
| - Register result = ToRegister(instr->result());
|
| - __ mov(result,
|
| - Operand(context, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
|
| -}
|
| -
|
| -
|
| -void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) {
|
| - Register global = ToRegister(instr->global());
|
| - Register result = ToRegister(instr->result());
|
| - __ mov(result, FieldOperand(global, GlobalObject::kGlobalReceiverOffset));
|
| -}
|
| -
|
| -
|
| void LCodeGen::CallKnownFunction(Handle<JSFunction> function,
|
| int formal_parameter_count,
|
| int arity,
|
| @@ -4220,6 +4130,21 @@ void LCodeGen::DoMathLog(LMathLog* instr) {
|
| }
|
|
|
|
|
| +void LCodeGen::DoMathClz32(LMathClz32* instr) {
|
| + CpuFeatureScope scope(masm(), SSE2);
|
| + Register input = ToRegister(instr->value());
|
| + Register result = ToRegister(instr->result());
|
| + Label not_zero_input;
|
| + __ bsr(result, input);
|
| +
|
| + __ j(not_zero, ¬_zero_input);
|
| + __ Set(result, Immediate(63)); // 63^31 == 32
|
| +
|
| + __ bind(¬_zero_input);
|
| + __ xor_(result, Immediate(31)); // for x in [0..31], 31^x == 31-x.
|
| +}
|
| +
|
| +
|
| void LCodeGen::DoMathExp(LMathExp* instr) {
|
| CpuFeatureScope scope(masm(), SSE2);
|
| XMMRegister input = ToDoubleRegister(instr->value());
|
| @@ -4260,13 +4185,8 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
|
| ASSERT(ToRegister(instr->result()).is(eax));
|
|
|
| int arity = instr->arity();
|
| - CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS);
|
| - if (instr->hydrogen()->IsTailCall()) {
|
| - if (NeedsEagerFrame()) __ leave();
|
| - __ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
|
| - } else {
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| - }
|
| + CallFunctionStub stub(arity, instr->hydrogen()->function_flags());
|
| + CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| }
|
|
|
|
|
| @@ -4290,7 +4210,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
|
| ASSERT(ToRegister(instr->result()).is(eax));
|
|
|
| __ Set(eax, Immediate(instr->arity()));
|
| - __ mov(ebx, instr->hydrogen()->property_cell());
|
| + __ mov(ebx, factory()->undefined_value());
|
| ElementsKind kind = instr->hydrogen()->elements_kind();
|
| AllocationSiteOverrideMode override_mode =
|
| (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
|
| @@ -4378,6 +4298,9 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
|
|
|
| Register object = ToRegister(instr->object());
|
| Handle<Map> transition = instr->transition();
|
| + SmiCheck check_needed =
|
| + instr->hydrogen()->value()->IsHeapObject()
|
| + ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
|
|
|
| if (FLAG_track_fields && representation.IsSmi()) {
|
| if (instr->value()->IsConstantOperand()) {
|
| @@ -4397,9 +4320,12 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
|
| Register value = ToRegister(instr->value());
|
| __ test(value, Immediate(kSmiTagMask));
|
| DeoptimizeIf(zero, instr->environment());
|
| +
|
| + // We know that value is a smi now, so we can omit the check below.
|
| + check_needed = OMIT_SMI_CHECK;
|
| }
|
| }
|
| - } else if (FLAG_track_double_fields && representation.IsDouble()) {
|
| + } else if (representation.IsDouble()) {
|
| ASSERT(transition.is_null());
|
| ASSERT(access.IsInobject());
|
| ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
|
| @@ -4434,10 +4360,6 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
|
| }
|
|
|
| // Do the store.
|
| - SmiCheck check_needed =
|
| - instr->hydrogen()->value()->IsHeapObject()
|
| - ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
|
| -
|
| Register write_register = object;
|
| if (!access.IsInobject()) {
|
| write_register = ToRegister(instr->temp());
|
| @@ -4538,7 +4460,7 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
|
| elements_kind,
|
| 0,
|
| instr->additional_index()));
|
| - if (elements_kind == EXTERNAL_FLOAT_ELEMENTS ||
|
| + if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
|
| elements_kind == FLOAT32_ELEMENTS) {
|
| if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
|
| CpuFeatureScope scope(masm(), SSE2);
|
| @@ -4549,7 +4471,7 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
|
| __ fld(0);
|
| __ fstp_s(operand);
|
| }
|
| - } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS ||
|
| + } else if (elements_kind == EXTERNAL_FLOAT64_ELEMENTS ||
|
| elements_kind == FLOAT64_ELEMENTS) {
|
| if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
|
| CpuFeatureScope scope(masm(), SSE2);
|
| @@ -4560,28 +4482,28 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
|
| } else {
|
| Register value = ToRegister(instr->value());
|
| switch (elements_kind) {
|
| - case EXTERNAL_PIXEL_ELEMENTS:
|
| - case EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
|
| - case EXTERNAL_BYTE_ELEMENTS:
|
| + case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
|
| + case EXTERNAL_UINT8_ELEMENTS:
|
| + case EXTERNAL_INT8_ELEMENTS:
|
| case UINT8_ELEMENTS:
|
| case INT8_ELEMENTS:
|
| case UINT8_CLAMPED_ELEMENTS:
|
| __ mov_b(operand, value);
|
| break;
|
| - case EXTERNAL_SHORT_ELEMENTS:
|
| - case EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
|
| + case EXTERNAL_INT16_ELEMENTS:
|
| + case EXTERNAL_UINT16_ELEMENTS:
|
| case UINT16_ELEMENTS:
|
| case INT16_ELEMENTS:
|
| __ mov_w(operand, value);
|
| break;
|
| - case EXTERNAL_INT_ELEMENTS:
|
| - case EXTERNAL_UNSIGNED_INT_ELEMENTS:
|
| + case EXTERNAL_INT32_ELEMENTS:
|
| + case EXTERNAL_UINT32_ELEMENTS:
|
| case UINT32_ELEMENTS:
|
| case INT32_ELEMENTS:
|
| __ mov(operand, value);
|
| break;
|
| - case EXTERNAL_FLOAT_ELEMENTS:
|
| - case EXTERNAL_DOUBLE_ELEMENTS:
|
| + case EXTERNAL_FLOAT32_ELEMENTS:
|
| + case EXTERNAL_FLOAT64_ELEMENTS:
|
| case FLOAT32_ELEMENTS:
|
| case FLOAT64_ELEMENTS:
|
| case FAST_SMI_ELEMENTS:
|
| @@ -4907,18 +4829,11 @@ void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) {
|
|
|
| void LCodeGen::DoStringAdd(LStringAdd* instr) {
|
| ASSERT(ToRegister(instr->context()).is(esi));
|
| - if (FLAG_new_string_add) {
|
| - ASSERT(ToRegister(instr->left()).is(edx));
|
| - ASSERT(ToRegister(instr->right()).is(eax));
|
| - NewStringAddStub stub(instr->hydrogen()->flags(),
|
| - instr->hydrogen()->pretenure_flag());
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| - } else {
|
| - EmitPushTaggedOperand(instr->left());
|
| - EmitPushTaggedOperand(instr->right());
|
| - StringAddStub stub(instr->hydrogen()->flags());
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| - }
|
| + ASSERT(ToRegister(instr->left()).is(edx));
|
| + ASSERT(ToRegister(instr->right()).is(eax));
|
| + StringAddStub stub(instr->hydrogen()->flags(),
|
| + instr->hydrogen()->pretenure_flag());
|
| + CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| }
|
|
|
|
|
| @@ -5876,7 +5791,11 @@ void LCodeGen::DoAllocate(LAllocate* instr) {
|
|
|
| if (instr->size()->IsConstantOperand()) {
|
| int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
|
| - __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
|
| + if (size <= Page::kMaxRegularHeapObjectSize) {
|
| + __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
|
| + } else {
|
| + __ jmp(deferred->entry());
|
| + }
|
| } else {
|
| Register size = ToRegister(instr->size());
|
| __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
|
|
|