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

Side by Side Diff: src/arm/lithium-codegen-arm.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/arm/lithium-arm.cc ('k') | src/arm64/lithium-arm64.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 #include "src/arm/lithium-codegen-arm.h" 5 #include "src/arm/lithium-codegen-arm.h"
6 #include "src/arm/lithium-gap-resolver-arm.h" 6 #include "src/arm/lithium-gap-resolver-arm.h"
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 5423 matching lines...) Expand 10 before | Expand all | Expand 10 after
5434 __ Push(r1, r0); 5434 __ Push(r1, r0);
5435 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr); 5435 CallRuntime(Runtime::kAllocateInNewSpace, 1, instr);
5436 __ pop(r1); 5436 __ pop(r1);
5437 5437
5438 __ bind(&allocated); 5438 __ bind(&allocated);
5439 // Copy the content into the newly allocated memory. 5439 // Copy the content into the newly allocated memory.
5440 __ CopyFields(r0, r1, double_scratch0(), size / kPointerSize); 5440 __ CopyFields(r0, r1, double_scratch0(), size / kPointerSize);
5441 } 5441 }
5442 5442
5443 5443
5444 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
5445 DCHECK(ToRegister(instr->context()).is(cp));
5446 // Use the fast case closure allocation code that allocates in new
5447 // space for nested functions that don't need literals cloning.
5448 bool pretenure = instr->hydrogen()->pretenure();
5449 if (!pretenure && instr->hydrogen()->has_no_literals()) {
5450 FastNewClosureStub stub(isolate(), instr->hydrogen()->language_mode(),
5451 instr->hydrogen()->kind());
5452 __ mov(r2, Operand(instr->hydrogen()->shared_info()));
5453 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
5454 } else {
5455 __ mov(r2, Operand(instr->hydrogen()->shared_info()));
5456 __ mov(r1, Operand(pretenure ? factory()->true_value()
5457 : factory()->false_value()));
5458 __ Push(cp, r2, r1);
5459 CallRuntime(Runtime::kNewClosure, 3, instr);
5460 }
5461 }
5462
5463
5464 void LCodeGen::DoTypeof(LTypeof* instr) { 5444 void LCodeGen::DoTypeof(LTypeof* instr) {
5465 DCHECK(ToRegister(instr->value()).is(r3)); 5445 DCHECK(ToRegister(instr->value()).is(r3));
5466 DCHECK(ToRegister(instr->result()).is(r0)); 5446 DCHECK(ToRegister(instr->result()).is(r0));
5467 Label end, do_call; 5447 Label end, do_call;
5468 Register value_register = ToRegister(instr->value()); 5448 Register value_register = ToRegister(instr->value());
5469 __ JumpIfNotSmi(value_register, &do_call); 5449 __ JumpIfNotSmi(value_register, &do_call);
5470 __ mov(r0, Operand(isolate()->factory()->number_string())); 5450 __ mov(r0, Operand(isolate()->factory()->number_string()));
5471 __ jmp(&end); 5451 __ jmp(&end);
5472 __ bind(&do_call); 5452 __ bind(&do_call);
5473 TypeofStub stub(isolate()); 5453 TypeofStub stub(isolate());
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
5870 __ push(ToRegister(instr->function())); 5850 __ push(ToRegister(instr->function()));
5871 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5851 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5872 RecordSafepoint(Safepoint::kNoLazyDeopt); 5852 RecordSafepoint(Safepoint::kNoLazyDeopt);
5873 } 5853 }
5874 5854
5875 5855
5876 #undef __ 5856 #undef __
5877 5857
5878 } // namespace internal 5858 } // namespace internal
5879 } // namespace v8 5859 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/arm64/lithium-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698