| 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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 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 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 __ push(Immediate(variable->name())); | 891 __ push(Immediate(variable->name())); |
| 892 __ push(Immediate(Smi::FromInt(NONE))); | 892 __ push(Immediate(Smi::FromInt(NONE))); |
| 893 VisitForStackValue(declaration->fun()); | 893 VisitForStackValue(declaration->fun()); |
| 894 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); | 894 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); |
| 895 break; | 895 break; |
| 896 } | 896 } |
| 897 } | 897 } |
| 898 } | 898 } |
| 899 | 899 |
| 900 | 900 |
| 901 void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) { | |
| 902 Variable* variable = declaration->proxy()->var(); | |
| 903 ModuleDescriptor* descriptor = declaration->module()->descriptor(); | |
| 904 DCHECK(variable->location() == Variable::CONTEXT); | |
| 905 DCHECK(descriptor->IsFrozen()); | |
| 906 | |
| 907 Comment cmnt(masm_, "[ ModuleDeclaration"); | |
| 908 EmitDebugCheckDeclarationContext(variable); | |
| 909 | |
| 910 // Load instance object. | |
| 911 __ LoadContext(eax, scope_->ContextChainLength(scope_->ScriptScope())); | |
| 912 __ mov(eax, ContextOperand(eax, descriptor->Index())); | |
| 913 __ mov(eax, ContextOperand(eax, Context::EXTENSION_INDEX)); | |
| 914 | |
| 915 // Assign it. | |
| 916 __ mov(ContextOperand(esi, variable->index()), eax); | |
| 917 // We know that we have written a module, which is not a smi. | |
| 918 __ RecordWriteContextSlot(esi, | |
| 919 Context::SlotOffset(variable->index()), | |
| 920 eax, | |
| 921 ecx, | |
| 922 kDontSaveFPRegs, | |
| 923 EMIT_REMEMBERED_SET, | |
| 924 OMIT_SMI_CHECK); | |
| 925 PrepareForBailoutForId(declaration->proxy()->id(), NO_REGISTERS); | |
| 926 | |
| 927 // Traverse into body. | |
| 928 Visit(declaration->module()); | |
| 929 } | |
| 930 | |
| 931 | |
| 932 void FullCodeGenerator::VisitImportDeclaration(ImportDeclaration* declaration) { | 901 void FullCodeGenerator::VisitImportDeclaration(ImportDeclaration* declaration) { |
| 933 VariableProxy* proxy = declaration->proxy(); | 902 VariableProxy* proxy = declaration->proxy(); |
| 934 Variable* variable = proxy->var(); | 903 Variable* variable = proxy->var(); |
| 935 switch (variable->location()) { | 904 switch (variable->location()) { |
| 936 case Variable::UNALLOCATED: | 905 case Variable::UNALLOCATED: |
| 937 // TODO(rossberg) | 906 // TODO(rossberg) |
| 938 break; | 907 break; |
| 939 | 908 |
| 940 case Variable::CONTEXT: { | 909 case Variable::CONTEXT: { |
| 941 Comment cmnt(masm_, "[ ImportDeclaration"); | 910 Comment cmnt(masm_, "[ ImportDeclaration"); |
| (...skipping 4457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5399 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5368 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 5400 Assembler::target_address_at(call_target_address, | 5369 Assembler::target_address_at(call_target_address, |
| 5401 unoptimized_code)); | 5370 unoptimized_code)); |
| 5402 return OSR_AFTER_STACK_CHECK; | 5371 return OSR_AFTER_STACK_CHECK; |
| 5403 } | 5372 } |
| 5404 | 5373 |
| 5405 | 5374 |
| 5406 } } // namespace v8::internal | 5375 } } // namespace v8::internal |
| 5407 | 5376 |
| 5408 #endif // V8_TARGET_ARCH_IA32 | 5377 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |