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 11512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11523 return "CompareStub_EQ"; | 11523 return "CompareStub_EQ"; |
11524 } | 11524 } |
11525 } | 11525 } |
11526 } | 11526 } |
11527 default: return "CompareStub"; | 11527 default: return "CompareStub"; |
11528 } | 11528 } |
11529 } | 11529 } |
11530 | 11530 |
11531 | 11531 |
11532 int CompareStub::MinorKey() { | 11532 int CompareStub::MinorKey() { |
11533 // Encode the three parameters in a unique 16 bit value. | 11533 // Encode the three parameters in a unique 16 bit value. To avoid duplicate |
| 11534 // stubs the never NaN NaN condition is only taken into account if the |
| 11535 // condition is equals. |
11534 ASSERT(static_cast<unsigned>(cc_) < (1 << 14)); | 11536 ASSERT(static_cast<unsigned>(cc_) < (1 << 14)); |
11535 int nnn_value = (never_nan_nan_ ? 2 : 0); | 11537 return ConditionField::encode(static_cast<unsigned>(cc_)) |
11536 if (cc_ != equal) nnn_value = 0; // Avoid duplicate stubs. | 11538 | StrictField::encode(strict_) |
11537 return (static_cast<unsigned>(cc_) << 2) | nnn_value | (strict_ ? 1 : 0); | 11539 | NeverNanNanField::encode(cc_ == equal ? never_nan_nan_ : false); |
11538 } | 11540 } |
11539 | 11541 |
11540 | 11542 |
11541 void StringAddStub::Generate(MacroAssembler* masm) { | 11543 void StringAddStub::Generate(MacroAssembler* masm) { |
11542 Label string_add_runtime; | 11544 Label string_add_runtime; |
11543 | 11545 |
11544 // Load the two arguments. | 11546 // Load the two arguments. |
11545 __ mov(eax, Operand(esp, 2 * kPointerSize)); // First argument. | 11547 __ mov(eax, Operand(esp, 2 * kPointerSize)); // First argument. |
11546 __ mov(edx, Operand(esp, 1 * kPointerSize)); // Second argument. | 11548 __ mov(edx, Operand(esp, 1 * kPointerSize)); // Second argument. |
11547 | 11549 |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12270 | 12272 |
12271 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 12273 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
12272 // tagged as a small integer. | 12274 // tagged as a small integer. |
12273 __ bind(&runtime); | 12275 __ bind(&runtime); |
12274 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 12276 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
12275 } | 12277 } |
12276 | 12278 |
12277 #undef __ | 12279 #undef __ |
12278 | 12280 |
12279 } } // namespace v8::internal | 12281 } } // namespace v8::internal |
OLD | NEW |