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 4173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4184 ASSERT_EQ(POINTER_SIZE_ALIGN(frame_offset), frame_offset); | 4184 ASSERT_EQ(POINTER_SIZE_ALIGN(frame_offset), frame_offset); |
4185 __ str(value, MemOperand(fp, frame_offset)); | 4185 __ str(value, MemOperand(fp, frame_offset)); |
4186 } | 4186 } |
4187 | 4187 |
4188 | 4188 |
4189 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { | 4189 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { |
4190 __ ldr(dst, ContextOperand(cp, context_index)); | 4190 __ ldr(dst, ContextOperand(cp, context_index)); |
4191 } | 4191 } |
4192 | 4192 |
4193 | 4193 |
4194 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { | 4194 void FullCodeGenerator::PushFunctionArgumentForContextAllocation( |
| 4195 Register scratch) { |
4195 Scope* declaration_scope = scope()->DeclarationScope(); | 4196 Scope* declaration_scope = scope()->DeclarationScope(); |
4196 if (declaration_scope->is_global_scope()) { | 4197 if (declaration_scope->is_global_scope()) { |
4197 // Contexts nested in the global context have a canonical empty function | 4198 // Contexts nested in the global context have a canonical empty function |
4198 // as their closure, not the anonymous closure containing the global | 4199 // as their closure, not the anonymous closure containing the global |
4199 // code. Pass a smi sentinel and let the runtime look up the empty | 4200 // code. |
4200 // function. | 4201 __ ldr(scratch, GlobalObjectOperand()); |
4201 __ mov(ip, Operand(Smi::FromInt(0))); | 4202 __ ldr(scratch, |
| 4203 FieldMemOperand(scratch, GlobalObject::kGlobalContextOffset)); |
| 4204 __ ldr(scratch, ContextOperand(scratch, Context::CLOSURE_INDEX)); |
4202 } else if (declaration_scope->is_eval_scope()) { | 4205 } else if (declaration_scope->is_eval_scope()) { |
4203 // Contexts created by a call to eval have the same closure as the | 4206 // Contexts created by a call to eval have the same closure as the |
4204 // context calling eval, not the anonymous closure containing the eval | 4207 // context calling eval, not the anonymous closure containing the eval |
4205 // code. Fetch it from the context. | 4208 // code. Fetch it from the context. |
4206 __ ldr(ip, ContextOperand(cp, Context::CLOSURE_INDEX)); | 4209 __ ldr(scratch, ContextOperand(cp, Context::CLOSURE_INDEX)); |
4207 } else { | 4210 } else { |
4208 ASSERT(declaration_scope->is_function_scope()); | 4211 ASSERT(declaration_scope->is_function_scope()); |
4209 __ ldr(ip, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 4212 __ ldr(scratch, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
4210 } | 4213 } |
4211 __ push(ip); | 4214 __ push(scratch); |
4212 } | 4215 } |
4213 | 4216 |
4214 | 4217 |
4215 // ---------------------------------------------------------------------------- | 4218 // ---------------------------------------------------------------------------- |
4216 // Non-local control flow support. | 4219 // Non-local control flow support. |
4217 | 4220 |
4218 void FullCodeGenerator::EnterFinallyBlock() { | 4221 void FullCodeGenerator::EnterFinallyBlock() { |
4219 ASSERT(!result_register().is(r1)); | 4222 ASSERT(!result_register().is(r1)); |
4220 // Store result register while executing finally block. | 4223 // Store result register while executing finally block. |
4221 __ push(result_register()); | 4224 __ push(result_register()); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4266 *context_length = 0; | 4269 *context_length = 0; |
4267 return previous_; | 4270 return previous_; |
4268 } | 4271 } |
4269 | 4272 |
4270 | 4273 |
4271 #undef __ | 4274 #undef __ |
4272 | 4275 |
4273 } } // namespace v8::internal | 4276 } } // namespace v8::internal |
4274 | 4277 |
4275 #endif // V8_TARGET_ARCH_ARM | 4278 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |