| 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 2336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2347 __ pop(left); | 2347 __ pop(left); |
| 2348 | 2348 |
| 2349 // Perform combined smi check on both operands. | 2349 // Perform combined smi check on both operands. |
| 2350 __ orr(scratch1, left, Operand(right)); | 2350 __ orr(scratch1, left, Operand(right)); |
| 2351 STATIC_ASSERT(kSmiTag == 0); | 2351 STATIC_ASSERT(kSmiTag == 0); |
| 2352 JumpPatchSite patch_site(masm_); | 2352 JumpPatchSite patch_site(masm_); |
| 2353 patch_site.EmitJumpIfSmi(scratch1, &smi_case); | 2353 patch_site.EmitJumpIfSmi(scratch1, &smi_case); |
| 2354 | 2354 |
| 2355 __ bind(&stub_call); | 2355 __ bind(&stub_call); |
| 2356 BinaryOpICStub stub(isolate(), op, mode); | 2356 BinaryOpICStub stub(isolate(), op, mode); |
| 2357 CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); | 2357 CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId()); |
| 2358 patch_site.EmitPatchInfo(); | 2358 patch_site.EmitPatchInfo(); |
| 2359 __ jmp(&done); | 2359 __ jmp(&done); |
| 2360 | 2360 |
| 2361 __ bind(&smi_case); | 2361 __ bind(&smi_case); |
| 2362 // Smi case. This code works the same way as the smi-smi case in the type | 2362 // Smi case. This code works the same way as the smi-smi case in the type |
| 2363 // recording binary operation stub, see | 2363 // recording binary operation stub, see |
| 2364 switch (op) { | 2364 switch (op) { |
| 2365 case Token::SAR: | 2365 case Token::SAR: |
| 2366 __ GetLeastBitsFromSmi(scratch1, right, 5); | 2366 __ GetLeastBitsFromSmi(scratch1, right, 5); |
| 2367 __ mov(right, Operand(left, ASR, scratch1)); | 2367 __ mov(right, Operand(left, ASR, scratch1)); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2424 context()->Plug(r0); | 2424 context()->Plug(r0); |
| 2425 } | 2425 } |
| 2426 | 2426 |
| 2427 | 2427 |
| 2428 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, | 2428 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, |
| 2429 Token::Value op, | 2429 Token::Value op, |
| 2430 OverwriteMode mode) { | 2430 OverwriteMode mode) { |
| 2431 __ pop(r1); | 2431 __ pop(r1); |
| 2432 BinaryOpICStub stub(isolate(), op, mode); | 2432 BinaryOpICStub stub(isolate(), op, mode); |
| 2433 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2433 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 2434 CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); | 2434 CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId()); |
| 2435 patch_site.EmitPatchInfo(); | 2435 patch_site.EmitPatchInfo(); |
| 2436 context()->Plug(r0); | 2436 context()->Plug(r0); |
| 2437 } | 2437 } |
| 2438 | 2438 |
| 2439 | 2439 |
| 2440 void FullCodeGenerator::EmitAssignment(Expression* expr) { | 2440 void FullCodeGenerator::EmitAssignment(Expression* expr) { |
| 2441 ASSERT(expr->IsValidReferenceExpression()); | 2441 ASSERT(expr->IsValidReferenceExpression()); |
| 2442 | 2442 |
| 2443 // Left-hand side can only be a property, a global or a (parameter or local) | 2443 // Left-hand side can only be a property, a global or a (parameter or local) |
| 2444 // slot. | 2444 // slot. |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2938 StoreFeedbackVectorSlot(expr->AllocationSiteFeedbackSlot(), | 2938 StoreFeedbackVectorSlot(expr->AllocationSiteFeedbackSlot(), |
| 2939 isolate()->factory()->NewAllocationSite()); | 2939 isolate()->factory()->NewAllocationSite()); |
| 2940 ASSERT(expr->AllocationSiteFeedbackSlot() == | 2940 ASSERT(expr->AllocationSiteFeedbackSlot() == |
| 2941 expr->CallNewFeedbackSlot() + 1); | 2941 expr->CallNewFeedbackSlot() + 1); |
| 2942 } | 2942 } |
| 2943 | 2943 |
| 2944 __ Move(r2, FeedbackVector()); | 2944 __ Move(r2, FeedbackVector()); |
| 2945 __ mov(r3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); | 2945 __ mov(r3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); |
| 2946 | 2946 |
| 2947 CallConstructStub stub(isolate(), RECORD_CALL_TARGET); | 2947 CallConstructStub stub(isolate(), RECORD_CALL_TARGET); |
| 2948 __ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); | 2948 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
| 2949 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 2949 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
| 2950 context()->Plug(r0); | 2950 context()->Plug(r0); |
| 2951 } | 2951 } |
| 2952 | 2952 |
| 2953 | 2953 |
| 2954 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 2954 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
| 2955 ZoneList<Expression*>* args = expr->arguments(); | 2955 ZoneList<Expression*>* args = expr->arguments(); |
| 2956 ASSERT(args->length() == 1); | 2956 ASSERT(args->length() == 1); |
| 2957 | 2957 |
| 2958 VisitForAccumulatorValue(args->at(0)); | 2958 VisitForAccumulatorValue(args->at(0)); |
| (...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4411 | 4411 |
| 4412 | 4412 |
| 4413 __ bind(&stub_call); | 4413 __ bind(&stub_call); |
| 4414 __ mov(r1, r0); | 4414 __ mov(r1, r0); |
| 4415 __ mov(r0, Operand(Smi::FromInt(count_value))); | 4415 __ mov(r0, Operand(Smi::FromInt(count_value))); |
| 4416 | 4416 |
| 4417 // Record position before stub call. | 4417 // Record position before stub call. |
| 4418 SetSourcePosition(expr->position()); | 4418 SetSourcePosition(expr->position()); |
| 4419 | 4419 |
| 4420 BinaryOpICStub stub(isolate(), Token::ADD, NO_OVERWRITE); | 4420 BinaryOpICStub stub(isolate(), Token::ADD, NO_OVERWRITE); |
| 4421 CallIC(stub.GetCode(isolate()), expr->CountBinOpFeedbackId()); | 4421 CallIC(stub.GetCode(), expr->CountBinOpFeedbackId()); |
| 4422 patch_site.EmitPatchInfo(); | 4422 patch_site.EmitPatchInfo(); |
| 4423 __ bind(&done); | 4423 __ bind(&done); |
| 4424 | 4424 |
| 4425 // Store the value returned in r0. | 4425 // Store the value returned in r0. |
| 4426 switch (assign_type) { | 4426 switch (assign_type) { |
| 4427 case VARIABLE: | 4427 case VARIABLE: |
| 4428 if (expr->is_postfix()) { | 4428 if (expr->is_postfix()) { |
| 4429 { EffectContext context(this); | 4429 { EffectContext context(this); |
| 4430 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 4430 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| 4431 Token::ASSIGN); | 4431 Token::ASSIGN); |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4936 | 4936 |
| 4937 ASSERT(interrupt_address == | 4937 ASSERT(interrupt_address == |
| 4938 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4938 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 4939 return OSR_AFTER_STACK_CHECK; | 4939 return OSR_AFTER_STACK_CHECK; |
| 4940 } | 4940 } |
| 4941 | 4941 |
| 4942 | 4942 |
| 4943 } } // namespace v8::internal | 4943 } } // namespace v8::internal |
| 4944 | 4944 |
| 4945 #endif // V8_TARGET_ARCH_ARM | 4945 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |