OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 // Test if left operand is a string. | 1037 // Test if left operand is a string. |
1038 Label lhs_not_string; | 1038 Label lhs_not_string; |
1039 __ test(lhs, Immediate(kSmiTagMask)); | 1039 __ test(lhs, Immediate(kSmiTagMask)); |
1040 __ j(zero, &lhs_not_string); | 1040 __ j(zero, &lhs_not_string); |
1041 __ CmpObjectType(lhs, FIRST_NONSTRING_TYPE, ecx); | 1041 __ CmpObjectType(lhs, FIRST_NONSTRING_TYPE, ecx); |
1042 __ j(above_equal, &lhs_not_string); | 1042 __ j(above_equal, &lhs_not_string); |
1043 | 1043 |
1044 StringAddStub string_add_left_stub(NO_STRING_CHECK_LEFT_IN_STUB); | 1044 StringAddStub string_add_left_stub(NO_STRING_CHECK_LEFT_IN_STUB); |
1045 __ TailCallStub(&string_add_left_stub); | 1045 __ TailCallStub(&string_add_left_stub); |
1046 | 1046 |
| 1047 Label call_runtime_with_args; |
1047 // Left operand is not a string, test right. | 1048 // Left operand is not a string, test right. |
1048 __ bind(&lhs_not_string); | 1049 __ bind(&lhs_not_string); |
1049 __ test(rhs, Immediate(kSmiTagMask)); | 1050 __ test(rhs, Immediate(kSmiTagMask)); |
1050 __ j(zero, &call_runtime); | 1051 __ j(zero, &call_runtime_with_args); |
1051 __ CmpObjectType(rhs, FIRST_NONSTRING_TYPE, ecx); | 1052 __ CmpObjectType(rhs, FIRST_NONSTRING_TYPE, ecx); |
1052 __ j(above_equal, &call_runtime); | 1053 __ j(above_equal, &call_runtime_with_args); |
1053 | 1054 |
1054 StringAddStub string_add_right_stub(NO_STRING_CHECK_RIGHT_IN_STUB); | 1055 StringAddStub string_add_right_stub(NO_STRING_CHECK_RIGHT_IN_STUB); |
1055 __ TailCallStub(&string_add_right_stub); | 1056 __ TailCallStub(&string_add_right_stub); |
1056 | 1057 |
1057 // Neither argument is a string. | 1058 // Neither argument is a string. |
1058 __ bind(&call_runtime); | 1059 __ bind(&call_runtime); |
1059 if (HasArgsInRegisters()) { | 1060 if (HasArgsInRegisters()) { |
1060 GenerateRegisterArgsPush(masm); | 1061 GenerateRegisterArgsPush(masm); |
1061 } | 1062 } |
| 1063 __ bind(&call_runtime_with_args); |
1062 __ InvokeBuiltin(Builtins::ADD, JUMP_FUNCTION); | 1064 __ InvokeBuiltin(Builtins::ADD, JUMP_FUNCTION); |
1063 break; | 1065 break; |
1064 } | 1066 } |
1065 case Token::SUB: | 1067 case Token::SUB: |
1066 __ InvokeBuiltin(Builtins::SUB, JUMP_FUNCTION); | 1068 __ InvokeBuiltin(Builtins::SUB, JUMP_FUNCTION); |
1067 break; | 1069 break; |
1068 case Token::MUL: | 1070 case Token::MUL: |
1069 __ InvokeBuiltin(Builtins::MUL, JUMP_FUNCTION); | 1071 __ InvokeBuiltin(Builtins::MUL, JUMP_FUNCTION); |
1070 break; | 1072 break; |
1071 case Token::DIV: | 1073 case Token::DIV: |
(...skipping 3531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4603 // tagged as a small integer. | 4605 // tagged as a small integer. |
4604 __ bind(&runtime); | 4606 __ bind(&runtime); |
4605 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 4607 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
4606 } | 4608 } |
4607 | 4609 |
4608 #undef __ | 4610 #undef __ |
4609 | 4611 |
4610 } } // namespace v8::internal | 4612 } } // namespace v8::internal |
4611 | 4613 |
4612 #endif // V8_TARGET_ARCH_IA32 | 4614 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |