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

Side by Side Diff: src/ia32/codegen-ia32.cc

Issue 605024: Port arguments object allocation in generated code to ARM and x64.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 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 | « src/arm/codegen-arm.cc ('k') | src/x64/assembler-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 8502 matching lines...) Expand 10 before | Expand all | Expand 10 after
8513 // by calling the runtime system. 8513 // by calling the runtime system.
8514 __ bind(&slow); 8514 __ bind(&slow);
8515 __ pop(ebx); // Return address. 8515 __ pop(ebx); // Return address.
8516 __ push(edx); 8516 __ push(edx);
8517 __ push(ebx); 8517 __ push(ebx);
8518 __ TailCallRuntime(ExternalReference(Runtime::kGetArgumentsProperty), 1, 1); 8518 __ TailCallRuntime(ExternalReference(Runtime::kGetArgumentsProperty), 1, 1);
8519 } 8519 }
8520 8520
8521 8521
8522 void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) { 8522 void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
8523 // esp[0] : return address
8524 // esp[4] : number of parameters
8525 // esp[8] : receiver displacement
8526 // esp[16] : function
8527
8523 // The displacement is used for skipping the return address and the 8528 // The displacement is used for skipping the return address and the
8524 // frame pointer on the stack. It is the offset of the last 8529 // frame pointer on the stack. It is the offset of the last
8525 // parameter (if any) relative to the frame pointer. 8530 // parameter (if any) relative to the frame pointer.
8526 static const int kDisplacement = 2 * kPointerSize; 8531 static const int kDisplacement = 2 * kPointerSize;
8527 8532
8528 // Check if the calling frame is an arguments adaptor frame. 8533 // Check if the calling frame is an arguments adaptor frame.
8529 Label adaptor_frame, try_allocate, runtime; 8534 Label adaptor_frame, try_allocate, runtime;
8530 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); 8535 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
8531 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); 8536 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset));
8532 __ cmp(Operand(ecx), Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 8537 __ cmp(Operand(ecx), Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
8596 __ mov(FieldOperand(edi, FixedArray::kLengthOffset), ecx); 8601 __ mov(FieldOperand(edi, FixedArray::kLengthOffset), ecx);
8597 8602
8598 // Copy the fixed array slots. 8603 // Copy the fixed array slots.
8599 Label loop; 8604 Label loop;
8600 __ bind(&loop); 8605 __ bind(&loop);
8601 __ mov(ebx, Operand(edx, -1 * kPointerSize)); // Skip receiver. 8606 __ mov(ebx, Operand(edx, -1 * kPointerSize)); // Skip receiver.
8602 __ mov(FieldOperand(edi, FixedArray::kHeaderSize), ebx); 8607 __ mov(FieldOperand(edi, FixedArray::kHeaderSize), ebx);
8603 __ add(Operand(edi), Immediate(kPointerSize)); 8608 __ add(Operand(edi), Immediate(kPointerSize));
8604 __ sub(Operand(edx), Immediate(kPointerSize)); 8609 __ sub(Operand(edx), Immediate(kPointerSize));
8605 __ dec(ecx); 8610 __ dec(ecx);
8606 __ test(ecx, Operand(ecx));
8607 __ j(not_zero, &loop); 8611 __ j(not_zero, &loop);
8608 8612
8609 // Return and remove the on-stack parameters. 8613 // Return and remove the on-stack parameters.
8610 __ bind(&done); 8614 __ bind(&done);
8611 __ ret(3 * kPointerSize); 8615 __ ret(3 * kPointerSize);
8612 8616
8613 // Do the runtime call to allocate the arguments object. 8617 // Do the runtime call to allocate the arguments object.
8614 __ bind(&runtime); 8618 __ bind(&runtime);
8615 __ TailCallRuntime(ExternalReference(Runtime::kNewArgumentsFast), 3, 1); 8619 __ TailCallRuntime(ExternalReference(Runtime::kNewArgumentsFast), 3, 1);
8616 } 8620 }
(...skipping 1929 matching lines...) Expand 10 before | Expand all | Expand 10 after
10546 10550
10547 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) 10551 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
10548 // tagged as a small integer. 10552 // tagged as a small integer.
10549 __ bind(&runtime); 10553 __ bind(&runtime);
10550 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); 10554 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1);
10551 } 10555 }
10552 10556
10553 #undef __ 10557 #undef __
10554 10558
10555 } } // namespace v8::internal 10559 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/x64/assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698