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/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/interpreter/bytecode-register-allocator.h" | 9 #include "src/interpreter/bytecode-register-allocator.h" |
10 #include "src/interpreter/control-flow-builders.h" | 10 #include "src/interpreter/control-flow-builders.h" |
(...skipping 2267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2278 Smi::FromInt(execution_context()->scope()->start_position())) | 2278 Smi::FromInt(execution_context()->scope()->start_position())) |
2279 .StoreAccumulatorInRegister(position); | 2279 .StoreAccumulatorInRegister(position); |
2280 | 2280 |
2281 // Call ResolvePossiblyDirectEval and modify the callee. | 2281 // Call ResolvePossiblyDirectEval and modify the callee. |
2282 builder() | 2282 builder() |
2283 ->CallRuntime(Runtime::kResolvePossiblyDirectEval, callee_for_eval, 5) | 2283 ->CallRuntime(Runtime::kResolvePossiblyDirectEval, callee_for_eval, 5) |
2284 .StoreAccumulatorInRegister(callee); | 2284 .StoreAccumulatorInRegister(callee); |
2285 } | 2285 } |
2286 | 2286 |
2287 builder()->SetExpressionPosition(expr); | 2287 builder()->SetExpressionPosition(expr); |
2288 builder()->Call(callee, receiver, 1 + args->length(), | 2288 if (call_type == Call::POSSIBLY_EVAL_CALL || |
2289 feedback_index(expr->CallFeedbackICSlot())); | 2289 call_type == Call::LOOKUP_SLOT_CALL) { |
rmcilroy
2016/02/12 14:21:03
Would this be the same if you did:
if (expr->CallF
mythria
2016/02/17 11:02:48
Done. Yes, indeed. I missed it but Lookup_slot_cal
| |
2290 builder()->Call(callee, receiver, 1 + args->length()); | |
2291 } else { | |
2292 builder()->CallIC(callee, receiver, 1 + args->length(), | |
2293 feedback_index(expr->CallFeedbackICSlot())); | |
2294 } | |
2290 execution_result()->SetResultInAccumulator(); | 2295 execution_result()->SetResultInAccumulator(); |
2291 } | 2296 } |
2292 | 2297 |
2293 | 2298 |
2294 void BytecodeGenerator::VisitCallNew(CallNew* expr) { | 2299 void BytecodeGenerator::VisitCallNew(CallNew* expr) { |
2295 Register constructor = register_allocator()->NewRegister(); | 2300 Register constructor = register_allocator()->NewRegister(); |
2296 VisitForAccumulatorValue(expr->expression()); | 2301 VisitForAccumulatorValue(expr->expression()); |
2297 builder()->StoreAccumulatorInRegister(constructor); | 2302 builder()->StoreAccumulatorInRegister(constructor); |
2298 | 2303 |
2299 ZoneList<Expression*>* args = expr->arguments(); | 2304 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2891 } | 2896 } |
2892 | 2897 |
2893 | 2898 |
2894 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 2899 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
2895 return info()->feedback_vector()->GetIndex(slot); | 2900 return info()->feedback_vector()->GetIndex(slot); |
2896 } | 2901 } |
2897 | 2902 |
2898 } // namespace interpreter | 2903 } // namespace interpreter |
2899 } // namespace internal | 2904 } // namespace internal |
2900 } // namespace v8 | 2905 } // namespace v8 |
OLD | NEW |