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

Side by Side Diff: src/crankshaft/mips/lithium-codegen-mips.cc

Issue 1469793002: [builtins] Sanitize the machinery around Construct calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mips64 fix. Created 5 years, 1 month 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/crankshaft/ia32/lithium-ia32.cc ('k') | src/crankshaft/mips/lithium-mips.h » ('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 2012 the V8 project authors. All rights reserved.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
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 3800 matching lines...) Expand 10 before | Expand all | Expand 10 after
3811 Handle<Code> ic = 3811 Handle<Code> ic =
3812 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); 3812 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code();
3813 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3813 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3814 } else { 3814 } else {
3815 __ li(a0, Operand(arity)); 3815 __ li(a0, Operand(arity));
3816 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); 3816 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr);
3817 } 3817 }
3818 } 3818 }
3819 3819
3820 3820
3821 void LCodeGen::DoCallNew(LCallNew* instr) {
3822 DCHECK(ToRegister(instr->context()).is(cp));
3823 DCHECK(ToRegister(instr->constructor()).is(a1));
3824 DCHECK(ToRegister(instr->result()).is(v0));
3825
3826 __ li(a0, Operand(instr->arity()));
3827 // No cell in a2 for construct type feedback in optimized code
3828 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex);
3829 CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
3830 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
3831 }
3832
3833
3834 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 3821 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
3835 DCHECK(ToRegister(instr->context()).is(cp)); 3822 DCHECK(ToRegister(instr->context()).is(cp));
3836 DCHECK(ToRegister(instr->constructor()).is(a1)); 3823 DCHECK(ToRegister(instr->constructor()).is(a1));
3837 DCHECK(ToRegister(instr->result()).is(v0)); 3824 DCHECK(ToRegister(instr->result()).is(v0));
3838 3825
3839 __ li(a0, Operand(instr->arity())); 3826 __ li(a0, Operand(instr->arity()));
3840 if (instr->arity() == 1) { 3827 if (instr->arity() == 1) {
3841 // We only need the allocation site for the case we have a length argument. 3828 // We only need the allocation site for the case we have a length argument.
3842 // The case may bail out to the runtime, which will determine the correct 3829 // The case may bail out to the runtime, which will determine the correct
3843 // elements kind with the site. 3830 // elements kind with the site.
(...skipping 1987 matching lines...) Expand 10 before | Expand all | Expand 10 after
5831 __ Push(at, ToRegister(instr->function())); 5818 __ Push(at, ToRegister(instr->function()));
5832 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5819 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5833 RecordSafepoint(Safepoint::kNoLazyDeopt); 5820 RecordSafepoint(Safepoint::kNoLazyDeopt);
5834 } 5821 }
5835 5822
5836 5823
5837 #undef __ 5824 #undef __
5838 5825
5839 } // namespace internal 5826 } // namespace internal
5840 } // namespace v8 5827 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/ia32/lithium-ia32.cc ('k') | src/crankshaft/mips/lithium-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698