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

Side by Side Diff: src/x87/lithium-codegen-x87.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/x64/lithium-x64.cc ('k') | src/x87/lithium-x87.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_X87 5 #if V8_TARGET_ARCH_X87
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/codegen.h" 10 #include "src/codegen.h"
(...skipping 5929 matching lines...) Expand 10 before | Expand all | Expand 10 after
5940 __ mov(FieldOperand(eax, i), edx); 5940 __ mov(FieldOperand(eax, i), edx);
5941 __ mov(FieldOperand(eax, i + kPointerSize), ecx); 5941 __ mov(FieldOperand(eax, i + kPointerSize), ecx);
5942 } 5942 }
5943 if ((size % (2 * kPointerSize)) != 0) { 5943 if ((size % (2 * kPointerSize)) != 0) {
5944 __ mov(edx, FieldOperand(ebx, size - kPointerSize)); 5944 __ mov(edx, FieldOperand(ebx, size - kPointerSize));
5945 __ mov(FieldOperand(eax, size - kPointerSize), edx); 5945 __ mov(FieldOperand(eax, size - kPointerSize), edx);
5946 } 5946 }
5947 } 5947 }
5948 5948
5949 5949
5950 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
5951 DCHECK(ToRegister(instr->context()).is(esi));
5952 // Use the fast case closure allocation code that allocates in new
5953 // space for nested functions that don't need literals cloning.
5954 bool pretenure = instr->hydrogen()->pretenure();
5955 if (!pretenure && instr->hydrogen()->has_no_literals()) {
5956 FastNewClosureStub stub(isolate(), instr->hydrogen()->language_mode(),
5957 instr->hydrogen()->kind());
5958 __ mov(ebx, Immediate(instr->hydrogen()->shared_info()));
5959 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
5960 } else {
5961 __ push(esi);
5962 __ push(Immediate(instr->hydrogen()->shared_info()));
5963 __ push(Immediate(pretenure ? factory()->true_value()
5964 : factory()->false_value()));
5965 CallRuntime(Runtime::kNewClosure, 3, instr);
5966 }
5967 }
5968
5969
5970 void LCodeGen::DoTypeof(LTypeof* instr) { 5950 void LCodeGen::DoTypeof(LTypeof* instr) {
5971 DCHECK(ToRegister(instr->context()).is(esi)); 5951 DCHECK(ToRegister(instr->context()).is(esi));
5972 DCHECK(ToRegister(instr->value()).is(ebx)); 5952 DCHECK(ToRegister(instr->value()).is(ebx));
5973 Label end, do_call; 5953 Label end, do_call;
5974 Register value_register = ToRegister(instr->value()); 5954 Register value_register = ToRegister(instr->value());
5975 __ JumpIfNotSmi(value_register, &do_call); 5955 __ JumpIfNotSmi(value_register, &do_call);
5976 __ mov(eax, Immediate(isolate()->factory()->number_string())); 5956 __ mov(eax, Immediate(isolate()->factory()->number_string()));
5977 __ jmp(&end); 5957 __ jmp(&end);
5978 __ bind(&do_call); 5958 __ bind(&do_call);
5979 TypeofStub stub(isolate()); 5959 TypeofStub stub(isolate());
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
6369 RecordSafepoint(Safepoint::kNoLazyDeopt); 6349 RecordSafepoint(Safepoint::kNoLazyDeopt);
6370 } 6350 }
6371 6351
6372 6352
6373 #undef __ 6353 #undef __
6374 6354
6375 } // namespace internal 6355 } // namespace internal
6376 } // namespace v8 6356 } // namespace v8
6377 6357
6378 #endif // V8_TARGET_ARCH_X87 6358 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.cc ('k') | src/x87/lithium-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698