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