| 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 #include "src/full-codegen/full-codegen.h" | 5 #include "src/full-codegen/full-codegen.h" |
| 6 | 6 |
| 7 #include "src/ast/ast-numbering.h" | 7 #include "src/ast/ast-numbering.h" |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
| 10 #include "src/ast/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 VisitForStackValue(args->at(0)); | 512 VisitForStackValue(args->at(0)); |
| 513 VisitForStackValue(args->at(1)); | 513 VisitForStackValue(args->at(1)); |
| 514 VisitForStackValue(args->at(2)); | 514 VisitForStackValue(args->at(2)); |
| 515 VisitForStackValue(args->at(3)); | 515 VisitForStackValue(args->at(3)); |
| 516 __ CallStub(&stub); | 516 __ CallStub(&stub); |
| 517 OperandStackDepthDecrement(4); | 517 OperandStackDepthDecrement(4); |
| 518 context()->Plug(result_register()); | 518 context()->Plug(result_register()); |
| 519 } | 519 } |
| 520 | 520 |
| 521 | 521 |
| 522 void FullCodeGenerator::EmitMathPow(CallRuntime* expr) { | |
| 523 // Load the arguments on the stack and call the runtime function. | |
| 524 MathPowStub stub(isolate(), MathPowStub::ON_STACK); | |
| 525 ZoneList<Expression*>* args = expr->arguments(); | |
| 526 DCHECK(args->length() == 2); | |
| 527 VisitForStackValue(args->at(0)); | |
| 528 VisitForStackValue(args->at(1)); | |
| 529 __ CallStub(&stub); | |
| 530 OperandStackDepthDecrement(2); | |
| 531 context()->Plug(result_register()); | |
| 532 } | |
| 533 | |
| 534 | |
| 535 void FullCodeGenerator::EmitIntrinsicAsStubCall(CallRuntime* expr, | 522 void FullCodeGenerator::EmitIntrinsicAsStubCall(CallRuntime* expr, |
| 536 const Callable& callable) { | 523 const Callable& callable) { |
| 537 ZoneList<Expression*>* args = expr->arguments(); | 524 ZoneList<Expression*>* args = expr->arguments(); |
| 538 int param_count = callable.descriptor().GetRegisterParameterCount(); | 525 int param_count = callable.descriptor().GetRegisterParameterCount(); |
| 539 DCHECK_EQ(args->length(), param_count); | 526 DCHECK_EQ(args->length(), param_count); |
| 540 | 527 |
| 541 if (param_count > 0) { | 528 if (param_count > 0) { |
| 542 int last = param_count - 1; | 529 int last = param_count - 1; |
| 543 // Put all but last arguments on stack. | 530 // Put all but last arguments on stack. |
| 544 for (int i = 0; i < last; i++) { | 531 for (int i = 0; i < last; i++) { |
| (...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1983 return var->scope()->is_nonlinear() || | 1970 return var->scope()->is_nonlinear() || |
| 1984 var->initializer_position() >= proxy->position(); | 1971 var->initializer_position() >= proxy->position(); |
| 1985 } | 1972 } |
| 1986 | 1973 |
| 1987 | 1974 |
| 1988 #undef __ | 1975 #undef __ |
| 1989 | 1976 |
| 1990 | 1977 |
| 1991 } // namespace internal | 1978 } // namespace internal |
| 1992 } // namespace v8 | 1979 } // namespace v8 |
| OLD | NEW |