| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 4793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4804 __ LoadP(dst, ContextOperand(cp, context_index), r0); | 4804 __ LoadP(dst, ContextOperand(cp, context_index), r0); |
| 4805 } | 4805 } |
| 4806 | 4806 |
| 4807 | 4807 |
| 4808 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { | 4808 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { |
| 4809 Scope* closure_scope = scope()->ClosureScope(); | 4809 Scope* closure_scope = scope()->ClosureScope(); |
| 4810 if (closure_scope->is_script_scope() || | 4810 if (closure_scope->is_script_scope() || |
| 4811 closure_scope->is_module_scope()) { | 4811 closure_scope->is_module_scope()) { |
| 4812 // Contexts nested in the native context have a canonical empty function | 4812 // Contexts nested in the native context have a canonical empty function |
| 4813 // as their closure, not the anonymous closure containing the global | 4813 // as their closure, not the anonymous closure containing the global |
| 4814 // code. Pass a smi sentinel and let the runtime look up the empty | 4814 // code. |
| 4815 // function. | 4815 __ LoadP(ip, GlobalObjectOperand()); |
| 4816 __ LoadSmiLiteral(ip, Smi::FromInt(0)); | 4816 __ LoadP(ip, FieldMemOperand(ip, JSGlobalObject::kNativeContextOffset)); |
| 4817 __ LoadP(ip, ContextOperand(ip, Context::CLOSURE_INDEX)); |
| 4817 } else if (closure_scope->is_eval_scope()) { | 4818 } else if (closure_scope->is_eval_scope()) { |
| 4818 // Contexts created by a call to eval have the same closure as the | 4819 // Contexts created by a call to eval have the same closure as the |
| 4819 // context calling eval, not the anonymous closure containing the eval | 4820 // context calling eval, not the anonymous closure containing the eval |
| 4820 // code. Fetch it from the context. | 4821 // code. Fetch it from the context. |
| 4821 __ LoadP(ip, ContextOperand(cp, Context::CLOSURE_INDEX)); | 4822 __ LoadP(ip, ContextOperand(cp, Context::CLOSURE_INDEX)); |
| 4822 } else { | 4823 } else { |
| 4823 DCHECK(closure_scope->is_function_scope()); | 4824 DCHECK(closure_scope->is_function_scope()); |
| 4824 __ LoadP(ip, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 4825 __ LoadP(ip, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 4825 } | 4826 } |
| 4826 __ push(ip); | 4827 __ push(ip); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4961 return ON_STACK_REPLACEMENT; | 4962 return ON_STACK_REPLACEMENT; |
| 4962 } | 4963 } |
| 4963 | 4964 |
| 4964 DCHECK(interrupt_address == | 4965 DCHECK(interrupt_address == |
| 4965 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4966 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 4966 return OSR_AFTER_STACK_CHECK; | 4967 return OSR_AFTER_STACK_CHECK; |
| 4967 } | 4968 } |
| 4968 } // namespace internal | 4969 } // namespace internal |
| 4969 } // namespace v8 | 4970 } // namespace v8 |
| 4970 #endif // V8_TARGET_ARCH_PPC | 4971 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |