| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // Possibly allocate a local context. | 182 // Possibly allocate a local context. |
| 183 int heap_slots = scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 183 int heap_slots = scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 184 if (heap_slots > 0) { | 184 if (heap_slots > 0) { |
| 185 Comment cmnt(masm_, "[ Allocate local context"); | 185 Comment cmnt(masm_, "[ Allocate local context"); |
| 186 // Argument to NewContext is the function, which is in a1. | 186 // Argument to NewContext is the function, which is in a1. |
| 187 __ push(a1); | 187 __ push(a1); |
| 188 if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 188 if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
| 189 FastNewContextStub stub(heap_slots); | 189 FastNewContextStub stub(heap_slots); |
| 190 __ CallStub(&stub); | 190 __ CallStub(&stub); |
| 191 } else { | 191 } else { |
| 192 __ CallRuntime(Runtime::kNewContext, 1); | 192 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
| 193 } | 193 } |
| 194 function_in_register = false; | 194 function_in_register = false; |
| 195 // Context is returned in both v0 and cp. It replaces the context | 195 // Context is returned in both v0 and cp. It replaces the context |
| 196 // passed to us. It's saved in the stack and kept live in cp. | 196 // passed to us. It's saved in the stack and kept live in cp. |
| 197 __ sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 197 __ sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 198 // Copy any necessary parameters into the context. | 198 // Copy any necessary parameters into the context. |
| 199 int num_parameters = scope()->num_parameters(); | 199 int num_parameters = scope()->num_parameters(); |
| 200 for (int i = 0; i < num_parameters; i++) { | 200 for (int i = 0; i < num_parameters; i++) { |
| 201 Slot* slot = scope()->parameter(i)->AsSlot(); | 201 Slot* slot = scope()->parameter(i)->AsSlot(); |
| 202 if (slot != NULL && slot->type() == Slot::CONTEXT) { | 202 if (slot != NULL && slot->type() == Slot::CONTEXT) { |
| (...skipping 4174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4377 __ Addu(at, a1, Operand(masm_->CodeObject())); | 4377 __ Addu(at, a1, Operand(masm_->CodeObject())); |
| 4378 __ Jump(at); | 4378 __ Jump(at); |
| 4379 } | 4379 } |
| 4380 | 4380 |
| 4381 | 4381 |
| 4382 #undef __ | 4382 #undef __ |
| 4383 | 4383 |
| 4384 } } // namespace v8::internal | 4384 } } // namespace v8::internal |
| 4385 | 4385 |
| 4386 #endif // V8_TARGET_ARCH_MIPS | 4386 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |