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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 | 1056 |
1057 void FastCodeGenerator::EmitCallWithStub(Call* expr) { | 1057 void FastCodeGenerator::EmitCallWithStub(Call* expr) { |
1058 // Code common for calls using the call stub. | 1058 // Code common for calls using the call stub. |
1059 ZoneList<Expression*>* args = expr->arguments(); | 1059 ZoneList<Expression*>* args = expr->arguments(); |
1060 int arg_count = args->length(); | 1060 int arg_count = args->length(); |
1061 for (int i = 0; i < arg_count; i++) { | 1061 for (int i = 0; i < arg_count; i++) { |
1062 Visit(args->at(i)); | 1062 Visit(args->at(i)); |
1063 } | 1063 } |
1064 // Record source position for debugger. | 1064 // Record source position for debugger. |
1065 SetSourcePosition(expr->position()); | 1065 SetSourcePosition(expr->position()); |
1066 CallFunctionStub stub(arg_count, NOT_IN_LOOP); | 1066 CallFunctionStub stub(arg_count, NOT_IN_LOOP, RECEIVER_MIGHT_BE_VALUE); |
1067 __ CallStub(&stub); | 1067 __ CallStub(&stub); |
1068 // Restore context register. | 1068 // Restore context register. |
1069 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 1069 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
1070 // Discard the function left on TOS. | 1070 // Discard the function left on TOS. |
1071 DropAndApply(1, expr->context(), rax); | 1071 DropAndApply(1, expr->context(), rax); |
1072 } | 1072 } |
1073 | 1073 |
1074 | 1074 |
1075 void FastCodeGenerator::VisitCall(Call* expr) { | 1075 void FastCodeGenerator::VisitCall(Call* expr) { |
1076 Comment cmnt(masm_, "[ Call"); | 1076 Comment cmnt(masm_, "[ Call"); |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1712 __ movq(Operand(rsp, 0), rdx); | 1712 __ movq(Operand(rsp, 0), rdx); |
1713 // And return. | 1713 // And return. |
1714 __ ret(0); | 1714 __ ret(0); |
1715 } | 1715 } |
1716 | 1716 |
1717 | 1717 |
1718 #undef __ | 1718 #undef __ |
1719 | 1719 |
1720 | 1720 |
1721 } } // namespace v8::internal | 1721 } } // namespace v8::internal |
OLD | NEW |