Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/bytecode-generator.h" | 5 #include "src/interpreter/bytecode-generator.h" | 
| 6 | 6 | 
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" | 
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" | 
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" | 
| 10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" | 
| (...skipping 2504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2515 .LoadLiteral(Smi::FromInt(expr->position())) | 2515 .LoadLiteral(Smi::FromInt(expr->position())) | 
| 2516 .StoreAccumulatorInRegister(eval_position); | 2516 .StoreAccumulatorInRegister(eval_position); | 
| 2517 | 2517 | 
| 2518 // Call ResolvePossiblyDirectEval and modify the callee. | 2518 // Call ResolvePossiblyDirectEval and modify the callee. | 
| 2519 builder() | 2519 builder() | 
| 2520 ->CallRuntime(Runtime::kResolvePossiblyDirectEval, callee_for_eval, 6) | 2520 ->CallRuntime(Runtime::kResolvePossiblyDirectEval, callee_for_eval, 6) | 
| 2521 .StoreAccumulatorInRegister(callee); | 2521 .StoreAccumulatorInRegister(callee); | 
| 2522 } | 2522 } | 
| 2523 | 2523 | 
| 2524 builder()->SetExpressionPosition(expr); | 2524 builder()->SetExpressionPosition(expr); | 
| 2525 builder()->Call(callee, receiver, 1 + args->length(), | 2525 if (expr->CallFeedbackICSlot().IsInvalid()) { | 
| 2526 feedback_index(expr->CallFeedbackICSlot()), | 2526 builder()->Call(callee, receiver, 1 + args->length(), | 
| 2527 expr->tail_call_mode()); | 2527 expr->tail_call_mode()); | 
| 2528 } else { | |
| 2529 DCHECK(call_type != Call::POSSIBLY_EVAL_CALL); | |
| 
 
Benedikt Meurer
2016/07/09 18:19:22
Nit: Use DCHECK_NE.
 
mythria
2016/07/11 15:25:24
This code changed a little and I moved DCHECK to t
 
 | |
| 2530 builder()->CallWithFeedback(callee, receiver, 1 + args->length(), | |
| 2531 feedback_index(expr->CallFeedbackICSlot()), | |
| 2532 expr->tail_call_mode()); | |
| 2533 } | |
| 2528 execution_result()->SetResultInAccumulator(); | 2534 execution_result()->SetResultInAccumulator(); | 
| 2529 } | 2535 } | 
| 2530 | 2536 | 
| 2531 void BytecodeGenerator::VisitCallSuper(Call* expr) { | 2537 void BytecodeGenerator::VisitCallSuper(Call* expr) { | 
| 2532 RegisterAllocationScope register_scope(this); | 2538 RegisterAllocationScope register_scope(this); | 
| 2533 SuperCallReference* super = expr->expression()->AsSuperCallReference(); | 2539 SuperCallReference* super = expr->expression()->AsSuperCallReference(); | 
| 2534 | 2540 | 
| 2535 // Prepare the constructor to the super call. | 2541 // Prepare the constructor to the super call. | 
| 2536 Register this_function = register_allocator()->NewRegister(); | 2542 Register this_function = register_allocator()->NewRegister(); | 
| 2537 VisitForAccumulatorValue(super->this_function_var()); | 2543 VisitForAccumulatorValue(super->this_function_var()); | 
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3167 return execution_context()->scope()->language_mode(); | 3173 return execution_context()->scope()->language_mode(); | 
| 3168 } | 3174 } | 
| 3169 | 3175 | 
| 3170 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3176 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 
| 3171 return TypeFeedbackVector::GetIndex(slot); | 3177 return TypeFeedbackVector::GetIndex(slot); | 
| 3172 } | 3178 } | 
| 3173 | 3179 | 
| 3174 } // namespace interpreter | 3180 } // namespace interpreter | 
| 3175 } // namespace internal | 3181 } // namespace internal | 
| 3176 } // namespace v8 | 3182 } // namespace v8 | 
| OLD | NEW |