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 4227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4238 ASSERT_EQ(POINTER_SIZE_ALIGN(frame_offset), frame_offset); | 4238 ASSERT_EQ(POINTER_SIZE_ALIGN(frame_offset), frame_offset); |
4239 __ sw(value, MemOperand(fp, frame_offset)); | 4239 __ sw(value, MemOperand(fp, frame_offset)); |
4240 } | 4240 } |
4241 | 4241 |
4242 | 4242 |
4243 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { | 4243 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { |
4244 __ lw(dst, ContextOperand(cp, context_index)); | 4244 __ lw(dst, ContextOperand(cp, context_index)); |
4245 } | 4245 } |
4246 | 4246 |
4247 | 4247 |
| 4248 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { |
| 4249 if (scope()->is_global_scope()) { |
| 4250 // Contexts nested in the global context have a canonical empty function |
| 4251 // as their closure, not the anonymous closure containing the global |
| 4252 // code. Pass a smi sentinel and let the runtime look up the empty |
| 4253 // function. |
| 4254 __ li(at, Operand(Smi::FromInt(0))); |
| 4255 } else if (scope()->is_eval_scope()) { |
| 4256 // Contexts created by a call to eval have the same closure as the |
| 4257 // context calling eval, not the anonymous closure containing the eval |
| 4258 // code. Fetch it from the context. |
| 4259 __ lw(at, ContextOperand(cp, Context::CLOSURE_INDEX)); |
| 4260 } else { |
| 4261 ASSERT(scope()->is_function_scope()); |
| 4262 __ lw(at, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 4263 } |
| 4264 __ push(at); |
| 4265 } |
| 4266 |
| 4267 |
4248 // ---------------------------------------------------------------------------- | 4268 // ---------------------------------------------------------------------------- |
4249 // Non-local control flow support. | 4269 // Non-local control flow support. |
4250 | 4270 |
4251 void FullCodeGenerator::EnterFinallyBlock() { | 4271 void FullCodeGenerator::EnterFinallyBlock() { |
4252 ASSERT(!result_register().is(a1)); | 4272 ASSERT(!result_register().is(a1)); |
4253 // Store result register while executing finally block. | 4273 // Store result register while executing finally block. |
4254 __ push(result_register()); | 4274 __ push(result_register()); |
4255 // Cook return address in link register to stack (smi encoded Code* delta). | 4275 // Cook return address in link register to stack (smi encoded Code* delta). |
4256 __ Subu(a1, ra, Operand(masm_->CodeObject())); | 4276 __ Subu(a1, ra, Operand(masm_->CodeObject())); |
4257 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); | 4277 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); |
(...skipping 14 matching lines...) Expand all Loading... |
4272 __ Addu(at, a1, Operand(masm_->CodeObject())); | 4292 __ Addu(at, a1, Operand(masm_->CodeObject())); |
4273 __ Jump(at); | 4293 __ Jump(at); |
4274 } | 4294 } |
4275 | 4295 |
4276 | 4296 |
4277 #undef __ | 4297 #undef __ |
4278 | 4298 |
4279 } } // namespace v8::internal | 4299 } } // namespace v8::internal |
4280 | 4300 |
4281 #endif // V8_TARGET_ARCH_MIPS | 4301 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |