| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 6 | 6 |
| 7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 __ push(r2); | 359 __ push(r2); |
| 360 __ SmiTag(r0); | 360 __ SmiTag(r0); |
| 361 __ push(r0); | 361 __ push(r0); |
| 362 __ push(r1); | 362 __ push(r1); |
| 363 __ push(r3); | 363 __ push(r3); |
| 364 | 364 |
| 365 // Try to allocate the object without transitioning into C code. If any of | 365 // Try to allocate the object without transitioning into C code. If any of |
| 366 // the preconditions is not met, the code bails out to the runtime call. | 366 // the preconditions is not met, the code bails out to the runtime call. |
| 367 Label rt_call, allocated; | 367 Label rt_call, allocated; |
| 368 if (FLAG_inline_new) { | 368 if (FLAG_inline_new) { |
| 369 ExternalReference debug_step_in_fp = | |
| 370 ExternalReference::debug_step_in_fp_address(isolate); | |
| 371 __ mov(r2, Operand(debug_step_in_fp)); | |
| 372 __ ldr(r2, MemOperand(r2)); | |
| 373 __ tst(r2, r2); | |
| 374 __ b(ne, &rt_call); | |
| 375 | |
| 376 // Verify that the new target is a JSFunction. | 369 // Verify that the new target is a JSFunction. |
| 377 __ CompareObjectType(r3, r5, r4, JS_FUNCTION_TYPE); | 370 __ CompareObjectType(r3, r5, r4, JS_FUNCTION_TYPE); |
| 378 __ b(ne, &rt_call); | 371 __ b(ne, &rt_call); |
| 379 | 372 |
| 380 // Load the initial map and verify that it is in fact a map. | 373 // Load the initial map and verify that it is in fact a map. |
| 381 // r3: new target | 374 // r3: new target |
| 382 __ ldr(r2, FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset)); | 375 __ ldr(r2, FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset)); |
| 383 __ JumpIfSmi(r2, &rt_call); | 376 __ JumpIfSmi(r2, &rt_call); |
| 384 __ CompareObjectType(r2, r5, r4, MAP_TYPE); | 377 __ CompareObjectType(r2, r5, r4, MAP_TYPE); |
| 385 __ b(ne, &rt_call); | 378 __ b(ne, &rt_call); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 // sp[2]: number of arguments (smi-tagged) | 663 // sp[2]: number of arguments (smi-tagged) |
| 671 Label loop, entry; | 664 Label loop, entry; |
| 672 __ b(&entry); | 665 __ b(&entry); |
| 673 __ bind(&loop); | 666 __ bind(&loop); |
| 674 __ ldr(ip, MemOperand(r2, r4, LSL, kPointerSizeLog2 - 1)); | 667 __ ldr(ip, MemOperand(r2, r4, LSL, kPointerSizeLog2 - 1)); |
| 675 __ push(ip); | 668 __ push(ip); |
| 676 __ bind(&entry); | 669 __ bind(&entry); |
| 677 __ sub(r4, r4, Operand(2), SetCC); | 670 __ sub(r4, r4, Operand(2), SetCC); |
| 678 __ b(ge, &loop); | 671 __ b(ge, &loop); |
| 679 | 672 |
| 680 // Handle step in. | |
| 681 Label skip_step_in; | |
| 682 ExternalReference debug_step_in_fp = | |
| 683 ExternalReference::debug_step_in_fp_address(masm->isolate()); | |
| 684 __ mov(r2, Operand(debug_step_in_fp)); | |
| 685 __ ldr(r2, MemOperand(r2)); | |
| 686 __ tst(r2, r2); | |
| 687 __ b(eq, &skip_step_in); | |
| 688 | |
| 689 __ Push(r0); | |
| 690 __ Push(r1); | |
| 691 __ Push(r1); | |
| 692 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1); | |
| 693 __ Pop(r1); | |
| 694 __ Pop(r0); | |
| 695 | |
| 696 __ bind(&skip_step_in); | |
| 697 | |
| 698 // Call the function. | 673 // Call the function. |
| 699 // r0: number of arguments | 674 // r0: number of arguments |
| 700 // r1: constructor function | 675 // r1: constructor function |
| 701 ParameterCount actual(r0); | 676 ParameterCount actual(r0); |
| 702 __ InvokeFunction(r1, actual, CALL_FUNCTION, NullCallWrapper()); | 677 __ InvokeFunction(r1, actual, CALL_FUNCTION, NullCallWrapper()); |
| 703 | 678 |
| 704 // Restore context from the frame. | 679 // Restore context from the frame. |
| 705 // r0: result | 680 // r0: result |
| 706 // sp[0]: number of arguments (smi-tagged) | 681 // sp[0]: number of arguments (smi-tagged) |
| 707 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 682 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| (...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1927 } | 1902 } |
| 1928 } | 1903 } |
| 1929 | 1904 |
| 1930 | 1905 |
| 1931 #undef __ | 1906 #undef __ |
| 1932 | 1907 |
| 1933 } // namespace internal | 1908 } // namespace internal |
| 1934 } // namespace v8 | 1909 } // namespace v8 |
| 1935 | 1910 |
| 1936 #endif // V8_TARGET_ARCH_ARM | 1911 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |