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

Side by Side Diff: src/crankshaft/arm64/lithium-codegen-arm64.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/arm64/lithium-arm64.cc ('k') | src/crankshaft/hydrogen.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h"
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); 389 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code();
390 CallCode(ic, RelocInfo::CODE_TARGET, instr); 390 CallCode(ic, RelocInfo::CODE_TARGET, instr);
391 } else { 391 } else {
392 __ Mov(x0, arity); 392 __ Mov(x0, arity);
393 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); 393 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr);
394 } 394 }
395 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); 395 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta());
396 } 396 }
397 397
398 398
399 void LCodeGen::DoCallNew(LCallNew* instr) {
400 DCHECK(ToRegister(instr->context()).is(cp));
401 DCHECK(instr->IsMarkedAsCall());
402 DCHECK(ToRegister(instr->constructor()).is(x1));
403
404 __ Mov(x0, instr->arity());
405 // No cell in x2 for construct type feedback in optimized code.
406 __ LoadRoot(x2, Heap::kUndefinedValueRootIndex);
407
408 CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
409 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
410 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta());
411
412 DCHECK(ToRegister(instr->result()).is(x0));
413 }
414
415
416 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 399 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
417 DCHECK(instr->IsMarkedAsCall()); 400 DCHECK(instr->IsMarkedAsCall());
418 DCHECK(ToRegister(instr->context()).is(cp)); 401 DCHECK(ToRegister(instr->context()).is(cp));
419 DCHECK(ToRegister(instr->constructor()).is(x1)); 402 DCHECK(ToRegister(instr->constructor()).is(x1));
420 403
421 __ Mov(x0, Operand(instr->arity())); 404 __ Mov(x0, Operand(instr->arity()));
422 if (instr->arity() == 1) { 405 if (instr->arity() == 1) {
423 // We only need the allocation site for the case we have a length argument. 406 // We only need the allocation site for the case we have a length argument.
424 // The case may bail out to the runtime, which will determine the correct 407 // The case may bail out to the runtime, which will determine the correct
425 // elements kind with the site. 408 // elements kind with the site.
(...skipping 5527 matching lines...) Expand 10 before | Expand all | Expand 10 after
5953 Handle<ScopeInfo> scope_info = instr->scope_info(); 5936 Handle<ScopeInfo> scope_info = instr->scope_info();
5954 __ Push(scope_info); 5937 __ Push(scope_info);
5955 __ Push(ToRegister(instr->function())); 5938 __ Push(ToRegister(instr->function()));
5956 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5939 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5957 RecordSafepoint(Safepoint::kNoLazyDeopt); 5940 RecordSafepoint(Safepoint::kNoLazyDeopt);
5958 } 5941 }
5959 5942
5960 5943
5961 } // namespace internal 5944 } // namespace internal
5962 } // namespace v8 5945 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/arm64/lithium-arm64.cc ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698