OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4349 default: | 4349 default: |
4350 UNREACHABLE(); | 4350 UNREACHABLE(); |
4351 } | 4351 } |
4352 } | 4352 } |
4353 | 4353 |
4354 | 4354 |
4355 void FullCodeGenerator::EmitUnaryOperation(UnaryOperation* expr, | 4355 void FullCodeGenerator::EmitUnaryOperation(UnaryOperation* expr, |
4356 const char* comment) { | 4356 const char* comment) { |
4357 // TODO(svenpanne): Allowing format strings in Comment would be nice here... | 4357 // TODO(svenpanne): Allowing format strings in Comment would be nice here... |
4358 Comment cmt(masm_, comment); | 4358 Comment cmt(masm_, comment); |
4359 bool can_overwrite = expr->expression()->ResultOverwriteAllowed(); | 4359 UnaryOpStub stub(expr->op()); |
4360 UnaryOverwriteMode overwrite = | |
4361 can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE; | |
4362 UnaryOpStub stub(expr->op(), overwrite); | |
4363 // UnaryOpStub expects the argument to be in the | 4360 // UnaryOpStub expects the argument to be in the |
4364 // accumulator register rax. | 4361 // accumulator register rax. |
4365 VisitForAccumulatorValue(expr->expression()); | 4362 VisitForAccumulatorValue(expr->expression()); |
4366 SetSourcePosition(expr->position()); | 4363 SetSourcePosition(expr->position()); |
4367 CallIC(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, | 4364 CallIC(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, |
4368 expr->UnaryOperationFeedbackId()); | 4365 expr->UnaryOperationFeedbackId()); |
4369 context()->Plug(rax); | 4366 context()->Plug(rax); |
4370 } | 4367 } |
4371 | 4368 |
4372 | 4369 |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4909 *context_length = 0; | 4906 *context_length = 0; |
4910 return previous_; | 4907 return previous_; |
4911 } | 4908 } |
4912 | 4909 |
4913 | 4910 |
4914 #undef __ | 4911 #undef __ |
4915 | 4912 |
4916 } } // namespace v8::internal | 4913 } } // namespace v8::internal |
4917 | 4914 |
4918 #endif // V8_TARGET_ARCH_X64 | 4915 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |