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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // Possibly allocate a local context. | 168 // Possibly allocate a local context. |
169 int heap_slots = scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 169 int heap_slots = scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
170 if (heap_slots > 0) { | 170 if (heap_slots > 0) { |
171 Comment cmnt(masm_, "[ Allocate local context"); | 171 Comment cmnt(masm_, "[ Allocate local context"); |
172 // Argument to NewContext is the function, which is still in edi. | 172 // Argument to NewContext is the function, which is still in edi. |
173 __ push(edi); | 173 __ push(edi); |
174 if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 174 if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
175 FastNewContextStub stub(heap_slots); | 175 FastNewContextStub stub(heap_slots); |
176 __ CallStub(&stub); | 176 __ CallStub(&stub); |
177 } else { | 177 } else { |
178 __ CallRuntime(Runtime::kNewContext, 1); | 178 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
179 } | 179 } |
180 function_in_register = false; | 180 function_in_register = false; |
181 // Context is returned in both eax and esi. It replaces the context | 181 // Context is returned in both eax and esi. It replaces the context |
182 // passed to us. It's saved in the stack and kept live in esi. | 182 // passed to us. It's saved in the stack and kept live in esi. |
183 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi); | 183 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi); |
184 | 184 |
185 // Copy parameters into context if necessary. | 185 // Copy parameters into context if necessary. |
186 int num_parameters = scope()->num_parameters(); | 186 int num_parameters = scope()->num_parameters(); |
187 for (int i = 0; i < num_parameters; i++) { | 187 for (int i = 0; i < num_parameters; i++) { |
188 Slot* slot = scope()->parameter(i)->AsSlot(); | 188 Slot* slot = scope()->parameter(i)->AsSlot(); |
(...skipping 4141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4330 // And return. | 4330 // And return. |
4331 __ ret(0); | 4331 __ ret(0); |
4332 } | 4332 } |
4333 | 4333 |
4334 | 4334 |
4335 #undef __ | 4335 #undef __ |
4336 | 4336 |
4337 } } // namespace v8::internal | 4337 } } // namespace v8::internal |
4338 | 4338 |
4339 #endif // V8_TARGET_ARCH_IA32 | 4339 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |