| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // Possibly allocate a local context. | 175 // Possibly allocate a local context. |
| 176 int heap_slots = scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 176 int heap_slots = scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 177 if (heap_slots > 0) { | 177 if (heap_slots > 0) { |
| 178 Comment cmnt(masm_, "[ Allocate local context"); | 178 Comment cmnt(masm_, "[ Allocate local context"); |
| 179 // Argument to NewContext is the function, which is in r1. | 179 // Argument to NewContext is the function, which is in r1. |
| 180 __ push(r1); | 180 __ push(r1); |
| 181 if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 181 if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
| 182 FastNewContextStub stub(heap_slots); | 182 FastNewContextStub stub(heap_slots); |
| 183 __ CallStub(&stub); | 183 __ CallStub(&stub); |
| 184 } else { | 184 } else { |
| 185 __ CallRuntime(Runtime::kNewContext, 1); | 185 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
| 186 } | 186 } |
| 187 function_in_register = false; | 187 function_in_register = false; |
| 188 // Context is returned in both r0 and cp. It replaces the context | 188 // Context is returned in both r0 and cp. It replaces the context |
| 189 // passed to us. It's saved in the stack and kept live in cp. | 189 // passed to us. It's saved in the stack and kept live in cp. |
| 190 __ str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 190 __ str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 191 // Copy any necessary parameters into the context. | 191 // Copy any necessary parameters into the context. |
| 192 int num_parameters = scope()->num_parameters(); | 192 int num_parameters = scope()->num_parameters(); |
| 193 for (int i = 0; i < num_parameters; i++) { | 193 for (int i = 0; i < num_parameters; i++) { |
| 194 Slot* slot = scope()->parameter(i)->AsSlot(); | 194 Slot* slot = scope()->parameter(i)->AsSlot(); |
| 195 if (slot != NULL && slot->type() == Slot::CONTEXT) { | 195 if (slot != NULL && slot->type() == Slot::CONTEXT) { |
| (...skipping 4171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4367 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 4367 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
| 4368 __ add(pc, r1, Operand(masm_->CodeObject())); | 4368 __ add(pc, r1, Operand(masm_->CodeObject())); |
| 4369 } | 4369 } |
| 4370 | 4370 |
| 4371 | 4371 |
| 4372 #undef __ | 4372 #undef __ |
| 4373 | 4373 |
| 4374 } } // namespace v8::internal | 4374 } } // namespace v8::internal |
| 4375 | 4375 |
| 4376 #endif // V8_TARGET_ARCH_ARM | 4376 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |