| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2006 Register right = x0; | 2006 Register right = x0; |
| 2007 Register result = x0; | 2007 Register result = x0; |
| 2008 __ Pop(left); | 2008 __ Pop(left); |
| 2009 | 2009 |
| 2010 // Perform combined smi check on both operands. | 2010 // Perform combined smi check on both operands. |
| 2011 __ Orr(x10, left, right); | 2011 __ Orr(x10, left, right); |
| 2012 JumpPatchSite patch_site(masm_); | 2012 JumpPatchSite patch_site(masm_); |
| 2013 patch_site.EmitJumpIfSmi(x10, &both_smis); | 2013 patch_site.EmitJumpIfSmi(x10, &both_smis); |
| 2014 | 2014 |
| 2015 __ Bind(&stub_call); | 2015 __ Bind(&stub_call); |
| 2016 BinaryOpStub stub(op, mode); | 2016 BinaryOpICStub stub(op, mode); |
| 2017 { | 2017 { |
| 2018 Assembler::BlockConstPoolScope scope(masm_); | 2018 Assembler::BlockConstPoolScope scope(masm_); |
| 2019 CallIC(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, | 2019 CallIC(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, |
| 2020 expr->BinaryOperationFeedbackId()); | 2020 expr->BinaryOperationFeedbackId()); |
| 2021 patch_site.EmitPatchInfo(); | 2021 patch_site.EmitPatchInfo(); |
| 2022 } | 2022 } |
| 2023 __ B(&done); | 2023 __ B(&done); |
| 2024 | 2024 |
| 2025 __ Bind(&both_smis); | 2025 __ Bind(&both_smis); |
| 2026 // Smi case. This code works in the same way as the smi-smi case in the type | 2026 // Smi case. This code works in the same way as the smi-smi case in the type |
| 2027 // recording binary operation stub, see | 2027 // recording binary operation stub, see |
| 2028 // BinaryOpStub::GenerateSmiSmiOperation for comments. | 2028 // BinaryOpStub::GenerateSmiSmiOperation for comments. |
| 2029 // TODO(all): That doesn't exist any more. Where are the comments? |
| 2029 // | 2030 // |
| 2030 // The set of operations that needs to be supported here is controlled by | 2031 // The set of operations that needs to be supported here is controlled by |
| 2031 // FullCodeGenerator::ShouldInlineSmiCase(). | 2032 // FullCodeGenerator::ShouldInlineSmiCase(). |
| 2032 switch (op) { | 2033 switch (op) { |
| 2033 case Token::SAR: | 2034 case Token::SAR: |
| 2034 __ Ubfx(right, right, kSmiShift, 5); | 2035 __ Ubfx(right, right, kSmiShift, 5); |
| 2035 __ Asr(result, left, right); | 2036 __ Asr(result, left, right); |
| 2036 __ Bic(result, result, kSmiShiftMask); | 2037 __ Bic(result, result, kSmiShiftMask); |
| 2037 break; | 2038 break; |
| 2038 case Token::SHL: | 2039 case Token::SHL: |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2091 | 2092 |
| 2092 __ Bind(&done); | 2093 __ Bind(&done); |
| 2093 context()->Plug(x0); | 2094 context()->Plug(x0); |
| 2094 } | 2095 } |
| 2095 | 2096 |
| 2096 | 2097 |
| 2097 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, | 2098 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, |
| 2098 Token::Value op, | 2099 Token::Value op, |
| 2099 OverwriteMode mode) { | 2100 OverwriteMode mode) { |
| 2100 __ Pop(x1); | 2101 __ Pop(x1); |
| 2101 BinaryOpStub stub(op, mode); | 2102 BinaryOpICStub stub(op, mode); |
| 2102 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code. | 2103 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code. |
| 2103 { | 2104 { |
| 2104 Assembler::BlockConstPoolScope scope(masm_); | 2105 Assembler::BlockConstPoolScope scope(masm_); |
| 2105 CallIC(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, | 2106 CallIC(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, |
| 2106 expr->BinaryOperationFeedbackId()); | 2107 expr->BinaryOperationFeedbackId()); |
| 2107 patch_site.EmitPatchInfo(); | 2108 patch_site.EmitPatchInfo(); |
| 2108 } | 2109 } |
| 2109 context()->Plug(x0); | 2110 context()->Plug(x0); |
| 2110 } | 2111 } |
| 2111 | 2112 |
| (...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3451 if (FLAG_new_string_add) { | 3452 if (FLAG_new_string_add) { |
| 3452 VisitForStackValue(args->at(0)); | 3453 VisitForStackValue(args->at(0)); |
| 3453 VisitForAccumulatorValue(args->at(1)); | 3454 VisitForAccumulatorValue(args->at(1)); |
| 3454 | 3455 |
| 3455 __ Pop(x1); | 3456 __ Pop(x1); |
| 3456 NewStringAddStub stub(STRING_ADD_CHECK_BOTH, NOT_TENURED); | 3457 NewStringAddStub stub(STRING_ADD_CHECK_BOTH, NOT_TENURED); |
| 3457 __ CallStub(&stub); | 3458 __ CallStub(&stub); |
| 3458 } else { | 3459 } else { |
| 3459 VisitForStackValue(args->at(0)); | 3460 VisitForStackValue(args->at(0)); |
| 3460 VisitForStackValue(args->at(1)); | 3461 VisitForStackValue(args->at(1)); |
| 3462 |
| 3463 StringAddStub stub(STRING_ADD_CHECK_BOTH); |
| 3464 __ CallStub(&stub); |
| 3461 } | 3465 } |
| 3462 | 3466 |
| 3463 StringAddStub stub(STRING_ADD_CHECK_BOTH); | |
| 3464 __ CallStub(&stub); | |
| 3465 context()->Plug(x0); | 3467 context()->Plug(x0); |
| 3466 } | 3468 } |
| 3467 | 3469 |
| 3468 | 3470 |
| 3469 void FullCodeGenerator::EmitStringCompare(CallRuntime* expr) { | 3471 void FullCodeGenerator::EmitStringCompare(CallRuntime* expr) { |
| 3470 ZoneList<Expression*>* args = expr->arguments(); | 3472 ZoneList<Expression*>* args = expr->arguments(); |
| 3471 ASSERT_EQ(2, args->length()); | 3473 ASSERT_EQ(2, args->length()); |
| 3472 VisitForStackValue(args->at(0)); | 3474 VisitForStackValue(args->at(0)); |
| 3473 VisitForStackValue(args->at(1)); | 3475 VisitForStackValue(args->at(1)); |
| 3474 | 3476 |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4162 | 4164 |
| 4163 __ Bind(&stub_call); | 4165 __ Bind(&stub_call); |
| 4164 __ Mov(x1, x0); | 4166 __ Mov(x1, x0); |
| 4165 __ Mov(x0, Operand(Smi::FromInt(count_value))); | 4167 __ Mov(x0, Operand(Smi::FromInt(count_value))); |
| 4166 | 4168 |
| 4167 // Record position before stub call. | 4169 // Record position before stub call. |
| 4168 SetSourcePosition(expr->position()); | 4170 SetSourcePosition(expr->position()); |
| 4169 | 4171 |
| 4170 { | 4172 { |
| 4171 Assembler::BlockConstPoolScope scope(masm_); | 4173 Assembler::BlockConstPoolScope scope(masm_); |
| 4172 BinaryOpStub stub(Token::ADD, NO_OVERWRITE); | 4174 BinaryOpICStub stub(Token::ADD, NO_OVERWRITE); |
| 4173 CallIC(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, | 4175 CallIC(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, |
| 4174 expr->CountBinOpFeedbackId()); | 4176 expr->CountBinOpFeedbackId()); |
| 4175 patch_site.EmitPatchInfo(); | 4177 patch_site.EmitPatchInfo(); |
| 4176 } | 4178 } |
| 4177 __ Bind(&done); | 4179 __ Bind(&done); |
| 4178 | 4180 |
| 4179 // Store the value returned in x0. | 4181 // Store the value returned in x0. |
| 4180 switch (assign_type) { | 4182 switch (assign_type) { |
| 4181 case VARIABLE: | 4183 case VARIABLE: |
| 4182 if (expr->is_postfix()) { | 4184 if (expr->is_postfix()) { |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5032 return previous_; | 5034 return previous_; |
| 5033 } | 5035 } |
| 5034 | 5036 |
| 5035 | 5037 |
| 5036 #undef __ | 5038 #undef __ |
| 5037 | 5039 |
| 5038 | 5040 |
| 5039 } } // namespace v8::internal | 5041 } } // namespace v8::internal |
| 5040 | 5042 |
| 5041 #endif // V8_TARGET_ARCH_A64 | 5043 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |