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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 366 |
367 // Preserve the incoming parameters on the stack. | 367 // Preserve the incoming parameters on the stack. |
368 __ AssertUndefinedOrAllocationSite(a2, t0); | 368 __ AssertUndefinedOrAllocationSite(a2, t0); |
369 __ SmiTag(a0); | 369 __ SmiTag(a0); |
370 __ Push(a2, a0, a1, a3); | 370 __ Push(a2, a0, a1, a3); |
371 | 371 |
372 // Try to allocate the object without transitioning into C code. If any of | 372 // Try to allocate the object without transitioning into C code. If any of |
373 // the preconditions is not met, the code bails out to the runtime call. | 373 // the preconditions is not met, the code bails out to the runtime call. |
374 Label rt_call, allocated; | 374 Label rt_call, allocated; |
375 if (FLAG_inline_new) { | 375 if (FLAG_inline_new) { |
376 ExternalReference debug_step_in_fp = | |
377 ExternalReference::debug_step_in_fp_address(isolate); | |
378 __ li(a2, Operand(debug_step_in_fp)); | |
379 __ ld(a2, MemOperand(a2)); | |
380 __ Branch(&rt_call, ne, a2, Operand(zero_reg)); | |
381 | |
382 // Verify that the new target is a JSFunction. | 376 // Verify that the new target is a JSFunction. |
383 __ GetObjectType(a3, a5, a4); | 377 __ GetObjectType(a3, a5, a4); |
384 __ Branch(&rt_call, ne, a4, Operand(JS_FUNCTION_TYPE)); | 378 __ Branch(&rt_call, ne, a4, Operand(JS_FUNCTION_TYPE)); |
385 | 379 |
386 // Load the initial map and verify that it is in fact a map. | 380 // Load the initial map and verify that it is in fact a map. |
387 // a3: new target | 381 // a3: new target |
388 __ ld(a2, FieldMemOperand(a3, JSFunction::kPrototypeOrInitialMapOffset)); | 382 __ ld(a2, FieldMemOperand(a3, JSFunction::kPrototypeOrInitialMapOffset)); |
389 __ JumpIfSmi(a2, &rt_call); | 383 __ JumpIfSmi(a2, &rt_call); |
390 __ GetObjectType(a2, t1, t0); | 384 __ GetObjectType(a2, t1, t0); |
391 __ Branch(&rt_call, ne, t0, Operand(MAP_TYPE)); | 385 __ Branch(&rt_call, ne, t0, Operand(MAP_TYPE)); |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 __ jmp(&entry); | 666 __ jmp(&entry); |
673 __ bind(&loop); | 667 __ bind(&loop); |
674 __ dsll(at, a4, kPointerSizeLog2); | 668 __ dsll(at, a4, kPointerSizeLog2); |
675 __ Daddu(at, a2, Operand(at)); | 669 __ Daddu(at, a2, Operand(at)); |
676 __ ld(at, MemOperand(at)); | 670 __ ld(at, MemOperand(at)); |
677 __ push(at); | 671 __ push(at); |
678 __ bind(&entry); | 672 __ bind(&entry); |
679 __ Daddu(a4, a4, Operand(-1)); | 673 __ Daddu(a4, a4, Operand(-1)); |
680 __ Branch(&loop, ge, a4, Operand(zero_reg)); | 674 __ Branch(&loop, ge, a4, Operand(zero_reg)); |
681 | 675 |
682 // Handle step in. | |
683 Label skip_step_in; | |
684 ExternalReference debug_step_in_fp = | |
685 ExternalReference::debug_step_in_fp_address(masm->isolate()); | |
686 __ li(a2, Operand(debug_step_in_fp)); | |
687 __ ld(a2, MemOperand(a2)); | |
688 __ Branch(&skip_step_in, eq, a2, Operand(zero_reg)); | |
689 | |
690 __ Push(a0, a1, a1); | |
691 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1); | |
692 __ Pop(a0, a1); | |
693 | |
694 __ bind(&skip_step_in); | |
695 | |
696 | |
697 // Call the function. | 676 // Call the function. |
698 // a0: number of arguments | 677 // a0: number of arguments |
699 // a1: constructor function | 678 // a1: constructor function |
700 ParameterCount actual(a0); | 679 ParameterCount actual(a0); |
701 __ InvokeFunction(a1, actual, CALL_FUNCTION, NullCallWrapper()); | 680 __ InvokeFunction(a1, actual, CALL_FUNCTION, NullCallWrapper()); |
702 | 681 |
703 // Restore context from the frame. | 682 // Restore context from the frame. |
704 // v0: result | 683 // v0: result |
705 // sp[0]: new.target | 684 // sp[0]: new.target |
706 // sp[1]: number of arguments (smi-tagged) | 685 // sp[1]: number of arguments (smi-tagged) |
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1949 } | 1928 } |
1950 } | 1929 } |
1951 | 1930 |
1952 | 1931 |
1953 #undef __ | 1932 #undef __ |
1954 | 1933 |
1955 } // namespace internal | 1934 } // namespace internal |
1956 } // namespace v8 | 1935 } // namespace v8 |
1957 | 1936 |
1958 #endif // V8_TARGET_ARCH_MIPS64 | 1937 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |