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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 VisitForStackValue(declaration->fun()); | 859 VisitForStackValue(declaration->fun()); |
860 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); | 860 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); |
861 break; | 861 break; |
862 } | 862 } |
863 } | 863 } |
864 } | 864 } |
865 | 865 |
866 | 866 |
867 void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) { | 867 void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) { |
868 Variable* variable = declaration->proxy()->var(); | 868 Variable* variable = declaration->proxy()->var(); |
| 869 Interface* interface = declaration->module()->interface(); |
869 DCHECK(variable->location() == Variable::CONTEXT); | 870 DCHECK(variable->location() == Variable::CONTEXT); |
870 DCHECK(variable->interface()->IsFrozen()); | 871 DCHECK(interface->IsFrozen()); |
871 | 872 |
872 Comment cmnt(masm_, "[ ModuleDeclaration"); | 873 Comment cmnt(masm_, "[ ModuleDeclaration"); |
873 EmitDebugCheckDeclarationContext(variable); | 874 EmitDebugCheckDeclarationContext(variable); |
874 | 875 |
875 // Load instance object. | 876 // Load instance object. |
876 __ LoadContext(eax, scope_->ContextChainLength(scope_->ScriptScope())); | 877 __ LoadContext(eax, scope_->ContextChainLength(scope_->ScriptScope())); |
877 __ mov(eax, ContextOperand(eax, variable->interface()->Index())); | 878 __ mov(eax, ContextOperand(eax, interface->Index())); |
878 __ mov(eax, ContextOperand(eax, Context::EXTENSION_INDEX)); | 879 __ mov(eax, ContextOperand(eax, Context::EXTENSION_INDEX)); |
879 | 880 |
880 // Assign it. | 881 // Assign it. |
881 __ mov(ContextOperand(esi, variable->index()), eax); | 882 __ mov(ContextOperand(esi, variable->index()), eax); |
882 // We know that we have written a module, which is not a smi. | 883 // We know that we have written a module, which is not a smi. |
883 __ RecordWriteContextSlot(esi, Context::SlotOffset(variable->index()), eax, | 884 __ RecordWriteContextSlot(esi, Context::SlotOffset(variable->index()), eax, |
884 ecx, kDontSaveFPRegs, EMIT_REMEMBERED_SET, | 885 ecx, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
885 OMIT_SMI_CHECK); | 886 OMIT_SMI_CHECK); |
886 PrepareForBailoutForId(declaration->proxy()->id(), NO_REGISTERS); | 887 PrepareForBailoutForId(declaration->proxy()->id(), NO_REGISTERS); |
887 | 888 |
(...skipping 4440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5328 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5329 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
5329 Assembler::target_address_at(call_target_address, | 5330 Assembler::target_address_at(call_target_address, |
5330 unoptimized_code)); | 5331 unoptimized_code)); |
5331 return OSR_AFTER_STACK_CHECK; | 5332 return OSR_AFTER_STACK_CHECK; |
5332 } | 5333 } |
5333 | 5334 |
5334 | 5335 |
5335 } } // namespace v8::internal | 5336 } } // namespace v8::internal |
5336 | 5337 |
5337 #endif // V8_TARGET_ARCH_X87 | 5338 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |