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 4208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4219 __ sw(value, MemOperand(fp, frame_offset)); | 4219 __ sw(value, MemOperand(fp, frame_offset)); |
4220 } | 4220 } |
4221 | 4221 |
4222 | 4222 |
4223 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { | 4223 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { |
4224 __ lw(dst, ContextOperand(cp, context_index)); | 4224 __ lw(dst, ContextOperand(cp, context_index)); |
4225 } | 4225 } |
4226 | 4226 |
4227 | 4227 |
4228 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { | 4228 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { |
4229 if (scope()->is_global_scope()) { | 4229 Scope* declaration_scope = scope()->DeclarationScope(); |
| 4230 if (declaration_scope->is_global_scope()) { |
4230 // Contexts nested in the global context have a canonical empty function | 4231 // Contexts nested in the global context have a canonical empty function |
4231 // as their closure, not the anonymous closure containing the global | 4232 // as their closure, not the anonymous closure containing the global |
4232 // code. Pass a smi sentinel and let the runtime look up the empty | 4233 // code. Pass a smi sentinel and let the runtime look up the empty |
4233 // function. | 4234 // function. |
4234 __ li(at, Operand(Smi::FromInt(0))); | 4235 __ li(at, Operand(Smi::FromInt(0))); |
4235 } else if (scope()->is_eval_scope()) { | 4236 } else if (declaration_scope->is_eval_scope()) { |
4236 // Contexts created by a call to eval have the same closure as the | 4237 // Contexts created by a call to eval have the same closure as the |
4237 // context calling eval, not the anonymous closure containing the eval | 4238 // context calling eval, not the anonymous closure containing the eval |
4238 // code. Fetch it from the context. | 4239 // code. Fetch it from the context. |
4239 __ lw(at, ContextOperand(cp, Context::CLOSURE_INDEX)); | 4240 __ lw(at, ContextOperand(cp, Context::CLOSURE_INDEX)); |
4240 } else { | 4241 } else { |
4241 ASSERT(scope()->is_function_scope()); | 4242 ASSERT(declaration_scope->is_function_scope()); |
4242 __ lw(at, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 4243 __ lw(at, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
4243 } | 4244 } |
4244 __ push(at); | 4245 __ push(at); |
4245 } | 4246 } |
4246 | 4247 |
4247 | 4248 |
4248 // ---------------------------------------------------------------------------- | 4249 // ---------------------------------------------------------------------------- |
4249 // Non-local control flow support. | 4250 // Non-local control flow support. |
4250 | 4251 |
4251 void FullCodeGenerator::EnterFinallyBlock() { | 4252 void FullCodeGenerator::EnterFinallyBlock() { |
(...skipping 20 matching lines...) Expand all Loading... |
4272 __ Addu(at, a1, Operand(masm_->CodeObject())); | 4273 __ Addu(at, a1, Operand(masm_->CodeObject())); |
4273 __ Jump(at); | 4274 __ Jump(at); |
4274 } | 4275 } |
4275 | 4276 |
4276 | 4277 |
4277 #undef __ | 4278 #undef __ |
4278 | 4279 |
4279 } } // namespace v8::internal | 4280 } } // namespace v8::internal |
4280 | 4281 |
4281 #endif // V8_TARGET_ARCH_MIPS | 4282 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |