Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 7275022: Explicitly pass the closure when allocating a catch or with context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4244 matching lines...) Expand 10 before | Expand all | Expand 10 after
4255 ASSERT_EQ(POINTER_SIZE_ALIGN(frame_offset), frame_offset); 4255 ASSERT_EQ(POINTER_SIZE_ALIGN(frame_offset), frame_offset);
4256 __ str(value, MemOperand(fp, frame_offset)); 4256 __ str(value, MemOperand(fp, frame_offset));
4257 } 4257 }
4258 4258
4259 4259
4260 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { 4260 void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
4261 __ ldr(dst, ContextOperand(cp, context_index)); 4261 __ ldr(dst, ContextOperand(cp, context_index));
4262 } 4262 }
4263 4263
4264 4264
4265 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
4266 if (scope()->is_global_scope()) {
4267 // Contexts nested in the global context have a canonical empty function
4268 // as their closure, not the anonymous closure containing the global
4269 // code. Pass a smi sentinel and let the runtime look up the empty
4270 // function.
4271 __ mov(ip, Operand(Smi::FromInt(0)));
4272 } else if (scope()->is_eval_scope()) {
4273 // Contexts created by a call to eval have the same closure as the
4274 // context calling eval, not the anonymous closure containing the eval
4275 // code. Fetch it from the context.
4276 __ ldr(ip, ContextOperand(cp, Context::CLOSURE_INDEX));
4277 } else {
4278 ASSERT(scope()->is_function_scope());
4279 __ ldr(ip, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
4280 }
4281 __ push(ip);
4282 }
4283
4284
4265 // ---------------------------------------------------------------------------- 4285 // ----------------------------------------------------------------------------
4266 // Non-local control flow support. 4286 // Non-local control flow support.
4267 4287
4268 void FullCodeGenerator::EnterFinallyBlock() { 4288 void FullCodeGenerator::EnterFinallyBlock() {
4269 ASSERT(!result_register().is(r1)); 4289 ASSERT(!result_register().is(r1));
4270 // Store result register while executing finally block. 4290 // Store result register while executing finally block.
4271 __ push(result_register()); 4291 __ push(result_register());
4272 // Cook return address in link register to stack (smi encoded Code* delta) 4292 // Cook return address in link register to stack (smi encoded Code* delta)
4273 __ sub(r1, lr, Operand(masm_->CodeObject())); 4293 __ sub(r1, lr, Operand(masm_->CodeObject()));
4274 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); 4294 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
(...skipping 13 matching lines...) Expand all
4288 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 4308 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
4289 __ add(pc, r1, Operand(masm_->CodeObject())); 4309 __ add(pc, r1, Operand(masm_->CodeObject()));
4290 } 4310 }
4291 4311
4292 4312
4293 #undef __ 4313 #undef __
4294 4314
4295 } } // namespace v8::internal 4315 } } // namespace v8::internal
4296 4316
4297 #endif // V8_TARGET_ARCH_ARM 4317 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698