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

Side by Side Diff: src/mips/builtins-mips.cc

Issue 7328013: MIPS: Cleaned up calling-related methods in the assembler. (Closed)
Patch Set: Created 9 years, 5 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
« no previous file with comments | « src/mips/assembler-mips.h ('k') | src/mips/code-stubs-mips.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 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 __ And(t0, a1, Operand(kSmiTagMask)); 627 __ And(t0, a1, Operand(kSmiTagMask));
628 __ Branch(&non_function_call, eq, t0, Operand(zero_reg)); 628 __ Branch(&non_function_call, eq, t0, Operand(zero_reg));
629 // Check that the function is a JSFunction. 629 // Check that the function is a JSFunction.
630 __ GetObjectType(a1, a2, a2); 630 __ GetObjectType(a1, a2, a2);
631 __ Branch(&non_function_call, ne, a2, Operand(JS_FUNCTION_TYPE)); 631 __ Branch(&non_function_call, ne, a2, Operand(JS_FUNCTION_TYPE));
632 632
633 // Jump to the function-specific construct stub. 633 // Jump to the function-specific construct stub.
634 __ lw(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 634 __ lw(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
635 __ lw(a2, FieldMemOperand(a2, SharedFunctionInfo::kConstructStubOffset)); 635 __ lw(a2, FieldMemOperand(a2, SharedFunctionInfo::kConstructStubOffset));
636 __ Addu(t9, a2, Operand(Code::kHeaderSize - kHeapObjectTag)); 636 __ Addu(t9, a2, Operand(Code::kHeaderSize - kHeapObjectTag));
637 __ Jump(Operand(t9)); 637 __ Jump(t9);
638 638
639 // a0: number of arguments 639 // a0: number of arguments
640 // a1: called object 640 // a1: called object
641 __ bind(&non_function_call); 641 __ bind(&non_function_call);
642 // CALL_NON_FUNCTION expects the non-function constructor as receiver 642 // CALL_NON_FUNCTION expects the non-function constructor as receiver
643 // (instead of the original receiver from the call site). The receiver is 643 // (instead of the original receiver from the call site). The receiver is
644 // stack element argc. 644 // stack element argc.
645 // Set expected number of arguments to zero (not changing a0). 645 // Set expected number of arguments to zero (not changing a0).
646 __ mov(a2, zero_reg); 646 __ mov(a2, zero_reg);
647 __ GetBuiltinEntry(a3, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); 647 __ GetBuiltinEntry(a3, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 __ mov(s2, t0); 1068 __ mov(s2, t0);
1069 __ mov(s3, t0); 1069 __ mov(s3, t0);
1070 __ mov(s4, t0); 1070 __ mov(s4, t0);
1071 __ mov(s5, t0); 1071 __ mov(s5, t0);
1072 // s6 holds the root address. Do not clobber. 1072 // s6 holds the root address. Do not clobber.
1073 // s7 is cp. Do not init. 1073 // s7 is cp. Do not init.
1074 1074
1075 // Invoke the code and pass argc as a0. 1075 // Invoke the code and pass argc as a0.
1076 __ mov(a0, a3); 1076 __ mov(a0, a3);
1077 if (is_construct) { 1077 if (is_construct) {
1078 __ Call(masm->isolate()->builtins()->JSConstructCall(), 1078 __ Call(masm->isolate()->builtins()->JSConstructCall());
1079 RelocInfo::CODE_TARGET);
1080 } else { 1079 } else {
1081 ParameterCount actual(a0); 1080 ParameterCount actual(a0);
1082 __ InvokeFunction(a1, actual, CALL_FUNCTION, 1081 __ InvokeFunction(a1, actual, CALL_FUNCTION,
1083 NullCallWrapper(), CALL_AS_METHOD); 1082 NullCallWrapper(), CALL_AS_METHOD);
1084 } 1083 }
1085 1084
1086 __ LeaveInternalFrame(); 1085 __ LeaveInternalFrame();
1087 1086
1088 __ Jump(ra); 1087 __ Jump(ra);
1089 } 1088 }
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 __ bind(&dont_adapt_arguments); 1618 __ bind(&dont_adapt_arguments);
1620 __ Jump(a3); 1619 __ Jump(a3);
1621 } 1620 }
1622 1621
1623 1622
1624 #undef __ 1623 #undef __
1625 1624
1626 } } // namespace v8::internal 1625 } } // namespace v8::internal
1627 1626
1628 #endif // V8_TARGET_ARCH_MIPS 1627 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/assembler-mips.h ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698