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

Side by Side Diff: src/full-codegen/x87/full-codegen-x87.cc

Issue 1730243002: [fullcodegen] Factor out EmitNewClosure from architectures. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-full-codegen-named-load
Patch Set: Created 4 years, 10 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/full-codegen/x64/full-codegen-x64.cc ('k') | no next file » | 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/ast/scopes.h" 7 #include "src/ast/scopes.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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 __ add(esp, Immediate(5 * kPointerSize)); 1084 __ add(esp, Immediate(5 * kPointerSize));
1085 OperandStackDepthDecrement(ForIn::kElementCount); 1085 OperandStackDepthDecrement(ForIn::kElementCount);
1086 1086
1087 // Exit and decrement the loop depth. 1087 // Exit and decrement the loop depth.
1088 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); 1088 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
1089 __ bind(&exit); 1089 __ bind(&exit);
1090 decrement_loop_depth(); 1090 decrement_loop_depth();
1091 } 1091 }
1092 1092
1093 1093
1094 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
1095 bool pretenure) {
1096 // Use the fast case closure allocation code that allocates in new
1097 // space for nested functions that don't need literals cloning. If
1098 // we're running with the --always-opt or the --prepare-always-opt
1099 // flag, we need to use the runtime function so that the new function
1100 // we are creating here gets a chance to have its code optimized and
1101 // doesn't just get a copy of the existing unoptimized code.
1102 if (!FLAG_always_opt &&
1103 !FLAG_prepare_always_opt &&
1104 !pretenure &&
1105 scope()->is_function_scope() &&
1106 info->num_literals() == 0) {
1107 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind());
1108 __ mov(ebx, Immediate(info));
1109 __ CallStub(&stub);
1110 } else {
1111 __ push(Immediate(info));
1112 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured
1113 : Runtime::kNewClosure);
1114 }
1115 context()->Plug(eax);
1116 }
1117
1118
1119 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, 1094 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset,
1120 FeedbackVectorSlot slot) { 1095 FeedbackVectorSlot slot) {
1121 DCHECK(NeedsHomeObject(initializer)); 1096 DCHECK(NeedsHomeObject(initializer));
1122 __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); 1097 __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0));
1123 __ mov(StoreDescriptor::NameRegister(), 1098 __ mov(StoreDescriptor::NameRegister(),
1124 Immediate(isolate()->factory()->home_object_symbol())); 1099 Immediate(isolate()->factory()->home_object_symbol()));
1125 __ mov(StoreDescriptor::ValueRegister(), Operand(esp, offset * kPointerSize)); 1100 __ mov(StoreDescriptor::ValueRegister(), Operand(esp, offset * kPointerSize));
1126 EmitLoadStoreICSlot(slot); 1101 EmitLoadStoreICSlot(slot);
1127 CallStoreIC(); 1102 CallStoreIC();
1128 } 1103 }
(...skipping 2983 matching lines...) Expand 10 before | Expand all | Expand 10 after
4112 Assembler::target_address_at(call_target_address, 4087 Assembler::target_address_at(call_target_address,
4113 unoptimized_code)); 4088 unoptimized_code));
4114 return OSR_AFTER_STACK_CHECK; 4089 return OSR_AFTER_STACK_CHECK;
4115 } 4090 }
4116 4091
4117 4092
4118 } // namespace internal 4093 } // namespace internal
4119 } // namespace v8 4094 } // namespace v8
4120 4095
4121 #endif // V8_TARGET_ARCH_X87 4096 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698