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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 1329293003: [runtime] Sanitize %NewClosure runtime entries. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Ports Created 5 years, 3 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/runtime/runtime-scopes.cc ('k') | src/x64/lithium-x64.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 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 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/cpu-profiler.h" 10 #include "src/cpu-profiler.h"
(...skipping 5490 matching lines...) Expand 10 before | Expand all | Expand 10 after
5501 __ movp(FieldOperand(rax, i), rdx); 5501 __ movp(FieldOperand(rax, i), rdx);
5502 __ movp(FieldOperand(rax, i + kPointerSize), rcx); 5502 __ movp(FieldOperand(rax, i + kPointerSize), rcx);
5503 } 5503 }
5504 if ((size % (2 * kPointerSize)) != 0) { 5504 if ((size % (2 * kPointerSize)) != 0) {
5505 __ movp(rdx, FieldOperand(rbx, size - kPointerSize)); 5505 __ movp(rdx, FieldOperand(rbx, size - kPointerSize));
5506 __ movp(FieldOperand(rax, size - kPointerSize), rdx); 5506 __ movp(FieldOperand(rax, size - kPointerSize), rdx);
5507 } 5507 }
5508 } 5508 }
5509 5509
5510 5510
5511 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
5512 DCHECK(ToRegister(instr->context()).is(rsi));
5513 // Use the fast case closure allocation code that allocates in new
5514 // space for nested functions that don't need literals cloning.
5515 bool pretenure = instr->hydrogen()->pretenure();
5516 if (!pretenure && instr->hydrogen()->has_no_literals()) {
5517 FastNewClosureStub stub(isolate(), instr->hydrogen()->language_mode(),
5518 instr->hydrogen()->kind());
5519 __ Move(rbx, instr->hydrogen()->shared_info());
5520 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
5521 } else {
5522 __ Push(rsi);
5523 __ Push(instr->hydrogen()->shared_info());
5524 __ PushRoot(pretenure ? Heap::kTrueValueRootIndex :
5525 Heap::kFalseValueRootIndex);
5526 CallRuntime(Runtime::kNewClosure, 3, instr);
5527 }
5528 }
5529
5530
5531 void LCodeGen::DoTypeof(LTypeof* instr) { 5511 void LCodeGen::DoTypeof(LTypeof* instr) {
5532 DCHECK(ToRegister(instr->context()).is(rsi)); 5512 DCHECK(ToRegister(instr->context()).is(rsi));
5533 DCHECK(ToRegister(instr->value()).is(rbx)); 5513 DCHECK(ToRegister(instr->value()).is(rbx));
5534 Label end, do_call; 5514 Label end, do_call;
5535 Register value_register = ToRegister(instr->value()); 5515 Register value_register = ToRegister(instr->value());
5536 __ JumpIfNotSmi(value_register, &do_call); 5516 __ JumpIfNotSmi(value_register, &do_call);
5537 __ Move(rax, isolate()->factory()->number_string()); 5517 __ Move(rax, isolate()->factory()->number_string());
5538 __ jmp(&end); 5518 __ jmp(&end);
5539 __ bind(&do_call); 5519 __ bind(&do_call);
5540 TypeofStub stub(isolate()); 5520 TypeofStub stub(isolate());
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
5941 RecordSafepoint(Safepoint::kNoLazyDeopt); 5921 RecordSafepoint(Safepoint::kNoLazyDeopt);
5942 } 5922 }
5943 5923
5944 5924
5945 #undef __ 5925 #undef __
5946 5926
5947 } // namespace internal 5927 } // namespace internal
5948 } // namespace v8 5928 } // namespace v8
5949 5929
5950 #endif // V8_TARGET_ARCH_X64 5930 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698