| OLD | NEW |
| 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 __ bind(loop_statement.break_label()); | 1117 __ bind(loop_statement.break_label()); |
| 1118 DropOperands(5); | 1118 DropOperands(5); |
| 1119 | 1119 |
| 1120 // Exit and decrement the loop depth. | 1120 // Exit and decrement the loop depth. |
| 1121 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); | 1121 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
| 1122 __ bind(&exit); | 1122 __ bind(&exit); |
| 1123 decrement_loop_depth(); | 1123 decrement_loop_depth(); |
| 1124 } | 1124 } |
| 1125 | 1125 |
| 1126 | 1126 |
| 1127 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, | |
| 1128 bool pretenure) { | |
| 1129 // Use the fast case closure allocation code that allocates in new | |
| 1130 // space for nested functions that don't need literals cloning. If | |
| 1131 // we're running with the --always-opt or the --prepare-always-opt | |
| 1132 // flag, we need to use the runtime function so that the new function | |
| 1133 // we are creating here gets a chance to have its code optimized and | |
| 1134 // doesn't just get a copy of the existing unoptimized code. | |
| 1135 if (!FLAG_always_opt && | |
| 1136 !FLAG_prepare_always_opt && | |
| 1137 !pretenure && | |
| 1138 scope()->is_function_scope() && | |
| 1139 info->num_literals() == 0) { | |
| 1140 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind()); | |
| 1141 __ Move(rbx, info); | |
| 1142 __ CallStub(&stub); | |
| 1143 } else { | |
| 1144 __ Push(info); | |
| 1145 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured | |
| 1146 : Runtime::kNewClosure); | |
| 1147 } | |
| 1148 context()->Plug(rax); | |
| 1149 } | |
| 1150 | |
| 1151 | |
| 1152 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, | 1127 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, |
| 1153 FeedbackVectorSlot slot) { | 1128 FeedbackVectorSlot slot) { |
| 1154 DCHECK(NeedsHomeObject(initializer)); | 1129 DCHECK(NeedsHomeObject(initializer)); |
| 1155 __ movp(StoreDescriptor::ReceiverRegister(), Operand(rsp, 0)); | 1130 __ movp(StoreDescriptor::ReceiverRegister(), Operand(rsp, 0)); |
| 1156 __ Move(StoreDescriptor::NameRegister(), | 1131 __ Move(StoreDescriptor::NameRegister(), |
| 1157 isolate()->factory()->home_object_symbol()); | 1132 isolate()->factory()->home_object_symbol()); |
| 1158 __ movp(StoreDescriptor::ValueRegister(), | 1133 __ movp(StoreDescriptor::ValueRegister(), |
| 1159 Operand(rsp, offset * kPointerSize)); | 1134 Operand(rsp, offset * kPointerSize)); |
| 1160 EmitLoadStoreICSlot(slot); | 1135 EmitLoadStoreICSlot(slot); |
| 1161 CallStoreIC(); | 1136 CallStoreIC(); |
| (...skipping 2945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4107 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4082 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 4108 Assembler::target_address_at(call_target_address, | 4083 Assembler::target_address_at(call_target_address, |
| 4109 unoptimized_code)); | 4084 unoptimized_code)); |
| 4110 return OSR_AFTER_STACK_CHECK; | 4085 return OSR_AFTER_STACK_CHECK; |
| 4111 } | 4086 } |
| 4112 | 4087 |
| 4113 } // namespace internal | 4088 } // namespace internal |
| 4114 } // namespace v8 | 4089 } // namespace v8 |
| 4115 | 4090 |
| 4116 #endif // V8_TARGET_ARCH_X64 | 4091 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |