OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 // Handle construction of an empty array. | 326 // Handle construction of an empty array. |
327 __ bind(&empty_array); | 327 __ bind(&empty_array); |
328 AllocateEmptyJSArray(masm, | 328 AllocateEmptyJSArray(masm, |
329 r1, | 329 r1, |
330 r2, | 330 r2, |
331 r3, | 331 r3, |
332 r4, | 332 r4, |
333 r5, | 333 r5, |
334 call_generic_code); | 334 call_generic_code); |
335 __ IncrementCounter(counters->array_function_native(), 1, r3, r4); | 335 __ IncrementCounter(counters->array_function_native(), 1, r3, r4); |
336 // Setup return value, remove receiver from stack and return. | 336 // Set up return value, remove receiver from stack and return. |
337 __ mov(r0, r2); | 337 __ mov(r0, r2); |
338 __ add(sp, sp, Operand(kPointerSize)); | 338 __ add(sp, sp, Operand(kPointerSize)); |
339 __ Jump(lr); | 339 __ Jump(lr); |
340 | 340 |
341 // Check for one argument. Bail out if argument is not smi or if it is | 341 // Check for one argument. Bail out if argument is not smi or if it is |
342 // negative. | 342 // negative. |
343 __ bind(&argc_one_or_more); | 343 __ bind(&argc_one_or_more); |
344 __ cmp(r0, Operand(1)); | 344 __ cmp(r0, Operand(1)); |
345 __ b(ne, &argc_two_or_more); | 345 __ b(ne, &argc_two_or_more); |
346 STATIC_ASSERT(kSmiTag == 0); | 346 STATIC_ASSERT(kSmiTag == 0); |
(...skipping 22 matching lines...) Expand all Loading... |
369 r1, | 369 r1, |
370 r2, | 370 r2, |
371 r3, | 371 r3, |
372 r4, | 372 r4, |
373 r5, | 373 r5, |
374 r6, | 374 r6, |
375 r7, | 375 r7, |
376 true, | 376 true, |
377 call_generic_code); | 377 call_generic_code); |
378 __ IncrementCounter(counters->array_function_native(), 1, r2, r4); | 378 __ IncrementCounter(counters->array_function_native(), 1, r2, r4); |
379 // Setup return value, remove receiver and argument from stack and return. | 379 // Set up return value, remove receiver and argument from stack and return. |
380 __ mov(r0, r3); | 380 __ mov(r0, r3); |
381 __ add(sp, sp, Operand(2 * kPointerSize)); | 381 __ add(sp, sp, Operand(2 * kPointerSize)); |
382 __ Jump(lr); | 382 __ Jump(lr); |
383 | 383 |
384 // Handle construction of an array from a list of arguments. | 384 // Handle construction of an array from a list of arguments. |
385 __ bind(&argc_two_or_more); | 385 __ bind(&argc_two_or_more); |
386 __ mov(r2, Operand(r0, LSL, kSmiTagSize)); // Convet argc to a smi. | 386 __ mov(r2, Operand(r0, LSL, kSmiTagSize)); // Convet argc to a smi. |
387 | 387 |
388 // r0: argc | 388 // r0: argc |
389 // r1: constructor | 389 // r1: constructor |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 | 944 |
945 // Reload the number of arguments from the stack. | 945 // Reload the number of arguments from the stack. |
946 // r1: constructor function | 946 // r1: constructor function |
947 // sp[0]: receiver | 947 // sp[0]: receiver |
948 // sp[1]: constructor function | 948 // sp[1]: constructor function |
949 // sp[2]: receiver | 949 // sp[2]: receiver |
950 // sp[3]: constructor function | 950 // sp[3]: constructor function |
951 // sp[4]: number of arguments (smi-tagged) | 951 // sp[4]: number of arguments (smi-tagged) |
952 __ ldr(r3, MemOperand(sp, 4 * kPointerSize)); | 952 __ ldr(r3, MemOperand(sp, 4 * kPointerSize)); |
953 | 953 |
954 // Setup pointer to last argument. | 954 // Set up pointer to last argument. |
955 __ add(r2, fp, Operand(StandardFrameConstants::kCallerSPOffset)); | 955 __ add(r2, fp, Operand(StandardFrameConstants::kCallerSPOffset)); |
956 | 956 |
957 // Setup number of arguments for function call below | 957 // Set up number of arguments for function call below |
958 __ mov(r0, Operand(r3, LSR, kSmiTagSize)); | 958 __ mov(r0, Operand(r3, LSR, kSmiTagSize)); |
959 | 959 |
960 // Copy arguments and receiver to the expression stack. | 960 // Copy arguments and receiver to the expression stack. |
961 // r0: number of arguments | 961 // r0: number of arguments |
962 // r2: address of last argument (caller sp) | 962 // r2: address of last argument (caller sp) |
963 // r1: constructor function | 963 // r1: constructor function |
964 // r3: number of arguments (smi-tagged) | 964 // r3: number of arguments (smi-tagged) |
965 // sp[0]: receiver | 965 // sp[0]: receiver |
966 // sp[1]: constructor function | 966 // sp[1]: constructor function |
967 // sp[2]: receiver | 967 // sp[2]: receiver |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 __ bind(&dont_adapt_arguments); | 1771 __ bind(&dont_adapt_arguments); |
1772 __ Jump(r3); | 1772 __ Jump(r3); |
1773 } | 1773 } |
1774 | 1774 |
1775 | 1775 |
1776 #undef __ | 1776 #undef __ |
1777 | 1777 |
1778 } } // namespace v8::internal | 1778 } } // namespace v8::internal |
1779 | 1779 |
1780 #endif // V8_TARGET_ARCH_ARM | 1780 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |