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 #if V8_TARGET_ARCH_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 4800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4811 __ lw(dst, ContextOperand(cp, context_index)); | 4811 __ lw(dst, ContextOperand(cp, context_index)); |
4812 } | 4812 } |
4813 | 4813 |
4814 | 4814 |
4815 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { | 4815 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { |
4816 Scope* closure_scope = scope()->ClosureScope(); | 4816 Scope* closure_scope = scope()->ClosureScope(); |
4817 if (closure_scope->is_script_scope() || | 4817 if (closure_scope->is_script_scope() || |
4818 closure_scope->is_module_scope()) { | 4818 closure_scope->is_module_scope()) { |
4819 // Contexts nested in the native context have a canonical empty function | 4819 // Contexts nested in the native context have a canonical empty function |
4820 // as their closure, not the anonymous closure containing the global | 4820 // as their closure, not the anonymous closure containing the global |
4821 // code. Pass a smi sentinel and let the runtime look up the empty | 4821 // code. |
4822 // function. | 4822 __ lw(at, GlobalObjectOperand()); |
4823 __ li(at, Operand(Smi::FromInt(0))); | 4823 __ lw(at, FieldMemOperand(at, JSGlobalObject::kNativeContextOffset)); |
| 4824 __ lw(at, ContextOperand(at, Context::CLOSURE_INDEX)); |
4824 } else if (closure_scope->is_eval_scope()) { | 4825 } else if (closure_scope->is_eval_scope()) { |
4825 // Contexts created by a call to eval have the same closure as the | 4826 // Contexts created by a call to eval have the same closure as the |
4826 // context calling eval, not the anonymous closure containing the eval | 4827 // context calling eval, not the anonymous closure containing the eval |
4827 // code. Fetch it from the context. | 4828 // code. Fetch it from the context. |
4828 __ lw(at, ContextOperand(cp, Context::CLOSURE_INDEX)); | 4829 __ lw(at, ContextOperand(cp, Context::CLOSURE_INDEX)); |
4829 } else { | 4830 } else { |
4830 DCHECK(closure_scope->is_function_scope()); | 4831 DCHECK(closure_scope->is_function_scope()); |
4831 __ lw(at, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 4832 __ lw(at, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
4832 } | 4833 } |
4833 __ push(at); | 4834 __ push(at); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4975 reinterpret_cast<uint32_t>( | 4976 reinterpret_cast<uint32_t>( |
4976 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4977 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4977 return OSR_AFTER_STACK_CHECK; | 4978 return OSR_AFTER_STACK_CHECK; |
4978 } | 4979 } |
4979 | 4980 |
4980 | 4981 |
4981 } // namespace internal | 4982 } // namespace internal |
4982 } // namespace v8 | 4983 } // namespace v8 |
4983 | 4984 |
4984 #endif // V8_TARGET_ARCH_MIPS | 4985 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |