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 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2260 int delta = masm_->InstructionsGeneratedSince(map_check) + kAdditionalDelta; | 2260 int delta = masm_->InstructionsGeneratedSince(map_check) + kAdditionalDelta; |
2261 Label before_push_delta; | 2261 Label before_push_delta; |
2262 __ bind(&before_push_delta); | 2262 __ bind(&before_push_delta); |
2263 __ BlockConstPoolFor(kAdditionalDelta); | 2263 __ BlockConstPoolFor(kAdditionalDelta); |
2264 __ mov(temp, Operand(delta * kPointerSize)); | 2264 __ mov(temp, Operand(delta * kPointerSize)); |
2265 __ StoreToSafepointRegisterSlot(temp, temp); | 2265 __ StoreToSafepointRegisterSlot(temp, temp); |
2266 CallCodeGeneric(stub.GetCode(), | 2266 CallCodeGeneric(stub.GetCode(), |
2267 RelocInfo::CODE_TARGET, | 2267 RelocInfo::CODE_TARGET, |
2268 instr, | 2268 instr, |
2269 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); | 2269 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); |
2270 ASSERT(instr->HasDeoptimizationEnvironment()); | 2270 LEnvironment* env = instr->GetDeferredLazyDeoptimizationEnvironment(); |
2271 LEnvironment* env = instr->deoptimization_environment(); | |
2272 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 2271 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
2273 // Put the result value into the result register slot and | 2272 // Put the result value into the result register slot and |
2274 // restore all registers. | 2273 // restore all registers. |
2275 __ StoreToSafepointRegisterSlot(result, result); | 2274 __ StoreToSafepointRegisterSlot(result, result); |
2276 } | 2275 } |
2277 | 2276 |
2278 | 2277 |
2279 void LCodeGen::DoCmpT(LCmpT* instr) { | 2278 void LCodeGen::DoCmpT(LCmpT* instr) { |
2280 Token::Value op = instr->op(); | 2279 Token::Value op = instr->op(); |
2281 | 2280 |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2879 // length is a small non-negative integer, due to the test above. | 2878 // length is a small non-negative integer, due to the test above. |
2880 __ cmp(length, Operand(0)); | 2879 __ cmp(length, Operand(0)); |
2881 __ b(eq, &invoke); | 2880 __ b(eq, &invoke); |
2882 __ bind(&loop); | 2881 __ bind(&loop); |
2883 __ ldr(scratch, MemOperand(elements, length, LSL, 2)); | 2882 __ ldr(scratch, MemOperand(elements, length, LSL, 2)); |
2884 __ push(scratch); | 2883 __ push(scratch); |
2885 __ sub(length, length, Operand(1), SetCC); | 2884 __ sub(length, length, Operand(1), SetCC); |
2886 __ b(ne, &loop); | 2885 __ b(ne, &loop); |
2887 | 2886 |
2888 __ bind(&invoke); | 2887 __ bind(&invoke); |
2889 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); | 2888 ASSERT(instr->HasPointerMap()); |
2890 LPointerMap* pointers = instr->pointer_map(); | 2889 LPointerMap* pointers = instr->pointer_map(); |
2891 RecordPosition(pointers->position()); | 2890 RecordPosition(pointers->position()); |
2892 SafepointGenerator safepoint_generator( | 2891 SafepointGenerator safepoint_generator( |
2893 this, pointers, Safepoint::kLazyDeopt); | 2892 this, pointers, Safepoint::kLazyDeopt); |
2894 // The number of arguments is stored in receiver which is r0, as expected | 2893 // The number of arguments is stored in receiver which is r0, as expected |
2895 // by InvokeFunction. | 2894 // by InvokeFunction. |
2896 ParameterCount actual(receiver); | 2895 ParameterCount actual(receiver); |
2897 __ InvokeFunction(function, actual, CALL_FUNCTION, | 2896 __ InvokeFunction(function, actual, CALL_FUNCTION, |
2898 safepoint_generator, CALL_AS_METHOD); | 2897 safepoint_generator, CALL_AS_METHOD); |
2899 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2898 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3426 default: | 3425 default: |
3427 Abort("Unimplemented type of LUnaryMathOperation."); | 3426 Abort("Unimplemented type of LUnaryMathOperation."); |
3428 UNREACHABLE(); | 3427 UNREACHABLE(); |
3429 } | 3428 } |
3430 } | 3429 } |
3431 | 3430 |
3432 | 3431 |
3433 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { | 3432 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
3434 ASSERT(ToRegister(instr->function()).is(r1)); | 3433 ASSERT(ToRegister(instr->function()).is(r1)); |
3435 ASSERT(instr->HasPointerMap()); | 3434 ASSERT(instr->HasPointerMap()); |
3436 ASSERT(instr->HasDeoptimizationEnvironment()); | |
3437 LPointerMap* pointers = instr->pointer_map(); | 3435 LPointerMap* pointers = instr->pointer_map(); |
3438 RecordPosition(pointers->position()); | 3436 RecordPosition(pointers->position()); |
3439 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); | 3437 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); |
3440 ParameterCount count(instr->arity()); | 3438 ParameterCount count(instr->arity()); |
3441 __ InvokeFunction(r1, count, CALL_FUNCTION, generator, CALL_AS_METHOD); | 3439 __ InvokeFunction(r1, count, CALL_FUNCTION, generator, CALL_AS_METHOD); |
3442 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 3440 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
3443 } | 3441 } |
3444 | 3442 |
3445 | 3443 |
3446 void LCodeGen::DoCallKeyed(LCallKeyed* instr) { | 3444 void LCodeGen::DoCallKeyed(LCallKeyed* instr) { |
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4974 DeoptimizeIf(al, instr->environment()); | 4972 DeoptimizeIf(al, instr->environment()); |
4975 } | 4973 } |
4976 | 4974 |
4977 | 4975 |
4978 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { | 4976 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { |
4979 Register object = ToRegister(instr->object()); | 4977 Register object = ToRegister(instr->object()); |
4980 Register key = ToRegister(instr->key()); | 4978 Register key = ToRegister(instr->key()); |
4981 Register strict = scratch0(); | 4979 Register strict = scratch0(); |
4982 __ mov(strict, Operand(Smi::FromInt(strict_mode_flag()))); | 4980 __ mov(strict, Operand(Smi::FromInt(strict_mode_flag()))); |
4983 __ Push(object, key, strict); | 4981 __ Push(object, key, strict); |
4984 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); | 4982 ASSERT(instr->HasPointerMap()); |
4985 LPointerMap* pointers = instr->pointer_map(); | 4983 LPointerMap* pointers = instr->pointer_map(); |
4986 RecordPosition(pointers->position()); | 4984 RecordPosition(pointers->position()); |
4987 SafepointGenerator safepoint_generator( | 4985 SafepointGenerator safepoint_generator( |
4988 this, pointers, Safepoint::kLazyDeopt); | 4986 this, pointers, Safepoint::kLazyDeopt); |
4989 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator); | 4987 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator); |
4990 } | 4988 } |
4991 | 4989 |
4992 | 4990 |
4993 void LCodeGen::DoIn(LIn* instr) { | 4991 void LCodeGen::DoIn(LIn* instr) { |
4994 Register obj = ToRegister(instr->object()); | 4992 Register obj = ToRegister(instr->object()); |
4995 Register key = ToRegister(instr->key()); | 4993 Register key = ToRegister(instr->key()); |
4996 __ Push(key, obj); | 4994 __ Push(key, obj); |
4997 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); | 4995 ASSERT(instr->HasPointerMap()); |
4998 LPointerMap* pointers = instr->pointer_map(); | 4996 LPointerMap* pointers = instr->pointer_map(); |
4999 RecordPosition(pointers->position()); | 4997 RecordPosition(pointers->position()); |
5000 SafepointGenerator safepoint_generator(this, pointers, Safepoint::kLazyDeopt); | 4998 SafepointGenerator safepoint_generator(this, pointers, Safepoint::kLazyDeopt); |
5001 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4999 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
5002 } | 5000 } |
5003 | 5001 |
5004 | 5002 |
5005 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { | 5003 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { |
5006 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); | 5004 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); |
5007 __ CallRuntimeSaveDoubles(Runtime::kStackGuard); | 5005 __ CallRuntimeSaveDoubles(Runtime::kStackGuard); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5156 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5154 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
5157 __ ldr(result, FieldMemOperand(scratch, | 5155 __ ldr(result, FieldMemOperand(scratch, |
5158 FixedArray::kHeaderSize - kPointerSize)); | 5156 FixedArray::kHeaderSize - kPointerSize)); |
5159 __ bind(&done); | 5157 __ bind(&done); |
5160 } | 5158 } |
5161 | 5159 |
5162 | 5160 |
5163 #undef __ | 5161 #undef __ |
5164 | 5162 |
5165 } } // namespace v8::internal | 5163 } } // namespace v8::internal |
OLD | NEW |