OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4173 __ movq(Operand(rbp, frame_offset), value); | 4173 __ movq(Operand(rbp, frame_offset), value); |
4174 } | 4174 } |
4175 | 4175 |
4176 | 4176 |
4177 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { | 4177 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { |
4178 __ movq(dst, ContextOperand(rsi, context_index)); | 4178 __ movq(dst, ContextOperand(rsi, context_index)); |
4179 } | 4179 } |
4180 | 4180 |
4181 | 4181 |
4182 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { | 4182 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { |
4183 if (scope()->is_global_scope()) { | 4183 Scope* declaration_scope = scope()->DeclarationScope(); |
| 4184 if (declaration_scope->is_global_scope()) { |
4184 // Contexts nested in the global context have a canonical empty function | 4185 // Contexts nested in the global context have a canonical empty function |
4185 // as their closure, not the anonymous closure containing the global | 4186 // as their closure, not the anonymous closure containing the global |
4186 // code. Pass a smi sentinel and let the runtime look up the empty | 4187 // code. Pass a smi sentinel and let the runtime look up the empty |
4187 // function. | 4188 // function. |
4188 __ Push(Smi::FromInt(0)); | 4189 __ Push(Smi::FromInt(0)); |
4189 } else if (scope()->is_eval_scope()) { | 4190 } else if (declaration_scope->is_eval_scope()) { |
4190 // Contexts created by a call to eval have the same closure as the | 4191 // Contexts created by a call to eval have the same closure as the |
4191 // context calling eval, not the anonymous closure containing the eval | 4192 // context calling eval, not the anonymous closure containing the eval |
4192 // code. Fetch it from the context. | 4193 // code. Fetch it from the context. |
4193 __ push(ContextOperand(rsi, Context::CLOSURE_INDEX)); | 4194 __ push(ContextOperand(rsi, Context::CLOSURE_INDEX)); |
4194 } else { | 4195 } else { |
4195 ASSERT(scope()->is_function_scope() || scope()->is_catch_scope()); | 4196 ASSERT(declaration_scope->is_function_scope()); |
4196 __ push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 4197 __ push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
4197 } | 4198 } |
4198 } | 4199 } |
4199 | 4200 |
4200 | 4201 |
4201 // ---------------------------------------------------------------------------- | 4202 // ---------------------------------------------------------------------------- |
4202 // Non-local control flow support. | 4203 // Non-local control flow support. |
4203 | 4204 |
4204 | 4205 |
4205 void FullCodeGenerator::EnterFinallyBlock() { | 4206 void FullCodeGenerator::EnterFinallyBlock() { |
(...skipping 22 matching lines...) Expand all Loading... |
4228 __ jmp(rdx); | 4229 __ jmp(rdx); |
4229 } | 4230 } |
4230 | 4231 |
4231 | 4232 |
4232 #undef __ | 4233 #undef __ |
4233 | 4234 |
4234 | 4235 |
4235 } } // namespace v8::internal | 4236 } } // namespace v8::internal |
4236 | 4237 |
4237 #endif // V8_TARGET_ARCH_X64 | 4238 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |