| 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 rdi. | 172 // Argument to NewContext is the function, which is still in rdi. |
| 173 __ push(rdi); | 173 __ push(rdi); |
| 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 rax and rsi. It replaces the context | 181 // Context is returned in both rax and rsi. It replaces the context |
| 182 // passed to us. It's saved in the stack and kept live in rsi. | 182 // passed to us. It's saved in the stack and kept live in rsi. |
| 183 __ movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi); | 183 __ movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi); |
| 184 | 184 |
| 185 // Copy any necessary parameters into the context. | 185 // Copy any necessary parameters into the context. |
| 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 4122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4311 __ ret(0); | 4311 __ ret(0); |
| 4312 } | 4312 } |
| 4313 | 4313 |
| 4314 | 4314 |
| 4315 #undef __ | 4315 #undef __ |
| 4316 | 4316 |
| 4317 | 4317 |
| 4318 } } // namespace v8::internal | 4318 } } // namespace v8::internal |
| 4319 | 4319 |
| 4320 #endif // V8_TARGET_ARCH_X64 | 4320 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |