| 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 5162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5173 __ mov(Operand(ebp, frame_offset), value); | 5173 __ mov(Operand(ebp, frame_offset), value); |
| 5174 } | 5174 } |
| 5175 | 5175 |
| 5176 | 5176 |
| 5177 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { | 5177 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { |
| 5178 __ mov(dst, ContextOperand(esi, context_index)); | 5178 __ mov(dst, ContextOperand(esi, context_index)); |
| 5179 } | 5179 } |
| 5180 | 5180 |
| 5181 | 5181 |
| 5182 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { | 5182 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { |
| 5183 Scope* declaration_scope = scope()->DeclarationScope(); | 5183 Scope* closure_scope = scope()->ClosureScope(); |
| 5184 if (declaration_scope->is_script_scope() || | 5184 if (closure_scope->is_script_scope() || |
| 5185 declaration_scope->is_module_scope()) { | 5185 closure_scope->is_module_scope()) { |
| 5186 // Contexts nested in the native context have a canonical empty function | 5186 // Contexts nested in the native context have a canonical empty function |
| 5187 // as their closure, not the anonymous closure containing the global | 5187 // as their closure, not the anonymous closure containing the global |
| 5188 // code. Pass a smi sentinel and let the runtime look up the empty | 5188 // code. Pass a smi sentinel and let the runtime look up the empty |
| 5189 // function. | 5189 // function. |
| 5190 __ push(Immediate(Smi::FromInt(0))); | 5190 __ push(Immediate(Smi::FromInt(0))); |
| 5191 } else if (declaration_scope->is_eval_scope()) { | 5191 } else if (closure_scope->is_eval_scope()) { |
| 5192 // Contexts nested inside eval code have the same closure as the context | 5192 // Contexts nested inside eval code have the same closure as the context |
| 5193 // calling eval, not the anonymous closure containing the eval code. | 5193 // calling eval, not the anonymous closure containing the eval code. |
| 5194 // Fetch it from the context. | 5194 // Fetch it from the context. |
| 5195 __ push(ContextOperand(esi, Context::CLOSURE_INDEX)); | 5195 __ push(ContextOperand(esi, Context::CLOSURE_INDEX)); |
| 5196 } else { | 5196 } else { |
| 5197 DCHECK(declaration_scope->is_function_scope()); | 5197 DCHECK(closure_scope->is_function_scope()); |
| 5198 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 5198 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
| 5199 } | 5199 } |
| 5200 } | 5200 } |
| 5201 | 5201 |
| 5202 | 5202 |
| 5203 // ---------------------------------------------------------------------------- | 5203 // ---------------------------------------------------------------------------- |
| 5204 // Non-local control flow support. | 5204 // Non-local control flow support. |
| 5205 | 5205 |
| 5206 void FullCodeGenerator::EnterFinallyBlock() { | 5206 void FullCodeGenerator::EnterFinallyBlock() { |
| 5207 // Cook return address on top of stack (smi encoded Code* delta) | 5207 // Cook return address on top of stack (smi encoded Code* delta) |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5338 Assembler::target_address_at(call_target_address, | 5338 Assembler::target_address_at(call_target_address, |
| 5339 unoptimized_code)); | 5339 unoptimized_code)); |
| 5340 return OSR_AFTER_STACK_CHECK; | 5340 return OSR_AFTER_STACK_CHECK; |
| 5341 } | 5341 } |
| 5342 | 5342 |
| 5343 | 5343 |
| 5344 } // namespace internal | 5344 } // namespace internal |
| 5345 } // namespace v8 | 5345 } // namespace v8 |
| 5346 | 5346 |
| 5347 #endif // V8_TARGET_ARCH_X87 | 5347 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |