| 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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
| 8 | 8 |
| 9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
| 10 // | 10 // |
| (...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 __ Push(cp, a2, a1); | 947 __ Push(cp, a2, a1); |
| 948 // Push initial value for function declaration. | 948 // Push initial value for function declaration. |
| 949 VisitForStackValue(declaration->fun()); | 949 VisitForStackValue(declaration->fun()); |
| 950 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); | 950 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); |
| 951 break; | 951 break; |
| 952 } | 952 } |
| 953 } | 953 } |
| 954 } | 954 } |
| 955 | 955 |
| 956 | 956 |
| 957 void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) { | |
| 958 Variable* variable = declaration->proxy()->var(); | |
| 959 ModuleDescriptor* descriptor = declaration->module()->descriptor(); | |
| 960 DCHECK(variable->location() == Variable::CONTEXT); | |
| 961 DCHECK(descriptor->IsFrozen()); | |
| 962 | |
| 963 Comment cmnt(masm_, "[ ModuleDeclaration"); | |
| 964 EmitDebugCheckDeclarationContext(variable); | |
| 965 | |
| 966 // Load instance object. | |
| 967 __ LoadContext(a1, scope_->ContextChainLength(scope_->ScriptScope())); | |
| 968 __ lw(a1, ContextOperand(a1, descriptor->Index())); | |
| 969 __ lw(a1, ContextOperand(a1, Context::EXTENSION_INDEX)); | |
| 970 | |
| 971 // Assign it. | |
| 972 __ sw(a1, ContextOperand(cp, variable->index())); | |
| 973 // We know that we have written a module, which is not a smi. | |
| 974 __ RecordWriteContextSlot(cp, | |
| 975 Context::SlotOffset(variable->index()), | |
| 976 a1, | |
| 977 a3, | |
| 978 kRAHasBeenSaved, | |
| 979 kDontSaveFPRegs, | |
| 980 EMIT_REMEMBERED_SET, | |
| 981 OMIT_SMI_CHECK); | |
| 982 PrepareForBailoutForId(declaration->proxy()->id(), NO_REGISTERS); | |
| 983 | |
| 984 // Traverse into body. | |
| 985 Visit(declaration->module()); | |
| 986 } | |
| 987 | |
| 988 | |
| 989 void FullCodeGenerator::VisitImportDeclaration(ImportDeclaration* declaration) { | 957 void FullCodeGenerator::VisitImportDeclaration(ImportDeclaration* declaration) { |
| 990 VariableProxy* proxy = declaration->proxy(); | 958 VariableProxy* proxy = declaration->proxy(); |
| 991 Variable* variable = proxy->var(); | 959 Variable* variable = proxy->var(); |
| 992 switch (variable->location()) { | 960 switch (variable->location()) { |
| 993 case Variable::UNALLOCATED: | 961 case Variable::UNALLOCATED: |
| 994 // TODO(rossberg) | 962 // TODO(rossberg) |
| 995 break; | 963 break; |
| 996 | 964 |
| 997 case Variable::CONTEXT: { | 965 case Variable::CONTEXT: { |
| 998 Comment cmnt(masm_, "[ ImportDeclaration"); | 966 Comment cmnt(masm_, "[ ImportDeclaration"); |
| (...skipping 4476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5475 Assembler::target_address_at(pc_immediate_load_address)) == | 5443 Assembler::target_address_at(pc_immediate_load_address)) == |
| 5476 reinterpret_cast<uint32_t>( | 5444 reinterpret_cast<uint32_t>( |
| 5477 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5445 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5478 return OSR_AFTER_STACK_CHECK; | 5446 return OSR_AFTER_STACK_CHECK; |
| 5479 } | 5447 } |
| 5480 | 5448 |
| 5481 | 5449 |
| 5482 } } // namespace v8::internal | 5450 } } // namespace v8::internal |
| 5483 | 5451 |
| 5484 #endif // V8_TARGET_ARCH_MIPS | 5452 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |