OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 5080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5091 __ bind(&check_for_symbols); | 5091 __ bind(&check_for_symbols); |
5092 // In the strict case the EmitStrictTwoHeapObjectCompare already took care of | 5092 // In the strict case the EmitStrictTwoHeapObjectCompare already took care of |
5093 // symbols. | 5093 // symbols. |
5094 if (cc_ == eq && !strict_) { | 5094 if (cc_ == eq && !strict_) { |
5095 // Either jumps to slow or returns the answer. Assumes that r2 is the type | 5095 // Either jumps to slow or returns the answer. Assumes that r2 is the type |
5096 // of r0 on entry. | 5096 // of r0 on entry. |
5097 EmitCheckForSymbols(masm, &slow); | 5097 EmitCheckForSymbols(masm, &slow); |
5098 } | 5098 } |
5099 | 5099 |
5100 __ bind(&slow); | 5100 __ bind(&slow); |
5101 __ push(lr); | |
5102 __ push(r1); | 5101 __ push(r1); |
5103 __ push(r0); | 5102 __ push(r0); |
5104 // Figure out which native to call and setup the arguments. | 5103 // Figure out which native to call and setup the arguments. |
5105 Builtins::JavaScript native; | 5104 Builtins::JavaScript native; |
5106 int arg_count = 1; // Not counting receiver. | |
5107 if (cc_ == eq) { | 5105 if (cc_ == eq) { |
5108 native = strict_ ? Builtins::STRICT_EQUALS : Builtins::EQUALS; | 5106 native = strict_ ? Builtins::STRICT_EQUALS : Builtins::EQUALS; |
5109 } else { | 5107 } else { |
5110 native = Builtins::COMPARE; | 5108 native = Builtins::COMPARE; |
5111 int ncr; // NaN compare result | 5109 int ncr; // NaN compare result |
5112 if (cc_ == lt || cc_ == le) { | 5110 if (cc_ == lt || cc_ == le) { |
5113 ncr = GREATER; | 5111 ncr = GREATER; |
5114 } else { | 5112 } else { |
5115 ASSERT(cc_ == gt || cc_ == ge); // remaining cases | 5113 ASSERT(cc_ == gt || cc_ == ge); // remaining cases |
5116 ncr = LESS; | 5114 ncr = LESS; |
5117 } | 5115 } |
5118 arg_count++; | |
5119 __ mov(r0, Operand(Smi::FromInt(ncr))); | 5116 __ mov(r0, Operand(Smi::FromInt(ncr))); |
5120 __ push(r0); | 5117 __ push(r0); |
5121 } | 5118 } |
5122 | 5119 |
5123 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) | 5120 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) |
5124 // tagged as a small integer. | 5121 // tagged as a small integer. |
5125 __ InvokeBuiltin(native, CALL_JS); | 5122 __ InvokeBuiltin(native, JUMP_JS); |
5126 __ cmp(r0, Operand(0)); | |
5127 __ pop(pc); | |
5128 } | 5123 } |
5129 | 5124 |
5130 | 5125 |
5131 // Allocates a heap number or jumps to the label if the young space is full and | 5126 // Allocates a heap number or jumps to the label if the young space is full and |
5132 // a scavenge is needed. | 5127 // a scavenge is needed. |
5133 static void AllocateHeapNumber( | 5128 static void AllocateHeapNumber( |
5134 MacroAssembler* masm, | 5129 MacroAssembler* masm, |
5135 Label* need_gc, // Jump here if young space is full. | 5130 Label* need_gc, // Jump here if young space is full. |
5136 Register result, // The tagged address of the new heap number. | 5131 Register result, // The tagged address of the new heap number. |
5137 Register scratch1, // A scratch register. | 5132 Register scratch1, // A scratch register. |
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6622 ASSERT((static_cast<unsigned>(cc_) >> 26) < (1 << 16)); | 6617 ASSERT((static_cast<unsigned>(cc_) >> 26) < (1 << 16)); |
6623 int nnn_value = (never_nan_nan_ ? 2 : 0); | 6618 int nnn_value = (never_nan_nan_ ? 2 : 0); |
6624 if (cc_ != eq) nnn_value = 0; // Avoid duplicate stubs. | 6619 if (cc_ != eq) nnn_value = 0; // Avoid duplicate stubs. |
6625 return (static_cast<unsigned>(cc_) >> 26) | nnn_value | (strict_ ? 1 : 0); | 6620 return (static_cast<unsigned>(cc_) >> 26) | nnn_value | (strict_ ? 1 : 0); |
6626 } | 6621 } |
6627 | 6622 |
6628 | 6623 |
6629 #undef __ | 6624 #undef __ |
6630 | 6625 |
6631 } } // namespace v8::internal | 6626 } } // namespace v8::internal |
OLD | NEW |