OLD | NEW |
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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 __ bind(loop_statement.break_label()); | 1131 __ bind(loop_statement.break_label()); |
1132 DropOperands(5); | 1132 DropOperands(5); |
1133 | 1133 |
1134 // Exit and decrement the loop depth. | 1134 // Exit and decrement the loop depth. |
1135 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); | 1135 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
1136 __ bind(&exit); | 1136 __ bind(&exit); |
1137 decrement_loop_depth(); | 1137 decrement_loop_depth(); |
1138 } | 1138 } |
1139 | 1139 |
1140 | 1140 |
1141 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, | |
1142 bool pretenure) { | |
1143 // Use the fast case closure allocation code that allocates in new | |
1144 // space for nested functions that don't need literals cloning. If | |
1145 // we're running with the --always-opt or the --prepare-always-opt | |
1146 // flag, we need to use the runtime function so that the new function | |
1147 // we are creating here gets a chance to have its code optimized and | |
1148 // doesn't just get a copy of the existing unoptimized code. | |
1149 if (!FLAG_always_opt && !FLAG_prepare_always_opt && !pretenure && | |
1150 scope()->is_function_scope() && info->num_literals() == 0) { | |
1151 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind()); | |
1152 __ mov(r5, Operand(info)); | |
1153 __ CallStub(&stub); | |
1154 } else { | |
1155 __ Push(info); | |
1156 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured | |
1157 : Runtime::kNewClosure); | |
1158 } | |
1159 context()->Plug(r3); | |
1160 } | |
1161 | |
1162 | |
1163 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, | 1141 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, |
1164 FeedbackVectorSlot slot) { | 1142 FeedbackVectorSlot slot) { |
1165 DCHECK(NeedsHomeObject(initializer)); | 1143 DCHECK(NeedsHomeObject(initializer)); |
1166 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); | 1144 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
1167 __ mov(StoreDescriptor::NameRegister(), | 1145 __ mov(StoreDescriptor::NameRegister(), |
1168 Operand(isolate()->factory()->home_object_symbol())); | 1146 Operand(isolate()->factory()->home_object_symbol())); |
1169 __ LoadP(StoreDescriptor::ValueRegister(), | 1147 __ LoadP(StoreDescriptor::ValueRegister(), |
1170 MemOperand(sp, offset * kPointerSize)); | 1148 MemOperand(sp, offset * kPointerSize)); |
1171 EmitLoadStoreICSlot(slot); | 1149 EmitLoadStoreICSlot(slot); |
1172 CallStoreIC(); | 1150 CallStoreIC(); |
(...skipping 3037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4210 return ON_STACK_REPLACEMENT; | 4188 return ON_STACK_REPLACEMENT; |
4211 } | 4189 } |
4212 | 4190 |
4213 DCHECK(interrupt_address == | 4191 DCHECK(interrupt_address == |
4214 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4192 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4215 return OSR_AFTER_STACK_CHECK; | 4193 return OSR_AFTER_STACK_CHECK; |
4216 } | 4194 } |
4217 } // namespace internal | 4195 } // namespace internal |
4218 } // namespace v8 | 4196 } // namespace v8 |
4219 #endif // V8_TARGET_ARCH_PPC | 4197 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |