| 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/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compilation-info.h" | 10 #include "src/compilation-info.h" |
| (...skipping 2448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2459 .StoreAccumulatorInRegister(runtime_call_args[5]); | 2459 .StoreAccumulatorInRegister(runtime_call_args[5]); |
| 2460 | 2460 |
| 2461 // Call ResolvePossiblyDirectEval and modify the callee. | 2461 // Call ResolvePossiblyDirectEval and modify the callee. |
| 2462 builder() | 2462 builder() |
| 2463 ->CallRuntime(Runtime::kResolvePossiblyDirectEval, runtime_call_args) | 2463 ->CallRuntime(Runtime::kResolvePossiblyDirectEval, runtime_call_args) |
| 2464 .StoreAccumulatorInRegister(callee); | 2464 .StoreAccumulatorInRegister(callee); |
| 2465 } | 2465 } |
| 2466 | 2466 |
| 2467 builder()->SetExpressionPosition(expr); | 2467 builder()->SetExpressionPosition(expr); |
| 2468 | 2468 |
| 2469 int feedback_slot_index; | 2469 int const feedback_slot_index = feedback_index(expr->CallFeedbackICSlot()); |
| 2470 if (expr->CallFeedbackICSlot().IsInvalid()) { | |
| 2471 DCHECK(call_type == Call::POSSIBLY_EVAL_CALL); | |
| 2472 // Valid type feedback slots can only be greater than kReservedIndexCount. | |
| 2473 // We use 0 to indicate an invalid slot id. Statically assert that 0 cannot | |
| 2474 // be a valid slot id. | |
| 2475 STATIC_ASSERT(TypeFeedbackVector::kReservedIndexCount > 0); | |
| 2476 feedback_slot_index = 0; | |
| 2477 } else { | |
| 2478 feedback_slot_index = feedback_index(expr->CallFeedbackICSlot()); | |
| 2479 } | |
| 2480 builder()->Call(callee, args, feedback_slot_index, expr->tail_call_mode()); | 2470 builder()->Call(callee, args, feedback_slot_index, expr->tail_call_mode()); |
| 2481 } | 2471 } |
| 2482 | 2472 |
| 2483 void BytecodeGenerator::VisitCallSuper(Call* expr) { | 2473 void BytecodeGenerator::VisitCallSuper(Call* expr) { |
| 2484 RegisterAllocationScope register_scope(this); | 2474 RegisterAllocationScope register_scope(this); |
| 2485 SuperCallReference* super = expr->expression()->AsSuperCallReference(); | 2475 SuperCallReference* super = expr->expression()->AsSuperCallReference(); |
| 2486 | 2476 |
| 2487 // Prepare the constructor to the super call. | 2477 // Prepare the constructor to the super call. |
| 2488 Register this_function = VisitForRegisterValue(super->this_function_var()); | 2478 Register this_function = VisitForRegisterValue(super->this_function_var()); |
| 2489 builder()->CallRuntime(Runtime::kInlineGetSuperConstructor, this_function); | 2479 builder()->CallRuntime(Runtime::kInlineGetSuperConstructor, this_function); |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3187 } | 3177 } |
| 3188 | 3178 |
| 3189 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { | 3179 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { |
| 3190 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict | 3180 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict |
| 3191 : Runtime::kStoreKeyedToSuper_Sloppy; | 3181 : Runtime::kStoreKeyedToSuper_Sloppy; |
| 3192 } | 3182 } |
| 3193 | 3183 |
| 3194 } // namespace interpreter | 3184 } // namespace interpreter |
| 3195 } // namespace internal | 3185 } // namespace internal |
| 3196 } // namespace v8 | 3186 } // namespace v8 |
| OLD | NEW |