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

Side by Side Diff: src/x64/full-codegen-x64.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 | « src/runtime.cc ('k') | no next file » | 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 4172 matching lines...) Expand 10 before | Expand all | Expand 10 after
4183 ASSERT(IsAligned(frame_offset, kPointerSize)); 4183 ASSERT(IsAligned(frame_offset, kPointerSize));
4184 __ movq(Operand(rbp, frame_offset), value); 4184 __ movq(Operand(rbp, frame_offset), value);
4185 } 4185 }
4186 4186
4187 4187
4188 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { 4188 void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
4189 __ movq(dst, ContextOperand(rsi, context_index)); 4189 __ movq(dst, ContextOperand(rsi, context_index));
4190 } 4190 }
4191 4191
4192 4192
4193 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
4194 if (scope()->is_global_scope()) {
4195 // Contexts nested in the global context have a canonical empty function
4196 // as their closure, not the anonymous closure containing the global
4197 // code. Pass a smi sentinel and let the runtime look up the empty
4198 // function.
4199 __ Push(Smi::FromInt(0));
4200 } else if (scope()->is_eval_scope()) {
4201 // Contexts created by a call to eval have the same closure as the
4202 // context calling eval, not the anonymous closure containing the eval
4203 // code. Fetch it from the context.
4204 __ push(ContextOperand(rsi, Context::CLOSURE_INDEX));
4205 } else {
4206 ASSERT(scope()->is_function_scope());
4207 __ push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
4208 }
4209 }
4210
4211
4193 // ---------------------------------------------------------------------------- 4212 // ----------------------------------------------------------------------------
4194 // Non-local control flow support. 4213 // Non-local control flow support.
4195 4214
4196 4215
4197 void FullCodeGenerator::EnterFinallyBlock() { 4216 void FullCodeGenerator::EnterFinallyBlock() {
4198 ASSERT(!result_register().is(rdx)); 4217 ASSERT(!result_register().is(rdx));
4199 ASSERT(!result_register().is(rcx)); 4218 ASSERT(!result_register().is(rcx));
4200 // Cook return address on top of stack (smi encoded Code* delta) 4219 // Cook return address on top of stack (smi encoded Code* delta)
4201 __ movq(rdx, Operand(rsp, 0)); 4220 __ movq(rdx, Operand(rsp, 0));
4202 __ Move(rcx, masm_->CodeObject()); 4221 __ Move(rcx, masm_->CodeObject());
(...skipping 20 matching lines...) Expand all
4223 __ ret(0); 4242 __ ret(0);
4224 } 4243 }
4225 4244
4226 4245
4227 #undef __ 4246 #undef __
4228 4247
4229 4248
4230 } } // namespace v8::internal 4249 } } // namespace v8::internal
4231 4250
4232 #endif // V8_TARGET_ARCH_X64 4251 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698