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 3356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3367 Operand array_length_operand = Operand(esp, 0); | 3367 Operand array_length_operand = Operand(esp, 0); |
3368 __ sub(Operand(esp), Immediate(2 * kPointerSize)); | 3368 __ sub(Operand(esp), Immediate(2 * kPointerSize)); |
3369 __ cld(); | 3369 __ cld(); |
3370 // Check that the array is a JSArray | 3370 // Check that the array is a JSArray |
3371 __ test(array, Immediate(kSmiTagMask)); | 3371 __ test(array, Immediate(kSmiTagMask)); |
3372 __ j(zero, &bailout); | 3372 __ j(zero, &bailout); |
3373 __ CmpObjectType(array, JS_ARRAY_TYPE, scratch); | 3373 __ CmpObjectType(array, JS_ARRAY_TYPE, scratch); |
3374 __ j(not_equal, &bailout); | 3374 __ j(not_equal, &bailout); |
3375 | 3375 |
3376 // Check that the array has fast elements. | 3376 // Check that the array has fast elements. |
3377 __ test_b(FieldOperand(scratch, Map::kBitField2Offset), | 3377 __ CheckFastElements(scratch, &bailout); |
3378 1 << Map::kHasFastElements); | |
3379 __ j(zero, &bailout); | |
3380 | 3378 |
3381 // If the array has length zero, return the empty string. | 3379 // If the array has length zero, return the empty string. |
3382 __ mov(array_length, FieldOperand(array, JSArray::kLengthOffset)); | 3380 __ mov(array_length, FieldOperand(array, JSArray::kLengthOffset)); |
3383 __ SmiUntag(array_length); | 3381 __ SmiUntag(array_length); |
3384 __ j(not_zero, &non_trivial_array); | 3382 __ j(not_zero, &non_trivial_array); |
3385 __ mov(result_operand, isolate()->factory()->empty_string()); | 3383 __ mov(result_operand, isolate()->factory()->empty_string()); |
3386 __ jmp(&done); | 3384 __ jmp(&done); |
3387 | 3385 |
3388 // Save the array length. | 3386 // Save the array length. |
3389 __ bind(&non_trivial_array); | 3387 __ bind(&non_trivial_array); |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4332 // And return. | 4330 // And return. |
4333 __ ret(0); | 4331 __ ret(0); |
4334 } | 4332 } |
4335 | 4333 |
4336 | 4334 |
4337 #undef __ | 4335 #undef __ |
4338 | 4336 |
4339 } } // namespace v8::internal | 4337 } } // namespace v8::internal |
4340 | 4338 |
4341 #endif // V8_TARGET_ARCH_IA32 | 4339 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |