| 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-flags.h" | 10 #include "src/interpreter/bytecode-flags.h" |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 BytecodeLabels* else_labels_; | 593 BytecodeLabels* else_labels_; |
| 594 TestFallthrough fallthrough_; | 594 TestFallthrough fallthrough_; |
| 595 bool result_consumed_by_test_; | 595 bool result_consumed_by_test_; |
| 596 | 596 |
| 597 DISALLOW_COPY_AND_ASSIGN(TestResultScope); | 597 DISALLOW_COPY_AND_ASSIGN(TestResultScope); |
| 598 }; | 598 }; |
| 599 | 599 |
| 600 // Used to build a list of global declaration initial value pairs. | 600 // Used to build a list of global declaration initial value pairs. |
| 601 class BytecodeGenerator::GlobalDeclarationsBuilder final : public ZoneObject { | 601 class BytecodeGenerator::GlobalDeclarationsBuilder final : public ZoneObject { |
| 602 public: | 602 public: |
| 603 GlobalDeclarationsBuilder(Isolate* isolate, Zone* zone) | 603 explicit GlobalDeclarationsBuilder(Zone* zone) |
| 604 : isolate_(isolate), | 604 : declarations_(0, zone), |
| 605 declarations_(0, zone), | |
| 606 constant_pool_entry_(0), | 605 constant_pool_entry_(0), |
| 607 has_constant_pool_entry_(false) {} | 606 has_constant_pool_entry_(false) {} |
| 608 | 607 |
| 609 void AddFunctionDeclaration(FeedbackVectorSlot slot, FunctionLiteral* func) { | 608 void AddFunctionDeclaration(FeedbackVectorSlot slot, FunctionLiteral* func) { |
| 610 DCHECK(!slot.IsInvalid()); | 609 DCHECK(!slot.IsInvalid()); |
| 611 declarations_.push_back(std::make_pair(slot, func)); | 610 declarations_.push_back(std::make_pair(slot, func)); |
| 612 } | 611 } |
| 613 | 612 |
| 614 void AddUndefinedDeclaration(FeedbackVectorSlot slot) { | 613 void AddUndefinedDeclaration(FeedbackVectorSlot slot) { |
| 615 DCHECK(!slot.IsInvalid()); | 614 DCHECK(!slot.IsInvalid()); |
| 616 declarations_.push_back(std::make_pair(slot, nullptr)); | 615 declarations_.push_back(std::make_pair(slot, nullptr)); |
| 617 } | 616 } |
| 618 | 617 |
| 619 Handle<FixedArray> AllocateDeclarationPairs(CompilationInfo* info) { | 618 Handle<FixedArray> AllocateDeclarationPairs(CompilationInfo* info) { |
| 620 DCHECK(has_constant_pool_entry_); | 619 DCHECK(has_constant_pool_entry_); |
| 621 int array_index = 0; | 620 int array_index = 0; |
| 622 Handle<FixedArray> pairs = isolate_->factory()->NewFixedArray( | 621 Handle<FixedArray> pairs = info->isolate()->factory()->NewFixedArray( |
| 623 static_cast<int>(declarations_.size() * 2), TENURED); | 622 static_cast<int>(declarations_.size() * 2), TENURED); |
| 624 for (std::pair<FeedbackVectorSlot, FunctionLiteral*> declaration : | 623 for (std::pair<FeedbackVectorSlot, FunctionLiteral*> declaration : |
| 625 declarations_) { | 624 declarations_) { |
| 626 FunctionLiteral* func = declaration.second; | 625 FunctionLiteral* func = declaration.second; |
| 627 Handle<Object> initial_value; | 626 Handle<Object> initial_value; |
| 628 if (func == nullptr) { | 627 if (func == nullptr) { |
| 629 initial_value = isolate_->factory()->undefined_value(); | 628 initial_value = info->isolate()->factory()->undefined_value(); |
| 630 } else { | 629 } else { |
| 631 initial_value = | 630 initial_value = |
| 632 Compiler::GetSharedFunctionInfo(func, info->script(), info); | 631 Compiler::GetSharedFunctionInfo(func, info->script(), info); |
| 633 } | 632 } |
| 634 | 633 |
| 635 // Return a null handle if any initial values can't be created. Caller | 634 // Return a null handle if any initial values can't be created. Caller |
| 636 // will set stack overflow. | 635 // will set stack overflow. |
| 637 if (initial_value.is_null()) return Handle<FixedArray>(); | 636 if (initial_value.is_null()) return Handle<FixedArray>(); |
| 638 | 637 |
| 639 pairs->set(array_index++, Smi::FromInt(declaration.first.ToInt())); | 638 pairs->set(array_index++, Smi::FromInt(declaration.first.ToInt())); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 650 void set_constant_pool_entry(size_t constant_pool_entry) { | 649 void set_constant_pool_entry(size_t constant_pool_entry) { |
| 651 DCHECK(!empty()); | 650 DCHECK(!empty()); |
| 652 DCHECK(!has_constant_pool_entry_); | 651 DCHECK(!has_constant_pool_entry_); |
| 653 constant_pool_entry_ = constant_pool_entry; | 652 constant_pool_entry_ = constant_pool_entry; |
| 654 has_constant_pool_entry_ = true; | 653 has_constant_pool_entry_ = true; |
| 655 } | 654 } |
| 656 | 655 |
| 657 bool empty() { return declarations_.empty(); } | 656 bool empty() { return declarations_.empty(); } |
| 658 | 657 |
| 659 private: | 658 private: |
| 660 Isolate* isolate_; | |
| 661 ZoneVector<std::pair<FeedbackVectorSlot, FunctionLiteral*>> declarations_; | 659 ZoneVector<std::pair<FeedbackVectorSlot, FunctionLiteral*>> declarations_; |
| 662 size_t constant_pool_entry_; | 660 size_t constant_pool_entry_; |
| 663 bool has_constant_pool_entry_; | 661 bool has_constant_pool_entry_; |
| 664 }; | 662 }; |
| 665 | 663 |
| 666 BytecodeGenerator::BytecodeGenerator(CompilationInfo* info) | 664 BytecodeGenerator::BytecodeGenerator(CompilationInfo* info) |
| 667 : isolate_(info->isolate()), | 665 : zone_(info->zone()), |
| 668 zone_(info->zone()), | |
| 669 builder_(new (zone()) BytecodeArrayBuilder( | 666 builder_(new (zone()) BytecodeArrayBuilder( |
| 670 info->isolate(), info->zone(), info->num_parameters_including_this(), | 667 info->isolate(), info->zone(), info->num_parameters_including_this(), |
| 671 info->scope()->MaxNestedContextChainLength(), | 668 info->scope()->MaxNestedContextChainLength(), |
| 672 info->scope()->num_stack_slots(), info->literal(), | 669 info->scope()->num_stack_slots(), info->literal(), |
| 673 info->SourcePositionRecordingMode())), | 670 info->SourcePositionRecordingMode())), |
| 674 info_(info), | 671 info_(info), |
| 675 scope_(info->scope()), | 672 scope_(info->scope()), |
| 676 globals_builder_(new (zone()) GlobalDeclarationsBuilder(info->isolate(), | 673 globals_builder_(new (zone()) GlobalDeclarationsBuilder(info->zone())), |
| 677 info->zone())), | |
| 678 global_declarations_(0, info->zone()), | 674 global_declarations_(0, info->zone()), |
| 679 function_literals_(0, info->zone()), | 675 function_literals_(0, info->zone()), |
| 680 native_function_literals_(0, info->zone()), | 676 native_function_literals_(0, info->zone()), |
| 681 execution_control_(nullptr), | 677 execution_control_(nullptr), |
| 682 execution_context_(nullptr), | 678 execution_context_(nullptr), |
| 683 execution_result_(nullptr), | 679 execution_result_(nullptr), |
| 684 register_allocator_(nullptr), | 680 register_allocator_(nullptr), |
| 685 generator_resume_points_(info->literal()->yield_count(), info->zone()), | 681 generator_resume_points_(info->literal()->yield_count(), info->zone()), |
| 686 generator_state_(), | 682 generator_state_(), |
| 687 loop_depth_(0) { | 683 loop_depth_(0), |
| 688 InitializeAstVisitor(isolate()->stack_guard()->real_climit()); | 684 home_object_symbol_(info->isolate()->factory()->home_object_symbol()), |
| 685 prototype_string_(info->isolate()->factory()->prototype_string()) { |
| 686 InitializeAstVisitor(info->isolate()->stack_guard()->real_climit()); |
| 689 } | 687 } |
| 690 | 688 |
| 691 Handle<BytecodeArray> BytecodeGenerator::MakeBytecode() { | 689 Handle<BytecodeArray> BytecodeGenerator::MakeBytecode(Isolate* isolate) { |
| 692 // Create an inner HandleScope to avoid unnecessarily canonicalizing handles | 690 // Create an inner HandleScope to avoid unnecessarily canonicalizing handles |
| 693 // created as part of bytecode finalization. | 691 // created as part of bytecode finalization. |
| 694 HandleScope scope(isolate()); | 692 HandleScope scope(isolate); |
| 695 | 693 |
| 696 GenerateBytecode(); | 694 GenerateBytecode(); |
| 697 FinalizeBytecode(); | 695 FinalizeBytecode(isolate); |
| 698 | 696 |
| 699 if (HasStackOverflow()) return Handle<BytecodeArray>(); | 697 if (HasStackOverflow()) return Handle<BytecodeArray>(); |
| 700 | 698 |
| 701 return scope.CloseAndEscape(builder()->ToBytecodeArray()); | 699 return scope.CloseAndEscape(builder()->ToBytecodeArray(isolate)); |
| 702 } | 700 } |
| 703 | 701 |
| 704 void BytecodeGenerator::FinalizeBytecode() { | 702 void BytecodeGenerator::FinalizeBytecode(Isolate* isolate) { |
| 705 // Build global declaration pair arrays. | 703 // Build global declaration pair arrays. |
| 706 for (GlobalDeclarationsBuilder* globals_builder : global_declarations_) { | 704 for (GlobalDeclarationsBuilder* globals_builder : global_declarations_) { |
| 707 Handle<FixedArray> declarations = | 705 Handle<FixedArray> declarations = |
| 708 globals_builder->AllocateDeclarationPairs(info()); | 706 globals_builder->AllocateDeclarationPairs(info()); |
| 709 if (declarations.is_null()) return SetStackOverflow(); | 707 if (declarations.is_null()) return SetStackOverflow(); |
| 710 builder()->InsertConstantPoolEntryAt(globals_builder->constant_pool_entry(), | 708 builder()->InsertConstantPoolEntryAt(globals_builder->constant_pool_entry(), |
| 711 declarations); | 709 declarations); |
| 712 } | 710 } |
| 713 | 711 |
| 714 // Find or build shared function infos. | 712 // Find or build shared function infos. |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 builder() | 1016 builder() |
| 1019 ->LoadConstantPoolEntry(globals_builder()->constant_pool_entry()) | 1017 ->LoadConstantPoolEntry(globals_builder()->constant_pool_entry()) |
| 1020 .StoreAccumulatorInRegister(pairs) | 1018 .StoreAccumulatorInRegister(pairs) |
| 1021 .LoadLiteral(Smi::FromInt(encoded_flags)) | 1019 .LoadLiteral(Smi::FromInt(encoded_flags)) |
| 1022 .StoreAccumulatorInRegister(flags) | 1020 .StoreAccumulatorInRegister(flags) |
| 1023 .MoveRegister(Register::function_closure(), function) | 1021 .MoveRegister(Register::function_closure(), function) |
| 1024 .CallRuntime(Runtime::kDeclareGlobalsForInterpreter, pairs, 3); | 1022 .CallRuntime(Runtime::kDeclareGlobalsForInterpreter, pairs, 3); |
| 1025 | 1023 |
| 1026 // Push and reset globals builder. | 1024 // Push and reset globals builder. |
| 1027 global_declarations_.push_back(globals_builder()); | 1025 global_declarations_.push_back(globals_builder()); |
| 1028 globals_builder_ = new (zone()) GlobalDeclarationsBuilder(isolate(), zone()); | 1026 globals_builder_ = new (zone()) GlobalDeclarationsBuilder(zone()); |
| 1029 } | 1027 } |
| 1030 | 1028 |
| 1031 void BytecodeGenerator::VisitStatements(ZoneList<Statement*>* statements) { | 1029 void BytecodeGenerator::VisitStatements(ZoneList<Statement*>* statements) { |
| 1032 for (int i = 0; i < statements->length(); i++) { | 1030 for (int i = 0; i < statements->length(); i++) { |
| 1033 // Allocate an outer register allocations scope for the statement. | 1031 // Allocate an outer register allocations scope for the statement. |
| 1034 RegisterAllocationScope allocation_scope(this); | 1032 RegisterAllocationScope allocation_scope(this); |
| 1035 Statement* stmt = statements->at(i); | 1033 Statement* stmt = statements->at(i); |
| 1036 Visit(stmt); | 1034 Visit(stmt); |
| 1037 if (stmt->IsJump()) break; | 1035 if (stmt->IsJump()) break; |
| 1038 } | 1036 } |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1490 execution_result()->SetResultInAccumulator(); | 1488 execution_result()->SetResultInAccumulator(); |
| 1491 } | 1489 } |
| 1492 | 1490 |
| 1493 void BytecodeGenerator::VisitClassLiteral(ClassLiteral* expr) { | 1491 void BytecodeGenerator::VisitClassLiteral(ClassLiteral* expr) { |
| 1494 VisitClassLiteralForRuntimeDefinition(expr); | 1492 VisitClassLiteralForRuntimeDefinition(expr); |
| 1495 | 1493 |
| 1496 // Load the "prototype" from the constructor. | 1494 // Load the "prototype" from the constructor. |
| 1497 register_allocator()->PrepareForConsecutiveAllocations(2); | 1495 register_allocator()->PrepareForConsecutiveAllocations(2); |
| 1498 Register literal = register_allocator()->NextConsecutiveRegister(); | 1496 Register literal = register_allocator()->NextConsecutiveRegister(); |
| 1499 Register prototype = register_allocator()->NextConsecutiveRegister(); | 1497 Register prototype = register_allocator()->NextConsecutiveRegister(); |
| 1500 Handle<String> name = isolate()->factory()->prototype_string(); | |
| 1501 FeedbackVectorSlot slot = expr->PrototypeSlot(); | 1498 FeedbackVectorSlot slot = expr->PrototypeSlot(); |
| 1502 builder() | 1499 builder() |
| 1503 ->StoreAccumulatorInRegister(literal) | 1500 ->StoreAccumulatorInRegister(literal) |
| 1504 .LoadNamedProperty(literal, name, feedback_index(slot)) | 1501 .LoadNamedProperty(literal, prototype_string(), feedback_index(slot)) |
| 1505 .StoreAccumulatorInRegister(prototype); | 1502 .StoreAccumulatorInRegister(prototype); |
| 1506 | 1503 |
| 1507 VisitClassLiteralProperties(expr, literal, prototype); | 1504 VisitClassLiteralProperties(expr, literal, prototype); |
| 1508 builder()->CallRuntime(Runtime::kToFastProperties, literal, 1); | 1505 builder()->CallRuntime(Runtime::kToFastProperties, literal, 1); |
| 1509 // Assign to class variable. | 1506 // Assign to class variable. |
| 1510 if (expr->class_variable_proxy() != nullptr) { | 1507 if (expr->class_variable_proxy() != nullptr) { |
| 1511 Variable* var = expr->class_variable_proxy()->var(); | 1508 Variable* var = expr->class_variable_proxy()->var(); |
| 1512 FeedbackVectorSlot slot = expr->NeedsProxySlot() | 1509 FeedbackVectorSlot slot = expr->NeedsProxySlot() |
| 1513 ? expr->ProxySlot() | 1510 ? expr->ProxySlot() |
| 1514 : FeedbackVectorSlot::Invalid(); | 1511 : FeedbackVectorSlot::Invalid(); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1612 break; | 1609 break; |
| 1613 } | 1610 } |
| 1614 } | 1611 } |
| 1615 } | 1612 } |
| 1616 } | 1613 } |
| 1617 | 1614 |
| 1618 void BytecodeGenerator::VisitClassLiteralStaticPrototypeWithComputedName( | 1615 void BytecodeGenerator::VisitClassLiteralStaticPrototypeWithComputedName( |
| 1619 Register key) { | 1616 Register key) { |
| 1620 BytecodeLabel done; | 1617 BytecodeLabel done; |
| 1621 builder() | 1618 builder() |
| 1622 ->LoadLiteral(isolate()->factory()->prototype_string()) | 1619 ->LoadLiteral(prototype_string()) |
| 1623 .CompareOperation(Token::Value::EQ_STRICT, key) | 1620 .CompareOperation(Token::Value::EQ_STRICT, key) |
| 1624 .JumpIfFalse(&done) | 1621 .JumpIfFalse(&done) |
| 1625 .CallRuntime(Runtime::kThrowStaticPrototypeError, Register(0), 0) | 1622 .CallRuntime(Runtime::kThrowStaticPrototypeError, Register(0), 0) |
| 1626 .Bind(&done); | 1623 .Bind(&done); |
| 1627 } | 1624 } |
| 1628 | 1625 |
| 1629 void BytecodeGenerator::VisitNativeFunctionLiteral( | 1626 void BytecodeGenerator::VisitNativeFunctionLiteral( |
| 1630 NativeFunctionLiteral* expr) { | 1627 NativeFunctionLiteral* expr) { |
| 1631 size_t entry = builder()->AllocateConstantPoolEntry(); | 1628 size_t entry = builder()->AllocateConstantPoolEntry(); |
| 1632 builder()->CreateClosure(entry, NOT_TENURED); | 1629 builder()->CreateClosure(entry, NOT_TENURED); |
| (...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3165 | 3162 |
| 3166 // Allocate a new local context. | 3163 // Allocate a new local context. |
| 3167 if (scope->is_script_scope()) { | 3164 if (scope->is_script_scope()) { |
| 3168 RegisterAllocationScope register_scope(this); | 3165 RegisterAllocationScope register_scope(this); |
| 3169 Register closure = register_allocator()->NewRegister(); | 3166 Register closure = register_allocator()->NewRegister(); |
| 3170 Register scope_info = register_allocator()->NewRegister(); | 3167 Register scope_info = register_allocator()->NewRegister(); |
| 3171 DCHECK(Register::AreContiguous(closure, scope_info)); | 3168 DCHECK(Register::AreContiguous(closure, scope_info)); |
| 3172 builder() | 3169 builder() |
| 3173 ->LoadAccumulatorWithRegister(Register::function_closure()) | 3170 ->LoadAccumulatorWithRegister(Register::function_closure()) |
| 3174 .StoreAccumulatorInRegister(closure) | 3171 .StoreAccumulatorInRegister(closure) |
| 3175 .LoadLiteral(scope->GetScopeInfo(isolate())) | 3172 .LoadLiteral(scope->scope_info()) |
| 3176 .StoreAccumulatorInRegister(scope_info) | 3173 .StoreAccumulatorInRegister(scope_info) |
| 3177 .CallRuntime(Runtime::kNewScriptContext, closure, 2); | 3174 .CallRuntime(Runtime::kNewScriptContext, closure, 2); |
| 3178 } else { | 3175 } else { |
| 3179 int slot_count = scope->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 3176 int slot_count = scope->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 3180 builder()->CreateFunctionContext(slot_count); | 3177 builder()->CreateFunctionContext(slot_count); |
| 3181 } | 3178 } |
| 3182 execution_result()->SetResultInAccumulator(); | 3179 execution_result()->SetResultInAccumulator(); |
| 3183 } | 3180 } |
| 3184 | 3181 |
| 3185 void BytecodeGenerator::VisitBuildLocalActivationContext() { | 3182 void BytecodeGenerator::VisitBuildLocalActivationContext() { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 3208 builder()->LoadAccumulatorWithRegister(parameter) | 3205 builder()->LoadAccumulatorWithRegister(parameter) |
| 3209 .StoreContextSlot(execution_context()->reg(), variable->index()); | 3206 .StoreContextSlot(execution_context()->reg(), variable->index()); |
| 3210 } | 3207 } |
| 3211 } | 3208 } |
| 3212 | 3209 |
| 3213 void BytecodeGenerator::VisitNewLocalBlockContext(Scope* scope) { | 3210 void BytecodeGenerator::VisitNewLocalBlockContext(Scope* scope) { |
| 3214 AccumulatorResultScope accumulator_execution_result(this); | 3211 AccumulatorResultScope accumulator_execution_result(this); |
| 3215 DCHECK(scope->is_block_scope()); | 3212 DCHECK(scope->is_block_scope()); |
| 3216 | 3213 |
| 3217 VisitFunctionClosureForContext(); | 3214 VisitFunctionClosureForContext(); |
| 3218 | 3215 builder()->CreateBlockContext(scope->scope_info()); |
| 3219 builder()->CreateBlockContext(scope->GetScopeInfo(isolate())); | |
| 3220 execution_result()->SetResultInAccumulator(); | 3216 execution_result()->SetResultInAccumulator(); |
| 3221 } | 3217 } |
| 3222 | 3218 |
| 3223 void BytecodeGenerator::VisitNewLocalWithContext() { | 3219 void BytecodeGenerator::VisitNewLocalWithContext() { |
| 3224 AccumulatorResultScope accumulator_execution_result(this); | 3220 AccumulatorResultScope accumulator_execution_result(this); |
| 3225 | 3221 |
| 3226 register_allocator()->PrepareForConsecutiveAllocations(2); | 3222 register_allocator()->PrepareForConsecutiveAllocations(2); |
| 3227 Register extension_object = register_allocator()->NextConsecutiveRegister(); | 3223 Register extension_object = register_allocator()->NextConsecutiveRegister(); |
| 3228 Register closure = register_allocator()->NextConsecutiveRegister(); | 3224 Register closure = register_allocator()->NextConsecutiveRegister(); |
| 3229 | 3225 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3264 builder()->StoreAccumulatorInRegister(value_out); | 3260 builder()->StoreAccumulatorInRegister(value_out); |
| 3265 VisitSetHomeObject(value_out, home_object, property); | 3261 VisitSetHomeObject(value_out, home_object, property); |
| 3266 } | 3262 } |
| 3267 } | 3263 } |
| 3268 | 3264 |
| 3269 void BytecodeGenerator::VisitSetHomeObject(Register value, Register home_object, | 3265 void BytecodeGenerator::VisitSetHomeObject(Register value, Register home_object, |
| 3270 ObjectLiteralProperty* property, | 3266 ObjectLiteralProperty* property, |
| 3271 int slot_number) { | 3267 int slot_number) { |
| 3272 Expression* expr = property->value(); | 3268 Expression* expr = property->value(); |
| 3273 if (FunctionLiteral::NeedsHomeObject(expr)) { | 3269 if (FunctionLiteral::NeedsHomeObject(expr)) { |
| 3274 Handle<Name> name = isolate()->factory()->home_object_symbol(); | |
| 3275 FeedbackVectorSlot slot = property->GetSlot(slot_number); | 3270 FeedbackVectorSlot slot = property->GetSlot(slot_number); |
| 3276 builder() | 3271 builder() |
| 3277 ->LoadAccumulatorWithRegister(home_object) | 3272 ->LoadAccumulatorWithRegister(home_object) |
| 3278 .StoreNamedProperty(value, name, feedback_index(slot), language_mode()); | 3273 .StoreNamedProperty(value, home_object_symbol(), feedback_index(slot), |
| 3274 language_mode()); |
| 3279 } | 3275 } |
| 3280 } | 3276 } |
| 3281 | 3277 |
| 3282 void BytecodeGenerator::VisitArgumentsObject(Variable* variable) { | 3278 void BytecodeGenerator::VisitArgumentsObject(Variable* variable) { |
| 3283 if (variable == nullptr) return; | 3279 if (variable == nullptr) return; |
| 3284 | 3280 |
| 3285 DCHECK(variable->IsContextSlot() || variable->IsStackAllocated()); | 3281 DCHECK(variable->IsContextSlot() || variable->IsStackAllocated()); |
| 3286 | 3282 |
| 3287 // Allocate and initialize a new arguments object and assign to the | 3283 // Allocate and initialize a new arguments object and assign to the |
| 3288 // {arguments} variable. | 3284 // {arguments} variable. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3425 return execution_context()->scope()->language_mode(); | 3421 return execution_context()->scope()->language_mode(); |
| 3426 } | 3422 } |
| 3427 | 3423 |
| 3428 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3424 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
| 3429 return TypeFeedbackVector::GetIndex(slot); | 3425 return TypeFeedbackVector::GetIndex(slot); |
| 3430 } | 3426 } |
| 3431 | 3427 |
| 3432 } // namespace interpreter | 3428 } // namespace interpreter |
| 3433 } // namespace internal | 3429 } // namespace internal |
| 3434 } // namespace v8 | 3430 } // namespace v8 |
| OLD | NEW |