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 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2052 ASSERT(MacroAssembler::SafepointRegisterStackIndex(temp) == 0); | 2052 ASSERT(MacroAssembler::SafepointRegisterStackIndex(temp) == 0); |
2053 __ LoadHeapObject(InstanceofStub::right(), instr->function()); | 2053 __ LoadHeapObject(InstanceofStub::right(), instr->function()); |
2054 static const int kAdditionalDelta = 13; | 2054 static const int kAdditionalDelta = 13; |
2055 int delta = masm_->SizeOfCodeGeneratedSince(map_check) + kAdditionalDelta; | 2055 int delta = masm_->SizeOfCodeGeneratedSince(map_check) + kAdditionalDelta; |
2056 __ mov(temp, Immediate(delta)); | 2056 __ mov(temp, Immediate(delta)); |
2057 __ StoreToSafepointRegisterSlot(temp, temp); | 2057 __ StoreToSafepointRegisterSlot(temp, temp); |
2058 CallCodeGeneric(stub.GetCode(), | 2058 CallCodeGeneric(stub.GetCode(), |
2059 RelocInfo::CODE_TARGET, | 2059 RelocInfo::CODE_TARGET, |
2060 instr, | 2060 instr, |
2061 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); | 2061 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); |
2062 ASSERT(instr->HasDeoptimizationEnvironment()); | 2062 // Get the deoptimization index of the LLazyBailout-environment that |
2063 LEnvironment* env = instr->deoptimization_environment(); | 2063 // corresponds to this instruction. |
| 2064 LEnvironment* env = instr->GetDeferredLazyDeoptimizationEnvironment(); |
2064 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 2065 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
2065 | 2066 |
2066 // Put the result value into the eax slot and restore all registers. | 2067 // Put the result value into the eax slot and restore all registers. |
2067 __ StoreToSafepointRegisterSlot(eax, eax); | 2068 __ StoreToSafepointRegisterSlot(eax, eax); |
2068 } | 2069 } |
2069 | 2070 |
2070 | 2071 |
2071 void LCodeGen::DoCmpT(LCmpT* instr) { | 2072 void LCodeGen::DoCmpT(LCmpT* instr) { |
2072 Token::Value op = instr->op(); | 2073 Token::Value op = instr->op(); |
2073 | 2074 |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2663 // length is a small non-negative integer, due to the test above. | 2664 // length is a small non-negative integer, due to the test above. |
2664 __ test(length, Operand(length)); | 2665 __ test(length, Operand(length)); |
2665 __ j(zero, &invoke, Label::kNear); | 2666 __ j(zero, &invoke, Label::kNear); |
2666 __ bind(&loop); | 2667 __ bind(&loop); |
2667 __ push(Operand(elements, length, times_pointer_size, 1 * kPointerSize)); | 2668 __ push(Operand(elements, length, times_pointer_size, 1 * kPointerSize)); |
2668 __ dec(length); | 2669 __ dec(length); |
2669 __ j(not_zero, &loop); | 2670 __ j(not_zero, &loop); |
2670 | 2671 |
2671 // Invoke the function. | 2672 // Invoke the function. |
2672 __ bind(&invoke); | 2673 __ bind(&invoke); |
2673 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); | 2674 ASSERT(instr->HasPointerMap()); |
2674 LPointerMap* pointers = instr->pointer_map(); | 2675 LPointerMap* pointers = instr->pointer_map(); |
2675 RecordPosition(pointers->position()); | 2676 RecordPosition(pointers->position()); |
2676 SafepointGenerator safepoint_generator( | 2677 SafepointGenerator safepoint_generator( |
2677 this, pointers, Safepoint::kLazyDeopt); | 2678 this, pointers, Safepoint::kLazyDeopt); |
2678 ParameterCount actual(eax); | 2679 ParameterCount actual(eax); |
2679 __ InvokeFunction(function, actual, CALL_FUNCTION, | 2680 __ InvokeFunction(function, actual, CALL_FUNCTION, |
2680 safepoint_generator, CALL_AS_METHOD); | 2681 safepoint_generator, CALL_AS_METHOD); |
2681 } | 2682 } |
2682 | 2683 |
2683 | 2684 |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3228 default: | 3229 default: |
3229 UNREACHABLE(); | 3230 UNREACHABLE(); |
3230 } | 3231 } |
3231 } | 3232 } |
3232 | 3233 |
3233 | 3234 |
3234 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { | 3235 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
3235 ASSERT(ToRegister(instr->context()).is(esi)); | 3236 ASSERT(ToRegister(instr->context()).is(esi)); |
3236 ASSERT(ToRegister(instr->function()).is(edi)); | 3237 ASSERT(ToRegister(instr->function()).is(edi)); |
3237 ASSERT(instr->HasPointerMap()); | 3238 ASSERT(instr->HasPointerMap()); |
3238 ASSERT(instr->HasDeoptimizationEnvironment()); | |
3239 LPointerMap* pointers = instr->pointer_map(); | 3239 LPointerMap* pointers = instr->pointer_map(); |
3240 RecordPosition(pointers->position()); | 3240 RecordPosition(pointers->position()); |
3241 SafepointGenerator generator( | 3241 SafepointGenerator generator( |
3242 this, pointers, Safepoint::kLazyDeopt); | 3242 this, pointers, Safepoint::kLazyDeopt); |
3243 ParameterCount count(instr->arity()); | 3243 ParameterCount count(instr->arity()); |
3244 __ InvokeFunction(edi, count, CALL_FUNCTION, generator, CALL_AS_METHOD); | 3244 __ InvokeFunction(edi, count, CALL_FUNCTION, generator, CALL_AS_METHOD); |
3245 } | 3245 } |
3246 | 3246 |
3247 | 3247 |
3248 void LCodeGen::DoCallKeyed(LCallKeyed* instr) { | 3248 void LCodeGen::DoCallKeyed(LCallKeyed* instr) { |
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4818 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { | 4818 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { |
4819 DeoptimizeIf(no_condition, instr->environment()); | 4819 DeoptimizeIf(no_condition, instr->environment()); |
4820 } | 4820 } |
4821 | 4821 |
4822 | 4822 |
4823 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { | 4823 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { |
4824 LOperand* obj = instr->object(); | 4824 LOperand* obj = instr->object(); |
4825 LOperand* key = instr->key(); | 4825 LOperand* key = instr->key(); |
4826 __ push(ToOperand(obj)); | 4826 __ push(ToOperand(obj)); |
4827 EmitPushTaggedOperand(key); | 4827 EmitPushTaggedOperand(key); |
4828 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); | 4828 ASSERT(instr->HasPointerMap()); |
4829 LPointerMap* pointers = instr->pointer_map(); | 4829 LPointerMap* pointers = instr->pointer_map(); |
4830 RecordPosition(pointers->position()); | 4830 RecordPosition(pointers->position()); |
4831 // Create safepoint generator that will also ensure enough space in the | 4831 // Create safepoint generator that will also ensure enough space in the |
4832 // reloc info for patching in deoptimization (since this is invoking a | 4832 // reloc info for patching in deoptimization (since this is invoking a |
4833 // builtin) | 4833 // builtin) |
4834 SafepointGenerator safepoint_generator( | 4834 SafepointGenerator safepoint_generator( |
4835 this, pointers, Safepoint::kLazyDeopt); | 4835 this, pointers, Safepoint::kLazyDeopt); |
4836 __ push(Immediate(Smi::FromInt(strict_mode_flag()))); | 4836 __ push(Immediate(Smi::FromInt(strict_mode_flag()))); |
4837 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator); | 4837 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator); |
4838 } | 4838 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4916 ASSERT(osr_pc_offset_ == -1); | 4916 ASSERT(osr_pc_offset_ == -1); |
4917 osr_pc_offset_ = masm()->pc_offset(); | 4917 osr_pc_offset_ = masm()->pc_offset(); |
4918 } | 4918 } |
4919 | 4919 |
4920 | 4920 |
4921 void LCodeGen::DoIn(LIn* instr) { | 4921 void LCodeGen::DoIn(LIn* instr) { |
4922 LOperand* obj = instr->object(); | 4922 LOperand* obj = instr->object(); |
4923 LOperand* key = instr->key(); | 4923 LOperand* key = instr->key(); |
4924 EmitPushTaggedOperand(key); | 4924 EmitPushTaggedOperand(key); |
4925 EmitPushTaggedOperand(obj); | 4925 EmitPushTaggedOperand(obj); |
4926 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); | 4926 ASSERT(instr->HasPointerMap()); |
4927 LPointerMap* pointers = instr->pointer_map(); | 4927 LPointerMap* pointers = instr->pointer_map(); |
4928 RecordPosition(pointers->position()); | 4928 RecordPosition(pointers->position()); |
4929 SafepointGenerator safepoint_generator( | 4929 SafepointGenerator safepoint_generator( |
4930 this, pointers, Safepoint::kLazyDeopt); | 4930 this, pointers, Safepoint::kLazyDeopt); |
4931 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4931 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
4932 } | 4932 } |
4933 | 4933 |
4934 | 4934 |
4935 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { | 4935 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { |
4936 __ cmp(eax, isolate()->factory()->undefined_value()); | 4936 __ cmp(eax, isolate()->factory()->undefined_value()); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5008 FixedArray::kHeaderSize - kPointerSize)); | 5008 FixedArray::kHeaderSize - kPointerSize)); |
5009 __ bind(&done); | 5009 __ bind(&done); |
5010 } | 5010 } |
5011 | 5011 |
5012 | 5012 |
5013 #undef __ | 5013 #undef __ |
5014 | 5014 |
5015 } } // namespace v8::internal | 5015 } } // namespace v8::internal |
5016 | 5016 |
5017 #endif // V8_TARGET_ARCH_IA32 | 5017 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |