OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 | 868 |
869 // Jump to the generic construct code in case the specialized code cannot | 869 // Jump to the generic construct code in case the specialized code cannot |
870 // handle the construction. | 870 // handle the construction. |
871 __ bind(&generic_constructor); | 871 __ bind(&generic_constructor); |
872 Code* code = Builtins::builtin(Builtins::JSConstructStubGeneric); | 872 Code* code = Builtins::builtin(Builtins::JSConstructStubGeneric); |
873 Handle<Code> generic_construct_stub(code); | 873 Handle<Code> generic_construct_stub(code); |
874 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 874 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
875 } | 875 } |
876 | 876 |
877 | 877 |
| 878 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) { |
| 879 // TODO(bug): implement custom construct stub. |
| 880 // Generate a copy of the generic stub for now. |
| 881 Generate_JSConstructStubGeneric(masm); |
| 882 } |
| 883 |
| 884 |
878 void Builtins::Generate_JSConstructCall(MacroAssembler* masm) { | 885 void Builtins::Generate_JSConstructCall(MacroAssembler* masm) { |
879 // ----------- S t a t e ------------- | 886 // ----------- S t a t e ------------- |
880 // -- rax: number of arguments | 887 // -- rax: number of arguments |
881 // -- rdi: constructor function | 888 // -- rdi: constructor function |
882 // ----------------------------------- | 889 // ----------------------------------- |
883 | 890 |
884 Label non_function_call; | 891 Label non_function_call; |
885 // Check that function is not a smi. | 892 // Check that function is not a smi. |
886 __ JumpIfSmi(rdi, &non_function_call); | 893 __ JumpIfSmi(rdi, &non_function_call); |
887 // Check that function is a JSFunction. | 894 // Check that function is a JSFunction. |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 __ LeaveInternalFrame(); | 1309 __ LeaveInternalFrame(); |
1303 | 1310 |
1304 // Do a tail-call of the compiled function. | 1311 // Do a tail-call of the compiled function. |
1305 __ lea(rcx, FieldOperand(rax, Code::kHeaderSize)); | 1312 __ lea(rcx, FieldOperand(rax, Code::kHeaderSize)); |
1306 __ jmp(rcx); | 1313 __ jmp(rcx); |
1307 } | 1314 } |
1308 | 1315 |
1309 } } // namespace v8::internal | 1316 } } // namespace v8::internal |
1310 | 1317 |
1311 #endif // V8_TARGET_ARCH_X64 | 1318 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |