OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 FACTORY->fixed_array_map(), | 317 FACTORY->fixed_array_map(), |
318 not_fast_array, | 318 not_fast_array, |
319 DONT_DO_SMI_CHECK); | 319 DONT_DO_SMI_CHECK); |
320 } else { | 320 } else { |
321 __ AssertFastElements(scratch); | 321 __ AssertFastElements(scratch); |
322 } | 322 } |
323 // Check that the key (index) is within bounds. | 323 // Check that the key (index) is within bounds. |
324 __ cmp(key, FieldOperand(scratch, FixedArray::kLengthOffset)); | 324 __ cmp(key, FieldOperand(scratch, FixedArray::kLengthOffset)); |
325 __ j(above_equal, out_of_range); | 325 __ j(above_equal, out_of_range); |
326 // Fast case: Do the load. | 326 // Fast case: Do the load. |
327 ASSERT((kPointerSize == 4) && (kSmiTagSize == 1) && (kSmiTag == 0)); | 327 STATIC_ASSERT((kPointerSize == 4) && (kSmiTagSize == 1) && (kSmiTag == 0)); |
328 __ mov(scratch, FieldOperand(scratch, key, times_2, FixedArray::kHeaderSize)); | 328 __ mov(scratch, FieldOperand(scratch, key, times_2, FixedArray::kHeaderSize)); |
329 __ cmp(Operand(scratch), Immediate(FACTORY->the_hole_value())); | 329 __ cmp(Operand(scratch), Immediate(FACTORY->the_hole_value())); |
330 // In case the loaded value is the_hole we have to consult GetProperty | 330 // In case the loaded value is the_hole we have to consult GetProperty |
331 // to ensure the prototype chain is searched. | 331 // to ensure the prototype chain is searched. |
332 __ j(equal, out_of_range); | 332 __ j(equal, out_of_range); |
333 if (!result.is(scratch)) { | 333 if (!result.is(scratch)) { |
334 __ mov(result, scratch); | 334 __ mov(result, scratch); |
335 } | 335 } |
336 } | 336 } |
337 | 337 |
(...skipping 13 matching lines...) Expand all Loading... |
351 // hash - used to hold the hash of the key. | 351 // hash - used to hold the hash of the key. |
352 __ CmpObjectType(key, FIRST_NONSTRING_TYPE, map); | 352 __ CmpObjectType(key, FIRST_NONSTRING_TYPE, map); |
353 __ j(above_equal, not_symbol); | 353 __ j(above_equal, not_symbol); |
354 | 354 |
355 // Is the string an array index, with cached numeric value? | 355 // Is the string an array index, with cached numeric value? |
356 __ mov(hash, FieldOperand(key, String::kHashFieldOffset)); | 356 __ mov(hash, FieldOperand(key, String::kHashFieldOffset)); |
357 __ test(hash, Immediate(String::kContainsCachedArrayIndexMask)); | 357 __ test(hash, Immediate(String::kContainsCachedArrayIndexMask)); |
358 __ j(zero, index_string); | 358 __ j(zero, index_string); |
359 | 359 |
360 // Is the string a symbol? | 360 // Is the string a symbol? |
361 ASSERT(kSymbolTag != 0); | 361 STATIC_ASSERT(kSymbolTag != 0); |
362 __ test_b(FieldOperand(map, Map::kInstanceTypeOffset), kIsSymbolMask); | 362 __ test_b(FieldOperand(map, Map::kInstanceTypeOffset), kIsSymbolMask); |
363 __ j(zero, not_symbol); | 363 __ j(zero, not_symbol); |
364 } | 364 } |
365 | 365 |
366 | 366 |
367 static Operand GenerateMappedArgumentsLookup(MacroAssembler* masm, | 367 static Operand GenerateMappedArgumentsLookup(MacroAssembler* masm, |
368 Register object, | 368 Register object, |
369 Register key, | 369 Register key, |
370 Register scratch1, | 370 Register scratch1, |
371 Register scratch2, | 371 Register scratch2, |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 Condition cc = *jmp_address == Assembler::kJncShortOpcode | 1637 Condition cc = *jmp_address == Assembler::kJncShortOpcode |
1638 ? not_zero | 1638 ? not_zero |
1639 : zero; | 1639 : zero; |
1640 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1640 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1641 } | 1641 } |
1642 | 1642 |
1643 | 1643 |
1644 } } // namespace v8::internal | 1644 } } // namespace v8::internal |
1645 | 1645 |
1646 #endif // V8_TARGET_ARCH_IA32 | 1646 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |