| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 19 matching lines...) Expand all Loading... |
| 30 #include "codegen-inl.h" | 30 #include "codegen-inl.h" |
| 31 #include "debug.h" | 31 #include "debug.h" |
| 32 #include "runtime.h" | 32 #include "runtime.h" |
| 33 | 33 |
| 34 namespace v8 { namespace internal { | 34 namespace v8 { namespace internal { |
| 35 | 35 |
| 36 | 36 |
| 37 #define __ masm-> | 37 #define __ masm-> |
| 38 | 38 |
| 39 | 39 |
| 40 void Builtins::Generate_Adaptor(MacroAssembler* masm, | 40 void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) { |
| 41 int argc, | |
| 42 CFunctionId id) { | |
| 43 // TODO(1238487): Don't pass the function in a static variable. | 41 // TODO(1238487): Don't pass the function in a static variable. |
| 44 ExternalReference passed = ExternalReference::builtin_passed_function(); | 42 ExternalReference passed = ExternalReference::builtin_passed_function(); |
| 45 __ mov(Operand::StaticVariable(passed), edi); | 43 __ mov(Operand::StaticVariable(passed), edi); |
| 46 | 44 |
| 47 if (argc == -1) { | 45 // The actual argument count has already been loaded into register |
| 48 // The actual argument count has already been loaded into register | 46 // eax, but JumpToBuiltin expects eax to contain the number of |
| 49 // eax, but JumpToBuiltin expects eax to contain the number of | 47 // arguments including the receiver. |
| 50 // arguments including the receiver. | 48 __ inc(eax); |
| 51 __ inc(eax); | |
| 52 } else { | |
| 53 // The number passed in argc excludes the receiver, but | |
| 54 // JumpToBuiltin expects eax to contain the number of arguments | |
| 55 // including the receiver. | |
| 56 __ mov(eax, argc + 1); | |
| 57 } | |
| 58 __ JumpToBuiltin(ExternalReference(id)); | 49 __ JumpToBuiltin(ExternalReference(id)); |
| 59 } | 50 } |
| 60 | 51 |
| 61 | 52 |
| 62 void Builtins::Generate_JSConstructCall(MacroAssembler* masm) { | 53 void Builtins::Generate_JSConstructCall(MacroAssembler* masm) { |
| 63 // ----------- S t a t e ------------- | 54 // ----------- S t a t e ------------- |
| 64 // -- eax: number of arguments | 55 // -- eax: number of arguments |
| 65 // -- edi: constructor function | 56 // -- edi: constructor function |
| 66 // ----------------------------------- | 57 // ----------------------------------- |
| 67 | 58 |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 // Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc). | 876 // Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc). |
| 886 // ----------- S t a t e ------------- | 877 // ----------- S t a t e ------------- |
| 887 // No registers used on entry. | 878 // No registers used on entry. |
| 888 // ----------------------------------- | 879 // ----------------------------------- |
| 889 Generate_DebugBreakCallHelper(masm, 0, false); | 880 Generate_DebugBreakCallHelper(masm, 0, false); |
| 890 } | 881 } |
| 891 | 882 |
| 892 #undef __ | 883 #undef __ |
| 893 | 884 |
| 894 } } // namespace v8::internal | 885 } } // namespace v8::internal |
| OLD | NEW |