| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 Label* gc_required) { | 183 Label* gc_required) { |
| 184 Label not_empty, allocated; | 184 Label not_empty, allocated; |
| 185 | 185 |
| 186 // Load the initial map from the array function. | 186 // Load the initial map from the array function. |
| 187 __ ldr(elements_array_storage, | 187 __ ldr(elements_array_storage, |
| 188 FieldMemOperand(array_function, | 188 FieldMemOperand(array_function, |
| 189 JSFunction::kPrototypeOrInitialMapOffset)); | 189 JSFunction::kPrototypeOrInitialMapOffset)); |
| 190 | 190 |
| 191 // Check whether an empty sized array is requested. | 191 // Check whether an empty sized array is requested. |
| 192 __ tst(array_size, array_size); | 192 __ tst(array_size, array_size); |
| 193 __ b(nz, ¬_empty); | 193 __ b(ne, ¬_empty); |
| 194 | 194 |
| 195 // If an empty array is requested allocate a small elements array anyway. This | 195 // If an empty array is requested allocate a small elements array anyway. This |
| 196 // keeps the code below free of special casing for the empty array. | 196 // keeps the code below free of special casing for the empty array. |
| 197 int size = JSArray::kSize + | 197 int size = JSArray::kSize + |
| 198 FixedArray::SizeFor(JSArray::kPreallocatedArrayElements); | 198 FixedArray::SizeFor(JSArray::kPreallocatedArrayElements); |
| 199 __ AllocateInNewSpace(size, | 199 __ AllocateInNewSpace(size, |
| 200 result, | 200 result, |
| 201 elements_array_end, | 201 elements_array_end, |
| 202 scratch1, | 202 scratch1, |
| 203 gc_required, | 203 gc_required, |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 | 561 |
| 562 // Ensure the object is fully initialized. | 562 // Ensure the object is fully initialized. |
| 563 STATIC_ASSERT(JSValue::kSize == 4 * kPointerSize); | 563 STATIC_ASSERT(JSValue::kSize == 4 * kPointerSize); |
| 564 | 564 |
| 565 __ Ret(); | 565 __ Ret(); |
| 566 | 566 |
| 567 // The argument was not found in the number to string cache. Check | 567 // The argument was not found in the number to string cache. Check |
| 568 // if it's a string already before calling the conversion builtin. | 568 // if it's a string already before calling the conversion builtin. |
| 569 Label convert_argument; | 569 Label convert_argument; |
| 570 __ bind(¬_cached); | 570 __ bind(¬_cached); |
| 571 __ BranchOnSmi(r0, &convert_argument); | 571 __ JumpIfSmi(r0, &convert_argument); |
| 572 | 572 |
| 573 // Is it a String? | 573 // Is it a String? |
| 574 __ ldr(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); | 574 __ ldr(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); |
| 575 __ ldrb(r3, FieldMemOperand(r2, Map::kInstanceTypeOffset)); | 575 __ ldrb(r3, FieldMemOperand(r2, Map::kInstanceTypeOffset)); |
| 576 ASSERT(kNotStringTag != 0); | 576 ASSERT(kNotStringTag != 0); |
| 577 __ tst(r3, Operand(kIsNotStringMask)); | 577 __ tst(r3, Operand(kIsNotStringMask)); |
| 578 __ b(ne, &convert_argument); | 578 __ b(ne, &convert_argument); |
| 579 __ mov(argument, r0); | 579 __ mov(argument, r0); |
| 580 __ IncrementCounter(COUNTERS->string_ctor_conversions(), 1, r3, r4); | 580 __ IncrementCounter(COUNTERS->string_ctor_conversions(), 1, r3, r4); |
| 581 __ b(&argument_is_string); | 581 __ b(&argument_is_string); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 // preconditions is not met, the code bails out to the runtime call. | 661 // preconditions is not met, the code bails out to the runtime call. |
| 662 Label rt_call, allocated; | 662 Label rt_call, allocated; |
| 663 if (FLAG_inline_new) { | 663 if (FLAG_inline_new) { |
| 664 Label undo_allocation; | 664 Label undo_allocation; |
| 665 #ifdef ENABLE_DEBUGGER_SUPPORT | 665 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 666 ExternalReference debug_step_in_fp = | 666 ExternalReference debug_step_in_fp = |
| 667 ExternalReference::debug_step_in_fp_address(); | 667 ExternalReference::debug_step_in_fp_address(); |
| 668 __ mov(r2, Operand(debug_step_in_fp)); | 668 __ mov(r2, Operand(debug_step_in_fp)); |
| 669 __ ldr(r2, MemOperand(r2)); | 669 __ ldr(r2, MemOperand(r2)); |
| 670 __ tst(r2, r2); | 670 __ tst(r2, r2); |
| 671 __ b(nz, &rt_call); | 671 __ b(ne, &rt_call); |
| 672 #endif | 672 #endif |
| 673 | 673 |
| 674 // Load the initial map and verify that it is in fact a map. | 674 // Load the initial map and verify that it is in fact a map. |
| 675 // r1: constructor function | 675 // r1: constructor function |
| 676 __ ldr(r2, FieldMemOperand(r1, JSFunction::kPrototypeOrInitialMapOffset)); | 676 __ ldr(r2, FieldMemOperand(r1, JSFunction::kPrototypeOrInitialMapOffset)); |
| 677 __ tst(r2, Operand(kSmiTagMask)); | 677 __ tst(r2, Operand(kSmiTagMask)); |
| 678 __ b(eq, &rt_call); | 678 __ b(eq, &rt_call); |
| 679 __ CompareObjectType(r2, r3, r4, MAP_TYPE); | 679 __ CompareObjectType(r2, r3, r4, MAP_TYPE); |
| 680 __ b(ne, &rt_call); | 680 __ b(ne, &rt_call); |
| 681 | 681 |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1568 __ bind(&dont_adapt_arguments); | 1568 __ bind(&dont_adapt_arguments); |
| 1569 __ Jump(r3); | 1569 __ Jump(r3); |
| 1570 } | 1570 } |
| 1571 | 1571 |
| 1572 | 1572 |
| 1573 #undef __ | 1573 #undef __ |
| 1574 | 1574 |
| 1575 } } // namespace v8::internal | 1575 } } // namespace v8::internal |
| 1576 | 1576 |
| 1577 #endif // V8_TARGET_ARCH_ARM | 1577 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |