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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // Possibly allocate a local context. | 177 // Possibly allocate a local context. |
178 int heap_slots = scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 178 int heap_slots = scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
179 if (heap_slots > 0) { | 179 if (heap_slots > 0) { |
180 Comment(";;; Allocate local context"); | 180 Comment(";;; Allocate local context"); |
181 // Argument to NewContext is the function, which is still in edi. | 181 // Argument to NewContext is the function, which is still in edi. |
182 __ push(edi); | 182 __ push(edi); |
183 if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 183 if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
184 FastNewContextStub stub(heap_slots); | 184 FastNewContextStub stub(heap_slots); |
185 __ CallStub(&stub); | 185 __ CallStub(&stub); |
186 } else { | 186 } else { |
187 __ CallRuntime(Runtime::kNewContext, 1); | 187 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
188 } | 188 } |
189 RecordSafepoint(Safepoint::kNoDeoptimizationIndex); | 189 RecordSafepoint(Safepoint::kNoDeoptimizationIndex); |
190 // Context is returned in both eax and esi. It replaces the context | 190 // Context is returned in both eax and esi. It replaces the context |
191 // passed to us. It's saved in the stack and kept live in esi. | 191 // passed to us. It's saved in the stack and kept live in esi. |
192 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi); | 192 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi); |
193 | 193 |
194 // Copy parameters into context if necessary. | 194 // Copy parameters into context if necessary. |
195 int num_parameters = scope()->num_parameters(); | 195 int num_parameters = scope()->num_parameters(); |
196 for (int i = 0; i < num_parameters; i++) { | 196 for (int i = 0; i < num_parameters; i++) { |
197 Slot* slot = scope()->parameter(i)->AsSlot(); | 197 Slot* slot = scope()->parameter(i)->AsSlot(); |
(...skipping 4246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4444 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 4444 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
4445 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); | 4445 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); |
4446 } | 4446 } |
4447 | 4447 |
4448 | 4448 |
4449 #undef __ | 4449 #undef __ |
4450 | 4450 |
4451 } } // namespace v8::internal | 4451 } } // namespace v8::internal |
4452 | 4452 |
4453 #endif // V8_TARGET_ARCH_IA32 | 4453 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |