Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 9179010: Fix and enable NEW_NON_STRICT_FAST ArgumentsAccess stub on x64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/x64/full-codegen-x64.cc » ('j') | src/x64/full-codegen-x64.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2304 __ push(rdx); 2304 __ push(rdx);
2305 __ push(rbx); 2305 __ push(rbx);
2306 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); 2306 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1);
2307 } 2307 }
2308 2308
2309 2309
2310 void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) { 2310 void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) {
2311 // Stack layout: 2311 // Stack layout:
2312 // rsp[0] : return address 2312 // rsp[0] : return address
2313 // rsp[8] : number of parameters (tagged) 2313 // rsp[8] : number of parameters (tagged)
2314 // rsp[16] : receiver displacement 2314 // rsp[16] : receiver displacement
fschneider 2012/01/16 14:25:07 The comment is misleading: This argument is an abs
2315 // rsp[24] : function 2315 // rsp[24] : function
2316 // Registers used over the whole function: 2316 // Registers used over the whole function:
2317 // rbx: the mapped parameter count (untagged) 2317 // rbx: the mapped parameter count (untagged)
2318 // rax: the allocated object (tagged). 2318 // rax: the allocated object (tagged).
2319 2319
2320 Factory* factory = masm->isolate()->factory(); 2320 Factory* factory = masm->isolate()->factory();
2321 2321
2322 __ SmiToInteger64(rbx, Operand(rsp, 1 * kPointerSize)); 2322 __ SmiToInteger64(rbx, Operand(rsp, 1 * kPointerSize));
2323 // rbx = parameter count (untagged) 2323 // rbx = parameter count (untagged)
2324 2324
(...skipping 25 matching lines...) Expand all
2350 __ j(less_equal, &try_allocate, Label::kNear); 2350 __ j(less_equal, &try_allocate, Label::kNear);
2351 __ movq(rbx, rcx); 2351 __ movq(rbx, rcx);
2352 2352
2353 __ bind(&try_allocate); 2353 __ bind(&try_allocate);
2354 2354
2355 // Compute the sizes of backing store, parameter map, and arguments object. 2355 // Compute the sizes of backing store, parameter map, and arguments object.
2356 // 1. Parameter map, has 2 extra words containing context and backing store. 2356 // 1. Parameter map, has 2 extra words containing context and backing store.
2357 const int kParameterMapHeaderSize = 2357 const int kParameterMapHeaderSize =
2358 FixedArray::kHeaderSize + 2 * kPointerSize; 2358 FixedArray::kHeaderSize + 2 * kPointerSize;
2359 Label no_parameter_map; 2359 Label no_parameter_map;
2360 __ xor_(r8, r8);
2360 __ testq(rbx, rbx); 2361 __ testq(rbx, rbx);
2361 __ j(zero, &no_parameter_map, Label::kNear); 2362 __ j(zero, &no_parameter_map, Label::kNear);
2362 __ lea(r8, Operand(rbx, times_pointer_size, kParameterMapHeaderSize)); 2363 __ lea(r8, Operand(rbx, times_pointer_size, kParameterMapHeaderSize));
2363 __ bind(&no_parameter_map); 2364 __ bind(&no_parameter_map);
2364 2365
2365 // 2. Backing store. 2366 // 2. Backing store.
2366 __ lea(r8, Operand(r8, rcx, times_pointer_size, FixedArray::kHeaderSize)); 2367 __ lea(r8, Operand(r8, rcx, times_pointer_size, FixedArray::kHeaderSize));
2367 2368
2368 // 3. Arguments object. 2369 // 3. Arguments object.
2369 __ addq(r8, Immediate(Heap::kArgumentsObjectSize)); 2370 __ addq(r8, Immediate(Heap::kArgumentsObjectSize));
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2443 // We need to fill in mapped_parameter_count slots. They index the context, 2444 // We need to fill in mapped_parameter_count slots. They index the context,
2444 // where parameters are stored in reverse order, at 2445 // where parameters are stored in reverse order, at
2445 // MIN_CONTEXT_SLOTS .. MIN_CONTEXT_SLOTS+parameter_count-1 2446 // MIN_CONTEXT_SLOTS .. MIN_CONTEXT_SLOTS+parameter_count-1
2446 // The mapped parameter thus need to get indices 2447 // The mapped parameter thus need to get indices
2447 // MIN_CONTEXT_SLOTS+parameter_count-1 .. 2448 // MIN_CONTEXT_SLOTS+parameter_count-1 ..
2448 // MIN_CONTEXT_SLOTS+parameter_count-mapped_parameter_count 2449 // MIN_CONTEXT_SLOTS+parameter_count-mapped_parameter_count
2449 // We loop from right to left. 2450 // We loop from right to left.
2450 Label parameters_loop, parameters_test; 2451 Label parameters_loop, parameters_test;
2451 2452
2452 // Load tagged parameter count into r9. 2453 // Load tagged parameter count into r9.
2453 __ movq(r9, Operand(rsp, 1 * kPointerSize)); 2454 __ Integer64PlusConstantToSmi(r9, rbx, 0);
fschneider 2012/01/16 14:25:07 Isn't there an instruction to make a smi without a
2454 __ Move(r8, Smi::FromInt(Context::MIN_CONTEXT_SLOTS)); 2455 __ Move(r8, Smi::FromInt(Context::MIN_CONTEXT_SLOTS));
2455 __ addq(r8, Operand(rsp, 3 * kPointerSize)); 2456 __ addq(r8, Operand(rsp, 1 * kPointerSize));
2456 __ subq(r8, r9); 2457 __ subq(r8, r9);
2457 __ Move(r11, factory->the_hole_value()); 2458 __ Move(r11, factory->the_hole_value());
2458 __ movq(rdx, rdi); 2459 __ movq(rdx, rdi);
2459 __ SmiToInteger64(kScratchRegister, r9); 2460 __ lea(rdi, Operand(rdi, rbx, times_pointer_size, kParameterMapHeaderSize));
2460 __ lea(rdi, Operand(rdi, kScratchRegister,
2461 times_pointer_size,
2462 kParameterMapHeaderSize));
2463 // r9 = loop variable (tagged) 2461 // r9 = loop variable (tagged)
2464 // r8 = mapping index (tagged) 2462 // r8 = mapping index (tagged)
2465 // r11 = the hole value 2463 // r11 = the hole value
2466 // rdx = address of parameter map (tagged) 2464 // rdx = address of parameter map (tagged)
2467 // rdi = address of backing store (tagged) 2465 // rdi = address of backing store (tagged)
2468 __ jmp(&parameters_test, Label::kNear); 2466 __ jmp(&parameters_test, Label::kNear);
2469 2467
2470 __ bind(&parameters_loop); 2468 __ bind(&parameters_loop);
2471 __ SmiSubConstant(r9, r9, Smi::FromInt(1)); 2469 __ SmiSubConstant(r9, r9, Smi::FromInt(1));
2472 __ SmiToInteger64(kScratchRegister, r9); 2470 __ SmiToInteger64(kScratchRegister, r9);
(...skipping 15 matching lines...) Expand all
2488 // rcx = argument count (tagged) 2486 // rcx = argument count (tagged)
2489 // rdi = address of backing store (tagged) 2487 // rdi = address of backing store (tagged)
2490 // Copy arguments header and remaining slots (if there are any). 2488 // Copy arguments header and remaining slots (if there are any).
2491 __ Move(FieldOperand(rdi, FixedArray::kMapOffset), 2489 __ Move(FieldOperand(rdi, FixedArray::kMapOffset),
2492 factory->fixed_array_map()); 2490 factory->fixed_array_map());
2493 __ movq(FieldOperand(rdi, FixedArray::kLengthOffset), rcx); 2491 __ movq(FieldOperand(rdi, FixedArray::kLengthOffset), rcx);
2494 2492
2495 Label arguments_loop, arguments_test; 2493 Label arguments_loop, arguments_test;
2496 __ movq(r8, rbx); 2494 __ movq(r8, rbx);
2497 __ movq(rdx, Operand(rsp, 2 * kPointerSize)); 2495 __ movq(rdx, Operand(rsp, 2 * kPointerSize));
2498 // Untag rcx and r8 for the loop below. 2496 // Untag rcx and r8 for the loop below.
fschneider 2012/01/16 14:25:07 Comment should say: Untag rcx for the loop below.
2499 __ SmiToInteger64(rcx, rcx); 2497 __ SmiToInteger64(rcx, rcx);
2500 __ SmiToInteger64(r8, r8);
2501 __ lea(kScratchRegister, Operand(r8, times_pointer_size, 0)); 2498 __ lea(kScratchRegister, Operand(r8, times_pointer_size, 0));
2502 __ subq(rdx, kScratchRegister); 2499 __ subq(rdx, kScratchRegister);
2503 __ jmp(&arguments_test, Label::kNear); 2500 __ jmp(&arguments_test, Label::kNear);
2504 2501
2505 __ bind(&arguments_loop); 2502 __ bind(&arguments_loop);
2506 __ subq(rdx, Immediate(kPointerSize)); 2503 __ subq(rdx, Immediate(kPointerSize));
2507 __ movq(r9, Operand(rdx, 0)); 2504 __ movq(r9, Operand(rdx, 0));
2508 __ movq(FieldOperand(rdi, r8, 2505 __ movq(FieldOperand(rdi, r8,
2509 times_pointer_size, 2506 times_pointer_size,
2510 FixedArray::kHeaderSize), 2507 FixedArray::kHeaderSize),
(...skipping 3724 matching lines...) Expand 10 before | Expand all | Expand 10 after
6235 xmm0, 6232 xmm0,
6236 &slow_elements); 6233 &slow_elements);
6237 __ ret(0); 6234 __ ret(0);
6238 } 6235 }
6239 6236
6240 #undef __ 6237 #undef __
6241 6238
6242 } } // namespace v8::internal 6239 } } // namespace v8::internal
6243 6240
6244 #endif // V8_TARGET_ARCH_X64 6241 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | src/x64/full-codegen-x64.cc » ('j') | src/x64/full-codegen-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698