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

Side by Side Diff: src/ppc/lithium-codegen-ppc.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/mips64/lithium-mips64.cc ('k') | src/ppc/lithium-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/base/bits.h" 5 #include "src/base/bits.h"
6 #include "src/code-factory.h" 6 #include "src/code-factory.h"
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/cpu-profiler.h" 8 #include "src/cpu-profiler.h"
9 #include "src/hydrogen-osr.h" 9 #include "src/hydrogen-osr.h"
10 #include "src/ic/ic.h" 10 #include "src/ic/ic.h"
(...skipping 5720 matching lines...) Expand 10 before | Expand all | Expand 10 after
5731 __ Push(r4, r3); 5731 __ Push(r4, r3);
5732 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr); 5732 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr);
5733 __ pop(r4); 5733 __ pop(r4);
5734 5734
5735 __ bind(&allocated); 5735 __ bind(&allocated);
5736 // Copy the content into the newly allocated memory. 5736 // Copy the content into the newly allocated memory.
5737 __ CopyFields(r3, r4, r5.bit(), size / kPointerSize); 5737 __ CopyFields(r3, r4, r5.bit(), size / kPointerSize);
5738 } 5738 }
5739 5739
5740 5740
5741 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
5742 DCHECK(ToRegister(instr->context()).is(cp));
5743 // Use the fast case closure allocation code that allocates in new
5744 // space for nested functions that don't need literals cloning.
5745 bool pretenure = instr->hydrogen()->pretenure();
5746 if (!pretenure && instr->hydrogen()->has_no_literals()) {
5747 FastNewClosureStub stub(isolate(), instr->hydrogen()->language_mode(),
5748 instr->hydrogen()->kind());
5749 __ mov(r5, Operand(instr->hydrogen()->shared_info()));
5750 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
5751 } else {
5752 __ mov(r5, Operand(instr->hydrogen()->shared_info()));
5753 __ mov(r4, Operand(pretenure ? factory()->true_value()
5754 : factory()->false_value()));
5755 __ Push(cp, r5, r4);
5756 CallRuntime(Runtime::kNewClosure, 3, instr);
5757 }
5758 }
5759
5760
5761 void LCodeGen::DoTypeof(LTypeof* instr) { 5741 void LCodeGen::DoTypeof(LTypeof* instr) {
5762 DCHECK(ToRegister(instr->value()).is(r6)); 5742 DCHECK(ToRegister(instr->value()).is(r6));
5763 DCHECK(ToRegister(instr->result()).is(r3)); 5743 DCHECK(ToRegister(instr->result()).is(r3));
5764 Label end, do_call; 5744 Label end, do_call;
5765 Register value_register = ToRegister(instr->value()); 5745 Register value_register = ToRegister(instr->value());
5766 __ JumpIfNotSmi(value_register, &do_call); 5746 __ JumpIfNotSmi(value_register, &do_call);
5767 __ mov(r3, Operand(isolate()->factory()->number_string())); 5747 __ mov(r3, Operand(isolate()->factory()->number_string()));
5768 __ b(&end); 5748 __ b(&end);
5769 __ bind(&do_call); 5749 __ bind(&do_call);
5770 TypeofStub stub(isolate()); 5750 TypeofStub stub(isolate());
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
6157 __ Push(scope_info); 6137 __ Push(scope_info);
6158 __ push(ToRegister(instr->function())); 6138 __ push(ToRegister(instr->function()));
6159 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6139 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6160 RecordSafepoint(Safepoint::kNoLazyDeopt); 6140 RecordSafepoint(Safepoint::kNoLazyDeopt);
6161 } 6141 }
6162 6142
6163 6143
6164 #undef __ 6144 #undef __
6165 } // namespace internal 6145 } // namespace internal
6166 } // namespace v8 6146 } // namespace v8
OLDNEW
« no previous file with comments | « src/mips64/lithium-mips64.cc ('k') | src/ppc/lithium-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698