| 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 4225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4236 __ str(value, MemOperand(fp, frame_offset)); | 4236 __ str(value, MemOperand(fp, frame_offset)); |
| 4237 } | 4237 } |
| 4238 | 4238 |
| 4239 | 4239 |
| 4240 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { | 4240 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { |
| 4241 __ ldr(dst, ContextOperand(cp, context_index)); | 4241 __ ldr(dst, ContextOperand(cp, context_index)); |
| 4242 } | 4242 } |
| 4243 | 4243 |
| 4244 | 4244 |
| 4245 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { | 4245 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { |
| 4246 if (scope()->is_global_scope()) { | 4246 Scope* declaration_scope = scope()->DeclarationScope(); |
| 4247 if (declaration_scope->is_global_scope()) { |
| 4247 // Contexts nested in the global context have a canonical empty function | 4248 // Contexts nested in the global context have a canonical empty function |
| 4248 // as their closure, not the anonymous closure containing the global | 4249 // as their closure, not the anonymous closure containing the global |
| 4249 // code. Pass a smi sentinel and let the runtime look up the empty | 4250 // code. Pass a smi sentinel and let the runtime look up the empty |
| 4250 // function. | 4251 // function. |
| 4251 __ mov(ip, Operand(Smi::FromInt(0))); | 4252 __ mov(ip, Operand(Smi::FromInt(0))); |
| 4252 } else if (scope()->is_eval_scope()) { | 4253 } else if (declaration_scope->is_eval_scope()) { |
| 4253 // Contexts created by a call to eval have the same closure as the | 4254 // Contexts created by a call to eval have the same closure as the |
| 4254 // context calling eval, not the anonymous closure containing the eval | 4255 // context calling eval, not the anonymous closure containing the eval |
| 4255 // code. Fetch it from the context. | 4256 // code. Fetch it from the context. |
| 4256 __ ldr(ip, ContextOperand(cp, Context::CLOSURE_INDEX)); | 4257 __ ldr(ip, ContextOperand(cp, Context::CLOSURE_INDEX)); |
| 4257 } else { | 4258 } else { |
| 4258 ASSERT(scope()->is_function_scope() || scope()->is_catch_scope()); | 4259 ASSERT(declaration_scope->is_function_scope()); |
| 4259 __ ldr(ip, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 4260 __ ldr(ip, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 4260 } | 4261 } |
| 4261 __ push(ip); | 4262 __ push(ip); |
| 4262 } | 4263 } |
| 4263 | 4264 |
| 4264 | 4265 |
| 4265 // ---------------------------------------------------------------------------- | 4266 // ---------------------------------------------------------------------------- |
| 4266 // Non-local control flow support. | 4267 // Non-local control flow support. |
| 4267 | 4268 |
| 4268 void FullCodeGenerator::EnterFinallyBlock() { | 4269 void FullCodeGenerator::EnterFinallyBlock() { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 4288 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 4289 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
| 4289 __ add(pc, r1, Operand(masm_->CodeObject())); | 4290 __ add(pc, r1, Operand(masm_->CodeObject())); |
| 4290 } | 4291 } |
| 4291 | 4292 |
| 4292 | 4293 |
| 4293 #undef __ | 4294 #undef __ |
| 4294 | 4295 |
| 4295 } } // namespace v8::internal | 4296 } } // namespace v8::internal |
| 4296 | 4297 |
| 4297 #endif // V8_TARGET_ARCH_ARM | 4298 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |