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

Side by Side Diff: src/crankshaft/ia32/lithium-codegen-ia32.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 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/hydrogen-instructions.cc ('k') | src/crankshaft/ia32/lithium-ia32.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. 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 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h"
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 3763 matching lines...) Expand 10 before | Expand all | Expand 10 after
3774 Handle<Code> ic = 3774 Handle<Code> ic =
3775 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); 3775 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code();
3776 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3776 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3777 } else { 3777 } else {
3778 __ Set(eax, arity); 3778 __ Set(eax, arity);
3779 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); 3779 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr);
3780 } 3780 }
3781 } 3781 }
3782 3782
3783 3783
3784 void LCodeGen::DoCallNew(LCallNew* instr) {
3785 DCHECK(ToRegister(instr->context()).is(esi));
3786 DCHECK(ToRegister(instr->constructor()).is(edi));
3787 DCHECK(ToRegister(instr->result()).is(eax));
3788
3789 // No cell in ebx for construct type feedback in optimized code
3790 __ mov(ebx, isolate()->factory()->undefined_value());
3791 CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
3792 __ Move(eax, Immediate(instr->arity()));
3793 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
3794 }
3795
3796
3797 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 3784 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
3798 DCHECK(ToRegister(instr->context()).is(esi)); 3785 DCHECK(ToRegister(instr->context()).is(esi));
3799 DCHECK(ToRegister(instr->constructor()).is(edi)); 3786 DCHECK(ToRegister(instr->constructor()).is(edi));
3800 DCHECK(ToRegister(instr->result()).is(eax)); 3787 DCHECK(ToRegister(instr->result()).is(eax));
3801 3788
3802 __ Move(eax, Immediate(instr->arity())); 3789 __ Move(eax, Immediate(instr->arity()));
3803 if (instr->arity() == 1) { 3790 if (instr->arity() == 1) {
3804 // We only need the allocation site for the case we have a length argument. 3791 // We only need the allocation site for the case we have a length argument.
3805 // The case may bail out to the runtime, which will determine the correct 3792 // The case may bail out to the runtime, which will determine the correct
3806 // elements kind with the site. 3793 // elements kind with the site.
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after
5654 RecordSafepoint(Safepoint::kNoLazyDeopt); 5641 RecordSafepoint(Safepoint::kNoLazyDeopt);
5655 } 5642 }
5656 5643
5657 5644
5658 #undef __ 5645 #undef __
5659 5646
5660 } // namespace internal 5647 } // namespace internal
5661 } // namespace v8 5648 } // namespace v8
5662 5649
5663 #endif // V8_TARGET_ARCH_IA32 5650 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen-instructions.cc ('k') | src/crankshaft/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698