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 6283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6294 | 6294 |
6295 // Check that the key is a smi. | 6295 // Check that the key is a smi. |
6296 __ test(key.reg(), Immediate(kSmiTagMask)); | 6296 __ test(key.reg(), Immediate(kSmiTagMask)); |
6297 deferred->Branch(not_zero); | 6297 deferred->Branch(not_zero); |
6298 | 6298 |
6299 // Get the elements array from the receiver and check that it | 6299 // Get the elements array from the receiver and check that it |
6300 // is not a dictionary. | 6300 // is not a dictionary. |
6301 __ mov(elements.reg(), | 6301 __ mov(elements.reg(), |
6302 FieldOperand(receiver.reg(), JSObject::kElementsOffset)); | 6302 FieldOperand(receiver.reg(), JSObject::kElementsOffset)); |
6303 __ cmp(FieldOperand(elements.reg(), HeapObject::kMapOffset), | 6303 __ cmp(FieldOperand(elements.reg(), HeapObject::kMapOffset), |
6304 Immediate(Factory::hash_table_map())); | 6304 Immediate(Factory::fixed_array_map())); |
6305 deferred->Branch(equal); | 6305 deferred->Branch(not_equal); |
6306 | 6306 |
6307 // Shift the key to get the actual index value and check that | 6307 // Shift the key to get the actual index value and check that |
6308 // it is within bounds. | 6308 // it is within bounds. |
6309 __ mov(index.reg(), key.reg()); | 6309 __ mov(index.reg(), key.reg()); |
6310 __ sar(index.reg(), kSmiTagSize); | 6310 __ sar(index.reg(), kSmiTagSize); |
6311 __ cmp(index.reg(), | 6311 __ cmp(index.reg(), |
6312 FieldOperand(elements.reg(), Array::kLengthOffset)); | 6312 FieldOperand(elements.reg(), Array::kLengthOffset)); |
6313 deferred->Branch(above_equal); | 6313 deferred->Branch(above_equal); |
6314 | 6314 |
6315 // Load and check that the result is not the hole. We could | 6315 // Load and check that the result is not the hole. We could |
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7921 | 7921 |
7922 int CompareStub::MinorKey() { | 7922 int CompareStub::MinorKey() { |
7923 // Encode the two parameters in a unique 16 bit value. | 7923 // Encode the two parameters in a unique 16 bit value. |
7924 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); | 7924 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); |
7925 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); | 7925 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); |
7926 } | 7926 } |
7927 | 7927 |
7928 #undef __ | 7928 #undef __ |
7929 | 7929 |
7930 } } // namespace v8::internal | 7930 } } // namespace v8::internal |
OLD | NEW |