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