| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 2259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2270 | 2270 |
| 2271 __ bind(&done); | 2271 __ bind(&done); |
| 2272 context()->Plug(result_register()); | 2272 context()->Plug(result_register()); |
| 2273 } | 2273 } |
| 2274 | 2274 |
| 2275 | 2275 |
| 2276 void FullCodeGenerator::EmitCreateIteratorResult(bool done) { | 2276 void FullCodeGenerator::EmitCreateIteratorResult(bool done) { |
| 2277 Label gc_required; | 2277 Label gc_required; |
| 2278 Label allocated; | 2278 Label allocated; |
| 2279 | 2279 |
| 2280 Handle<Map> map(isolate()->native_context()->iterator_result_map()); | 2280 const int instance_size = 5 * kPointerSize; |
| 2281 DCHECK_EQ(isolate()->native_context()->iterator_result_map()->instance_size(), |
| 2282 instance_size); |
| 2281 | 2283 |
| 2282 __ Allocate(map->instance_size(), rax, rcx, rdx, &gc_required, TAG_OBJECT); | 2284 __ Allocate(instance_size, rax, rcx, rdx, &gc_required, TAG_OBJECT); |
| 2283 __ jmp(&allocated); | 2285 __ jmp(&allocated); |
| 2284 | 2286 |
| 2285 __ bind(&gc_required); | 2287 __ bind(&gc_required); |
| 2286 __ Push(Smi::FromInt(map->instance_size())); | 2288 __ Push(Smi::FromInt(instance_size)); |
| 2287 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); | 2289 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); |
| 2288 __ movp(context_register(), | 2290 __ movp(context_register(), |
| 2289 Operand(rbp, StandardFrameConstants::kContextOffset)); | 2291 Operand(rbp, StandardFrameConstants::kContextOffset)); |
| 2290 | 2292 |
| 2291 __ bind(&allocated); | 2293 __ bind(&allocated); |
| 2292 __ Move(rbx, map); | 2294 __ movp(rbx, Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
| 2295 __ movp(rbx, FieldOperand(rbx, GlobalObject::kNativeContextOffset)); |
| 2296 __ movp(rbx, ContextOperand(rbx, Context::ITERATOR_RESULT_MAP_INDEX)); |
| 2293 __ Pop(rcx); | 2297 __ Pop(rcx); |
| 2294 __ Move(rdx, isolate()->factory()->ToBoolean(done)); | 2298 __ Move(rdx, isolate()->factory()->ToBoolean(done)); |
| 2295 DCHECK_EQ(map->instance_size(), 5 * kPointerSize); | |
| 2296 __ movp(FieldOperand(rax, HeapObject::kMapOffset), rbx); | 2299 __ movp(FieldOperand(rax, HeapObject::kMapOffset), rbx); |
| 2297 __ Move(FieldOperand(rax, JSObject::kPropertiesOffset), | 2300 __ Move(FieldOperand(rax, JSObject::kPropertiesOffset), |
| 2298 isolate()->factory()->empty_fixed_array()); | 2301 isolate()->factory()->empty_fixed_array()); |
| 2299 __ Move(FieldOperand(rax, JSObject::kElementsOffset), | 2302 __ Move(FieldOperand(rax, JSObject::kElementsOffset), |
| 2300 isolate()->factory()->empty_fixed_array()); | 2303 isolate()->factory()->empty_fixed_array()); |
| 2301 __ movp(FieldOperand(rax, JSGeneratorObject::kResultValuePropertyOffset), | 2304 __ movp(FieldOperand(rax, JSGeneratorObject::kResultValuePropertyOffset), |
| 2302 rcx); | 2305 rcx); |
| 2303 __ movp(FieldOperand(rax, JSGeneratorObject::kResultDonePropertyOffset), | 2306 __ movp(FieldOperand(rax, JSGeneratorObject::kResultDonePropertyOffset), |
| 2304 rdx); | 2307 rdx); |
| 2305 | 2308 |
| (...skipping 2932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5238 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5241 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 5239 Assembler::target_address_at(call_target_address, | 5242 Assembler::target_address_at(call_target_address, |
| 5240 unoptimized_code)); | 5243 unoptimized_code)); |
| 5241 return OSR_AFTER_STACK_CHECK; | 5244 return OSR_AFTER_STACK_CHECK; |
| 5242 } | 5245 } |
| 5243 | 5246 |
| 5244 | 5247 |
| 5245 } } // namespace v8::internal | 5248 } } // namespace v8::internal |
| 5246 | 5249 |
| 5247 #endif // V8_TARGET_ARCH_X64 | 5250 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |