| 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 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2132 __ bind(&before_push_delta); | 2132 __ bind(&before_push_delta); |
| 2133 { | 2133 { |
| 2134 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 2134 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
| 2135 __ li(temp, Operand(delta * kPointerSize), CONSTANT_SIZE); | 2135 __ li(temp, Operand(delta * kPointerSize), CONSTANT_SIZE); |
| 2136 __ StoreToSafepointRegisterSlot(temp, temp); | 2136 __ StoreToSafepointRegisterSlot(temp, temp); |
| 2137 } | 2137 } |
| 2138 CallCodeGeneric(stub.GetCode(), | 2138 CallCodeGeneric(stub.GetCode(), |
| 2139 RelocInfo::CODE_TARGET, | 2139 RelocInfo::CODE_TARGET, |
| 2140 instr, | 2140 instr, |
| 2141 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); | 2141 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); |
| 2142 ASSERT(instr->HasDeoptimizationEnvironment()); | 2142 LEnvironment* env = instr->GetDeferredLazyDeoptimizationEnvironment(); |
| 2143 LEnvironment* env = instr->deoptimization_environment(); | |
| 2144 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 2143 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
| 2145 // Put the result value into the result register slot and | 2144 // Put the result value into the result register slot and |
| 2146 // restore all registers. | 2145 // restore all registers. |
| 2147 __ StoreToSafepointRegisterSlot(result, result); | 2146 __ StoreToSafepointRegisterSlot(result, result); |
| 2148 } | 2147 } |
| 2149 | 2148 |
| 2150 | 2149 |
| 2151 void LCodeGen::DoCmpT(LCmpT* instr) { | 2150 void LCodeGen::DoCmpT(LCmpT* instr) { |
| 2152 Token::Value op = instr->op(); | 2151 Token::Value op = instr->op(); |
| 2153 | 2152 |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2765 __ sll(scratch, length, 2); | 2764 __ sll(scratch, length, 2); |
| 2766 __ bind(&loop); | 2765 __ bind(&loop); |
| 2767 __ Addu(scratch, elements, scratch); | 2766 __ Addu(scratch, elements, scratch); |
| 2768 __ lw(scratch, MemOperand(scratch)); | 2767 __ lw(scratch, MemOperand(scratch)); |
| 2769 __ push(scratch); | 2768 __ push(scratch); |
| 2770 __ Subu(length, length, Operand(1)); | 2769 __ Subu(length, length, Operand(1)); |
| 2771 __ Branch(USE_DELAY_SLOT, &loop, ne, length, Operand(zero_reg)); | 2770 __ Branch(USE_DELAY_SLOT, &loop, ne, length, Operand(zero_reg)); |
| 2772 __ sll(scratch, length, 2); | 2771 __ sll(scratch, length, 2); |
| 2773 | 2772 |
| 2774 __ bind(&invoke); | 2773 __ bind(&invoke); |
| 2775 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); | 2774 ASSERT(instr->HasPointerMap()); |
| 2776 LPointerMap* pointers = instr->pointer_map(); | 2775 LPointerMap* pointers = instr->pointer_map(); |
| 2777 RecordPosition(pointers->position()); | 2776 RecordPosition(pointers->position()); |
| 2778 SafepointGenerator safepoint_generator( | 2777 SafepointGenerator safepoint_generator( |
| 2779 this, pointers, Safepoint::kLazyDeopt); | 2778 this, pointers, Safepoint::kLazyDeopt); |
| 2780 // The number of arguments is stored in receiver which is a0, as expected | 2779 // The number of arguments is stored in receiver which is a0, as expected |
| 2781 // by InvokeFunction. | 2780 // by InvokeFunction. |
| 2782 ParameterCount actual(receiver); | 2781 ParameterCount actual(receiver); |
| 2783 __ InvokeFunction(function, actual, CALL_FUNCTION, | 2782 __ InvokeFunction(function, actual, CALL_FUNCTION, |
| 2784 safepoint_generator, CALL_AS_METHOD); | 2783 safepoint_generator, CALL_AS_METHOD); |
| 2785 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2784 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3329 default: | 3328 default: |
| 3330 Abort("Unimplemented type of LUnaryMathOperation."); | 3329 Abort("Unimplemented type of LUnaryMathOperation."); |
| 3331 UNREACHABLE(); | 3330 UNREACHABLE(); |
| 3332 } | 3331 } |
| 3333 } | 3332 } |
| 3334 | 3333 |
| 3335 | 3334 |
| 3336 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { | 3335 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
| 3337 ASSERT(ToRegister(instr->function()).is(a1)); | 3336 ASSERT(ToRegister(instr->function()).is(a1)); |
| 3338 ASSERT(instr->HasPointerMap()); | 3337 ASSERT(instr->HasPointerMap()); |
| 3339 ASSERT(instr->HasDeoptimizationEnvironment()); | |
| 3340 | 3338 |
| 3341 if (instr->known_function().is_null()) { | 3339 if (instr->known_function().is_null()) { |
| 3342 LPointerMap* pointers = instr->pointer_map(); | 3340 LPointerMap* pointers = instr->pointer_map(); |
| 3343 RecordPosition(pointers->position()); | 3341 RecordPosition(pointers->position()); |
| 3344 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); | 3342 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); |
| 3345 ParameterCount count(instr->arity()); | 3343 ParameterCount count(instr->arity()); |
| 3346 __ InvokeFunction(a1, count, CALL_FUNCTION, generator, CALL_AS_METHOD); | 3344 __ InvokeFunction(a1, count, CALL_FUNCTION, generator, CALL_AS_METHOD); |
| 3347 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 3345 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 3348 } else { | 3346 } else { |
| 3349 CallKnownFunction(instr->known_function(), | 3347 CallKnownFunction(instr->known_function(), |
| (...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4948 DeoptimizeIf(al, instr->environment(), zero_reg, Operand(zero_reg)); | 4946 DeoptimizeIf(al, instr->environment(), zero_reg, Operand(zero_reg)); |
| 4949 } | 4947 } |
| 4950 | 4948 |
| 4951 | 4949 |
| 4952 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { | 4950 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { |
| 4953 Register object = ToRegister(instr->object()); | 4951 Register object = ToRegister(instr->object()); |
| 4954 Register key = ToRegister(instr->key()); | 4952 Register key = ToRegister(instr->key()); |
| 4955 Register strict = scratch0(); | 4953 Register strict = scratch0(); |
| 4956 __ li(strict, Operand(Smi::FromInt(strict_mode_flag()))); | 4954 __ li(strict, Operand(Smi::FromInt(strict_mode_flag()))); |
| 4957 __ Push(object, key, strict); | 4955 __ Push(object, key, strict); |
| 4958 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); | 4956 ASSERT(instr->HasPointerMap()); |
| 4959 LPointerMap* pointers = instr->pointer_map(); | 4957 LPointerMap* pointers = instr->pointer_map(); |
| 4960 RecordPosition(pointers->position()); | 4958 RecordPosition(pointers->position()); |
| 4961 SafepointGenerator safepoint_generator( | 4959 SafepointGenerator safepoint_generator( |
| 4962 this, pointers, Safepoint::kLazyDeopt); | 4960 this, pointers, Safepoint::kLazyDeopt); |
| 4963 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator); | 4961 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator); |
| 4964 } | 4962 } |
| 4965 | 4963 |
| 4966 | 4964 |
| 4967 void LCodeGen::DoIn(LIn* instr) { | 4965 void LCodeGen::DoIn(LIn* instr) { |
| 4968 Register obj = ToRegister(instr->object()); | 4966 Register obj = ToRegister(instr->object()); |
| 4969 Register key = ToRegister(instr->key()); | 4967 Register key = ToRegister(instr->key()); |
| 4970 __ Push(key, obj); | 4968 __ Push(key, obj); |
| 4971 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); | 4969 ASSERT(instr->HasPointerMap()); |
| 4972 LPointerMap* pointers = instr->pointer_map(); | 4970 LPointerMap* pointers = instr->pointer_map(); |
| 4973 RecordPosition(pointers->position()); | 4971 RecordPosition(pointers->position()); |
| 4974 SafepointGenerator safepoint_generator(this, pointers, Safepoint::kLazyDeopt); | 4972 SafepointGenerator safepoint_generator(this, pointers, Safepoint::kLazyDeopt); |
| 4975 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4973 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
| 4976 } | 4974 } |
| 4977 | 4975 |
| 4978 | 4976 |
| 4979 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { | 4977 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { |
| 4980 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); | 4978 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); |
| 4981 __ CallRuntimeSaveDoubles(Runtime::kStackGuard); | 4979 __ CallRuntimeSaveDoubles(Runtime::kStackGuard); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5127 __ Subu(scratch, result, scratch); | 5125 __ Subu(scratch, result, scratch); |
| 5128 __ lw(result, FieldMemOperand(scratch, | 5126 __ lw(result, FieldMemOperand(scratch, |
| 5129 FixedArray::kHeaderSize - kPointerSize)); | 5127 FixedArray::kHeaderSize - kPointerSize)); |
| 5130 __ bind(&done); | 5128 __ bind(&done); |
| 5131 } | 5129 } |
| 5132 | 5130 |
| 5133 | 5131 |
| 5134 #undef __ | 5132 #undef __ |
| 5135 | 5133 |
| 5136 } } // namespace v8::internal | 5134 } } // namespace v8::internal |
| OLD | NEW |