| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 GenerateDeferredCode() && | 77 GenerateDeferredCode() && |
| 78 GenerateDeoptJumpTable() && | 78 GenerateDeoptJumpTable() && |
| 79 GenerateSafepointTable(); | 79 GenerateSafepointTable(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 | 82 |
| 83 void LCodeGen::FinishCode(Handle<Code> code) { | 83 void LCodeGen::FinishCode(Handle<Code> code) { |
| 84 ASSERT(is_done()); | 84 ASSERT(is_done()); |
| 85 code->set_stack_slots(GetStackSlotCount()); | 85 code->set_stack_slots(GetStackSlotCount()); |
| 86 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 86 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |
| 87 if (FLAG_weak_embedded_maps_in_optimized_code) { | 87 RegisterDependentCodeForEmbeddedMaps(code); |
| 88 RegisterDependentCodeForEmbeddedMaps(code); | |
| 89 } | |
| 90 PopulateDeoptimizationData(code); | 88 PopulateDeoptimizationData(code); |
| 91 info()->CommitDependencies(code); | 89 info()->CommitDependencies(code); |
| 92 } | 90 } |
| 93 | 91 |
| 94 | 92 |
| 95 void LCodeGen::Abort(BailoutReason reason) { | 93 void LCodeGen::Abort(BailoutReason reason) { |
| 96 info()->set_bailout_reason(reason); | 94 info()->set_bailout_reason(reason); |
| 97 status_ = ABORTED; | 95 status_ = ABORTED; |
| 98 } | 96 } |
| 99 | 97 |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 | 878 |
| 881 void LCodeGen::DeoptimizeIf(Condition condition, | 879 void LCodeGen::DeoptimizeIf(Condition condition, |
| 882 LEnvironment* environment) { | 880 LEnvironment* environment) { |
| 883 Deoptimizer::BailoutType bailout_type = info()->IsStub() | 881 Deoptimizer::BailoutType bailout_type = info()->IsStub() |
| 884 ? Deoptimizer::LAZY | 882 ? Deoptimizer::LAZY |
| 885 : Deoptimizer::EAGER; | 883 : Deoptimizer::EAGER; |
| 886 DeoptimizeIf(condition, environment, bailout_type); | 884 DeoptimizeIf(condition, environment, bailout_type); |
| 887 } | 885 } |
| 888 | 886 |
| 889 | 887 |
| 890 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { | |
| 891 ZoneList<Handle<Map> > maps(1, zone()); | |
| 892 ZoneList<Handle<JSObject> > objects(1, zone()); | |
| 893 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | |
| 894 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { | |
| 895 if (Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_object())) { | |
| 896 if (it.rinfo()->target_object()->IsMap()) { | |
| 897 Handle<Map> map(Map::cast(it.rinfo()->target_object())); | |
| 898 maps.Add(map, zone()); | |
| 899 } else if (it.rinfo()->target_object()->IsJSObject()) { | |
| 900 Handle<JSObject> object(JSObject::cast(it.rinfo()->target_object())); | |
| 901 objects.Add(object, zone()); | |
| 902 } | |
| 903 } | |
| 904 } | |
| 905 #ifdef VERIFY_HEAP | |
| 906 // This disables verification of weak embedded objects after full GC. | |
| 907 // AddDependentCode can cause a GC, which would observe the state where | |
| 908 // this code is not yet in the depended code lists of the embedded maps. | |
| 909 NoWeakObjectVerificationScope disable_verification_of_embedded_objects; | |
| 910 #endif | |
| 911 for (int i = 0; i < maps.length(); i++) { | |
| 912 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); | |
| 913 } | |
| 914 for (int i = 0; i < objects.length(); i++) { | |
| 915 AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code); | |
| 916 } | |
| 917 } | |
| 918 | |
| 919 | |
| 920 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 888 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
| 921 int length = deoptimizations_.length(); | 889 int length = deoptimizations_.length(); |
| 922 if (length == 0) return; | 890 if (length == 0) return; |
| 923 Handle<DeoptimizationInputData> data = | 891 Handle<DeoptimizationInputData> data = |
| 924 factory()->NewDeoptimizationInputData(length, TENURED); | 892 factory()->NewDeoptimizationInputData(length, TENURED); |
| 925 | 893 |
| 926 Handle<ByteArray> translations = | 894 Handle<ByteArray> translations = |
| 927 translations_.CreateByteArray(isolate()->factory()); | 895 translations_.CreateByteArray(isolate()->factory()); |
| 928 data->SetTranslationByteArray(*translations); | 896 data->SetTranslationByteArray(*translations); |
| 929 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); | 897 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); |
| (...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2040 MemOperand operand = BuildSeqStringOperand(string, instr->index(), encoding); | 2008 MemOperand operand = BuildSeqStringOperand(string, instr->index(), encoding); |
| 2041 if (encoding == String::ONE_BYTE_ENCODING) { | 2009 if (encoding == String::ONE_BYTE_ENCODING) { |
| 2042 __ strb(value, operand); | 2010 __ strb(value, operand); |
| 2043 } else { | 2011 } else { |
| 2044 __ strh(value, operand); | 2012 __ strh(value, operand); |
| 2045 } | 2013 } |
| 2046 } | 2014 } |
| 2047 | 2015 |
| 2048 | 2016 |
| 2049 void LCodeGen::DoThrow(LThrow* instr) { | 2017 void LCodeGen::DoThrow(LThrow* instr) { |
| 2050 Register input_reg = EmitLoadRegister(instr->value(), ip); | 2018 __ push(ToRegister(instr->value())); |
| 2051 __ push(input_reg); | |
| 2052 ASSERT(ToRegister(instr->context()).is(cp)); | 2019 ASSERT(ToRegister(instr->context()).is(cp)); |
| 2053 CallRuntime(Runtime::kThrow, 1, instr); | 2020 CallRuntime(Runtime::kThrow, 1, instr); |
| 2054 | 2021 |
| 2055 if (FLAG_debug_code) { | 2022 if (FLAG_debug_code) { |
| 2056 __ stop("Unreachable code."); | 2023 __ stop("Unreachable code."); |
| 2057 } | 2024 } |
| 2058 } | 2025 } |
| 2059 | 2026 |
| 2060 | 2027 |
| 2061 void LCodeGen::DoAddI(LAddI* instr) { | 2028 void LCodeGen::DoAddI(LAddI* instr) { |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2179 } | 2146 } |
| 2180 } | 2147 } |
| 2181 | 2148 |
| 2182 | 2149 |
| 2183 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { | 2150 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
| 2184 ASSERT(ToRegister(instr->context()).is(cp)); | 2151 ASSERT(ToRegister(instr->context()).is(cp)); |
| 2185 ASSERT(ToRegister(instr->left()).is(r1)); | 2152 ASSERT(ToRegister(instr->left()).is(r1)); |
| 2186 ASSERT(ToRegister(instr->right()).is(r0)); | 2153 ASSERT(ToRegister(instr->right()).is(r0)); |
| 2187 ASSERT(ToRegister(instr->result()).is(r0)); | 2154 ASSERT(ToRegister(instr->result()).is(r0)); |
| 2188 | 2155 |
| 2189 BinaryOpStub stub(instr->op(), NO_OVERWRITE); | 2156 BinaryOpICStub stub(instr->op(), NO_OVERWRITE); |
| 2190 // Block literal pool emission to ensure nop indicating no inlined smi code | 2157 // Block literal pool emission to ensure nop indicating no inlined smi code |
| 2191 // is in the correct position. | 2158 // is in the correct position. |
| 2192 Assembler::BlockConstPoolScope block_const_pool(masm()); | 2159 Assembler::BlockConstPoolScope block_const_pool(masm()); |
| 2193 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 2160 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 2194 __ nop(); // Signals no inlined code. | 2161 __ nop(); // Signals no inlined code. |
| 2195 } | 2162 } |
| 2196 | 2163 |
| 2197 | 2164 |
| 2198 template<class InstrType> | 2165 template<class InstrType> |
| 2199 void LCodeGen::EmitBranch(InstrType instr, Condition condition) { | 2166 void LCodeGen::EmitBranch(InstrType instr, Condition condition) { |
| (...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3489 __ SmiUntag(result); | 3456 __ SmiUntag(result); |
| 3490 | 3457 |
| 3491 // Argument length is in result register. | 3458 // Argument length is in result register. |
| 3492 __ bind(&done); | 3459 __ bind(&done); |
| 3493 } | 3460 } |
| 3494 | 3461 |
| 3495 | 3462 |
| 3496 void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { | 3463 void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { |
| 3497 Register receiver = ToRegister(instr->receiver()); | 3464 Register receiver = ToRegister(instr->receiver()); |
| 3498 Register function = ToRegister(instr->function()); | 3465 Register function = ToRegister(instr->function()); |
| 3466 Register result = ToRegister(instr->result()); |
| 3499 Register scratch = scratch0(); | 3467 Register scratch = scratch0(); |
| 3500 | 3468 |
| 3501 // If the receiver is null or undefined, we have to pass the global | 3469 // If the receiver is null or undefined, we have to pass the global |
| 3502 // object as a receiver to normal functions. Values have to be | 3470 // object as a receiver to normal functions. Values have to be |
| 3503 // passed unchanged to builtins and strict-mode functions. | 3471 // passed unchanged to builtins and strict-mode functions. |
| 3504 Label global_object, receiver_ok; | 3472 Label global_object, result_in_receiver; |
| 3505 | 3473 |
| 3506 // Do not transform the receiver to object for strict mode | 3474 // Do not transform the receiver to object for strict mode |
| 3507 // functions. | 3475 // functions. |
| 3508 __ ldr(scratch, | 3476 __ ldr(scratch, |
| 3509 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); | 3477 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
| 3510 __ ldr(scratch, | 3478 __ ldr(scratch, |
| 3511 FieldMemOperand(scratch, SharedFunctionInfo::kCompilerHintsOffset)); | 3479 FieldMemOperand(scratch, SharedFunctionInfo::kCompilerHintsOffset)); |
| 3512 __ tst(scratch, | 3480 __ tst(scratch, |
| 3513 Operand(1 << (SharedFunctionInfo::kStrictModeFunction + kSmiTagSize))); | 3481 Operand(1 << (SharedFunctionInfo::kStrictModeFunction + kSmiTagSize))); |
| 3514 __ b(ne, &receiver_ok); | 3482 __ b(ne, &result_in_receiver); |
| 3515 | 3483 |
| 3516 // Do not transform the receiver to object for builtins. | 3484 // Do not transform the receiver to object for builtins. |
| 3517 __ tst(scratch, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize))); | 3485 __ tst(scratch, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize))); |
| 3518 __ b(ne, &receiver_ok); | 3486 __ b(ne, &result_in_receiver); |
| 3519 | 3487 |
| 3520 // Normal function. Replace undefined or null with global receiver. | 3488 // Normal function. Replace undefined or null with global receiver. |
| 3521 __ LoadRoot(scratch, Heap::kNullValueRootIndex); | 3489 __ LoadRoot(scratch, Heap::kNullValueRootIndex); |
| 3522 __ cmp(receiver, scratch); | 3490 __ cmp(receiver, scratch); |
| 3523 __ b(eq, &global_object); | 3491 __ b(eq, &global_object); |
| 3524 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 3492 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
| 3525 __ cmp(receiver, scratch); | 3493 __ cmp(receiver, scratch); |
| 3526 __ b(eq, &global_object); | 3494 __ b(eq, &global_object); |
| 3527 | 3495 |
| 3528 // Deoptimize if the receiver is not a JS object. | 3496 // Deoptimize if the receiver is not a JS object. |
| 3529 __ SmiTst(receiver); | 3497 __ SmiTst(receiver); |
| 3530 DeoptimizeIf(eq, instr->environment()); | 3498 DeoptimizeIf(eq, instr->environment()); |
| 3531 __ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE); | 3499 __ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE); |
| 3532 DeoptimizeIf(lt, instr->environment()); | 3500 DeoptimizeIf(lt, instr->environment()); |
| 3533 __ jmp(&receiver_ok); | 3501 __ b(&result_in_receiver); |
| 3534 | 3502 |
| 3535 __ bind(&global_object); | 3503 __ bind(&global_object); |
| 3536 __ ldr(receiver, GlobalObjectOperand()); | 3504 __ ldr(result, GlobalObjectOperand()); |
| 3537 __ ldr(receiver, | 3505 __ ldr(result, |
| 3538 FieldMemOperand(receiver, JSGlobalObject::kGlobalReceiverOffset)); | 3506 FieldMemOperand(result, JSGlobalObject::kGlobalReceiverOffset)); |
| 3539 __ bind(&receiver_ok); | 3507 if (result.is(receiver)) { |
| 3508 __ bind(&result_in_receiver); |
| 3509 } else { |
| 3510 Label result_ok; |
| 3511 __ b(&result_ok); |
| 3512 __ bind(&result_in_receiver); |
| 3513 __ mov(result, receiver); |
| 3514 __ bind(&result_ok); |
| 3515 } |
| 3540 } | 3516 } |
| 3541 | 3517 |
| 3542 | 3518 |
| 3543 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { | 3519 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
| 3544 Register receiver = ToRegister(instr->receiver()); | 3520 Register receiver = ToRegister(instr->receiver()); |
| 3545 Register function = ToRegister(instr->function()); | 3521 Register function = ToRegister(instr->function()); |
| 3546 Register length = ToRegister(instr->length()); | 3522 Register length = ToRegister(instr->length()); |
| 3547 Register elements = ToRegister(instr->elements()); | 3523 Register elements = ToRegister(instr->elements()); |
| 3548 Register scratch = scratch0(); | 3524 Register scratch = scratch0(); |
| 3549 ASSERT(receiver.is(r0)); // Used for parameter count. | 3525 ASSERT(receiver.is(r0)); // Used for parameter count. |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3968 ASSERT(ToDoubleRegister(instr->result()).is(d2)); | 3944 ASSERT(ToDoubleRegister(instr->result()).is(d2)); |
| 3969 // Set the context register to a GC-safe fake value. Clobbering it is | 3945 // Set the context register to a GC-safe fake value. Clobbering it is |
| 3970 // OK because this instruction is marked as a call. | 3946 // OK because this instruction is marked as a call. |
| 3971 __ mov(cp, Operand::Zero()); | 3947 __ mov(cp, Operand::Zero()); |
| 3972 TranscendentalCacheStub stub(TranscendentalCache::LOG, | 3948 TranscendentalCacheStub stub(TranscendentalCache::LOG, |
| 3973 TranscendentalCacheStub::UNTAGGED); | 3949 TranscendentalCacheStub::UNTAGGED); |
| 3974 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 3950 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 3975 } | 3951 } |
| 3976 | 3952 |
| 3977 | 3953 |
| 3978 void LCodeGen::DoMathTan(LMathTan* instr) { | |
| 3979 ASSERT(ToDoubleRegister(instr->result()).is(d2)); | |
| 3980 // Set the context register to a GC-safe fake value. Clobbering it is | |
| 3981 // OK because this instruction is marked as a call. | |
| 3982 __ mov(cp, Operand::Zero()); | |
| 3983 TranscendentalCacheStub stub(TranscendentalCache::TAN, | |
| 3984 TranscendentalCacheStub::UNTAGGED); | |
| 3985 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | |
| 3986 } | |
| 3987 | |
| 3988 | |
| 3989 void LCodeGen::DoMathCos(LMathCos* instr) { | |
| 3990 ASSERT(ToDoubleRegister(instr->result()).is(d2)); | |
| 3991 // Set the context register to a GC-safe fake value. Clobbering it is | |
| 3992 // OK because this instruction is marked as a call. | |
| 3993 __ mov(cp, Operand::Zero()); | |
| 3994 TranscendentalCacheStub stub(TranscendentalCache::COS, | |
| 3995 TranscendentalCacheStub::UNTAGGED); | |
| 3996 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | |
| 3997 } | |
| 3998 | |
| 3999 | |
| 4000 void LCodeGen::DoMathSin(LMathSin* instr) { | |
| 4001 ASSERT(ToDoubleRegister(instr->result()).is(d2)); | |
| 4002 // Set the context register to a GC-safe fake value. Clobbering it is | |
| 4003 // OK because this instruction is marked as a call. | |
| 4004 __ mov(cp, Operand::Zero()); | |
| 4005 TranscendentalCacheStub stub(TranscendentalCache::SIN, | |
| 4006 TranscendentalCacheStub::UNTAGGED); | |
| 4007 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | |
| 4008 } | |
| 4009 | |
| 4010 | |
| 4011 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { | 3954 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
| 4012 ASSERT(ToRegister(instr->context()).is(cp)); | 3955 ASSERT(ToRegister(instr->context()).is(cp)); |
| 4013 ASSERT(ToRegister(instr->function()).is(r1)); | 3956 ASSERT(ToRegister(instr->function()).is(r1)); |
| 4014 ASSERT(instr->HasPointerMap()); | 3957 ASSERT(instr->HasPointerMap()); |
| 4015 | 3958 |
| 4016 Handle<JSFunction> known_function = instr->hydrogen()->known_function(); | 3959 Handle<JSFunction> known_function = instr->hydrogen()->known_function(); |
| 4017 if (known_function.is_null()) { | 3960 if (known_function.is_null()) { |
| 4018 LPointerMap* pointers = instr->pointer_map(); | 3961 LPointerMap* pointers = instr->pointer_map(); |
| 4019 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); | 3962 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); |
| 4020 ParameterCount count(instr->arity()); | 3963 ParameterCount count(instr->arity()); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4163 Register code_object = ToRegister(instr->code_object()); | 4106 Register code_object = ToRegister(instr->code_object()); |
| 4164 __ add(code_object, code_object, Operand(Code::kHeaderSize - kHeapObjectTag)); | 4107 __ add(code_object, code_object, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 4165 __ str(code_object, | 4108 __ str(code_object, |
| 4166 FieldMemOperand(function, JSFunction::kCodeEntryOffset)); | 4109 FieldMemOperand(function, JSFunction::kCodeEntryOffset)); |
| 4167 } | 4110 } |
| 4168 | 4111 |
| 4169 | 4112 |
| 4170 void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { | 4113 void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { |
| 4171 Register result = ToRegister(instr->result()); | 4114 Register result = ToRegister(instr->result()); |
| 4172 Register base = ToRegister(instr->base_object()); | 4115 Register base = ToRegister(instr->base_object()); |
| 4173 __ add(result, base, Operand(instr->offset())); | 4116 if (instr->offset()->IsConstantOperand()) { |
| 4117 LConstantOperand* offset = LConstantOperand::cast(instr->offset()); |
| 4118 __ add(result, base, Operand(ToInteger32(offset))); |
| 4119 } else { |
| 4120 Register offset = ToRegister(instr->offset()); |
| 4121 __ add(result, base, offset); |
| 4122 } |
| 4174 } | 4123 } |
| 4175 | 4124 |
| 4176 | 4125 |
| 4177 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { | 4126 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
| 4178 Representation representation = instr->representation(); | 4127 Representation representation = instr->representation(); |
| 4179 | 4128 |
| 4180 Register object = ToRegister(instr->object()); | 4129 Register object = ToRegister(instr->object()); |
| 4181 Register scratch = scratch0(); | 4130 Register scratch = scratch0(); |
| 4182 HObjectAccess access = instr->hydrogen()->access(); | 4131 HObjectAccess access = instr->hydrogen()->access(); |
| 4183 int offset = access.offset(); | 4132 int offset = access.offset(); |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4755 virtual void Generate() V8_OVERRIDE { | 4704 virtual void Generate() V8_OVERRIDE { |
| 4756 codegen()->DoDeferredNumberTagI(instr_, | 4705 codegen()->DoDeferredNumberTagI(instr_, |
| 4757 instr_->value(), | 4706 instr_->value(), |
| 4758 UNSIGNED_INT32); | 4707 UNSIGNED_INT32); |
| 4759 } | 4708 } |
| 4760 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 4709 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } |
| 4761 private: | 4710 private: |
| 4762 LNumberTagU* instr_; | 4711 LNumberTagU* instr_; |
| 4763 }; | 4712 }; |
| 4764 | 4713 |
| 4765 LOperand* input = instr->value(); | 4714 Register input = ToRegister(instr->value()); |
| 4766 ASSERT(input->IsRegister() && input->Equals(instr->result())); | 4715 Register result = ToRegister(instr->result()); |
| 4767 Register reg = ToRegister(input); | |
| 4768 | 4716 |
| 4769 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr); | 4717 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr); |
| 4770 __ cmp(reg, Operand(Smi::kMaxValue)); | 4718 __ cmp(input, Operand(Smi::kMaxValue)); |
| 4771 __ b(hi, deferred->entry()); | 4719 __ b(hi, deferred->entry()); |
| 4772 __ SmiTag(reg, reg); | 4720 __ SmiTag(result, input); |
| 4773 __ bind(deferred->exit()); | 4721 __ bind(deferred->exit()); |
| 4774 } | 4722 } |
| 4775 | 4723 |
| 4776 | 4724 |
| 4777 void LCodeGen::DoDeferredNumberTagI(LInstruction* instr, | 4725 void LCodeGen::DoDeferredNumberTagI(LInstruction* instr, |
| 4778 LOperand* value, | 4726 LOperand* value, |
| 4779 IntegerSignedness signedness) { | 4727 IntegerSignedness signedness) { |
| 4780 Label slow; | 4728 Label slow; |
| 4781 Register src = ToRegister(value); | 4729 Register src = ToRegister(value); |
| 4782 Register dst = ToRegister(instr->result()); | 4730 Register dst = ToRegister(instr->result()); |
| (...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5876 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5824 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
| 5877 __ ldr(result, FieldMemOperand(scratch, | 5825 __ ldr(result, FieldMemOperand(scratch, |
| 5878 FixedArray::kHeaderSize - kPointerSize)); | 5826 FixedArray::kHeaderSize - kPointerSize)); |
| 5879 __ bind(&done); | 5827 __ bind(&done); |
| 5880 } | 5828 } |
| 5881 | 5829 |
| 5882 | 5830 |
| 5883 #undef __ | 5831 #undef __ |
| 5884 | 5832 |
| 5885 } } // namespace v8::internal | 5833 } } // namespace v8::internal |
| OLD | NEW |