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

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.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, 9 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
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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 __ bind(loop_statement.break_label()); 1160 __ bind(loop_statement.break_label());
1161 DropOperands(5); 1161 DropOperands(5);
1162 1162
1163 // Exit and decrement the loop depth. 1163 // Exit and decrement the loop depth.
1164 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); 1164 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
1165 __ bind(&exit); 1165 __ bind(&exit);
1166 decrement_loop_depth(); 1166 decrement_loop_depth();
1167 } 1167 }
1168 1168
1169 1169
1170 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
1171 bool pretenure) {
1172 // Use the fast case closure allocation code that allocates in new
1173 // space for nested functions that don't need literals cloning. If
1174 // we're running with the --always-opt or the --prepare-always-opt
1175 // flag, we need to use the runtime function so that the new function
1176 // we are creating here gets a chance to have its code optimized and
1177 // doesn't just get a copy of the existing unoptimized code.
1178 if (!FLAG_always_opt &&
1179 !FLAG_prepare_always_opt &&
1180 !pretenure &&
1181 scope()->is_function_scope() &&
1182 info->num_literals() == 0) {
1183 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind());
1184 __ li(a2, Operand(info));
1185 __ CallStub(&stub);
1186 } else {
1187 __ Push(info);
1188 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured
1189 : Runtime::kNewClosure);
1190 }
1191 context()->Plug(v0);
1192 }
1193
1194
1195 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, 1170 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset,
1196 FeedbackVectorSlot slot) { 1171 FeedbackVectorSlot slot) {
1197 DCHECK(NeedsHomeObject(initializer)); 1172 DCHECK(NeedsHomeObject(initializer));
1198 __ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); 1173 __ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp));
1199 __ li(StoreDescriptor::NameRegister(), 1174 __ li(StoreDescriptor::NameRegister(),
1200 Operand(isolate()->factory()->home_object_symbol())); 1175 Operand(isolate()->factory()->home_object_symbol()));
1201 __ lw(StoreDescriptor::ValueRegister(), 1176 __ lw(StoreDescriptor::ValueRegister(),
1202 MemOperand(sp, offset * kPointerSize)); 1177 MemOperand(sp, offset * kPointerSize));
1203 EmitLoadStoreICSlot(slot); 1178 EmitLoadStoreICSlot(slot);
1204 CallStoreIC(); 1179 CallStoreIC();
(...skipping 3039 matching lines...) Expand 10 before | Expand all | Expand 10 after
4244 reinterpret_cast<uint32_t>( 4219 reinterpret_cast<uint32_t>(
4245 isolate->builtins()->OsrAfterStackCheck()->entry())); 4220 isolate->builtins()->OsrAfterStackCheck()->entry()));
4246 return OSR_AFTER_STACK_CHECK; 4221 return OSR_AFTER_STACK_CHECK;
4247 } 4222 }
4248 4223
4249 4224
4250 } // namespace internal 4225 } // namespace internal
4251 } // namespace v8 4226 } // namespace v8
4252 4227
4253 #endif // V8_TARGET_ARCH_MIPS 4228 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698