| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 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 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 __ bind(loop_statement.break_label()); | 1091 __ bind(loop_statement.break_label()); |
| 1092 DropOperands(5); | 1092 DropOperands(5); |
| 1093 | 1093 |
| 1094 // Exit and decrement the loop depth. | 1094 // Exit and decrement the loop depth. |
| 1095 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); | 1095 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
| 1096 __ bind(&exit); | 1096 __ bind(&exit); |
| 1097 decrement_loop_depth(); | 1097 decrement_loop_depth(); |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 | 1100 |
| 1101 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, | |
| 1102 bool pretenure) { | |
| 1103 // Use the fast case closure allocation code that allocates in new | |
| 1104 // space for nested functions that don't need literals cloning. If | |
| 1105 // we're running with the --always-opt or the --prepare-always-opt | |
| 1106 // flag, we need to use the runtime function so that the new function | |
| 1107 // we are creating here gets a chance to have its code optimized and | |
| 1108 // doesn't just get a copy of the existing unoptimized code. | |
| 1109 if (!FLAG_always_opt && | |
| 1110 !FLAG_prepare_always_opt && | |
| 1111 !pretenure && | |
| 1112 scope()->is_function_scope() && | |
| 1113 info->num_literals() == 0) { | |
| 1114 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind()); | |
| 1115 __ mov(ebx, Immediate(info)); | |
| 1116 __ CallStub(&stub); | |
| 1117 } else { | |
| 1118 __ push(Immediate(info)); | |
| 1119 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured | |
| 1120 : Runtime::kNewClosure); | |
| 1121 } | |
| 1122 context()->Plug(eax); | |
| 1123 } | |
| 1124 | |
| 1125 | |
| 1126 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, | 1101 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, |
| 1127 FeedbackVectorSlot slot) { | 1102 FeedbackVectorSlot slot) { |
| 1128 DCHECK(NeedsHomeObject(initializer)); | 1103 DCHECK(NeedsHomeObject(initializer)); |
| 1129 __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); | 1104 __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); |
| 1130 __ mov(StoreDescriptor::NameRegister(), | 1105 __ mov(StoreDescriptor::NameRegister(), |
| 1131 Immediate(isolate()->factory()->home_object_symbol())); | 1106 Immediate(isolate()->factory()->home_object_symbol())); |
| 1132 __ mov(StoreDescriptor::ValueRegister(), Operand(esp, offset * kPointerSize)); | 1107 __ mov(StoreDescriptor::ValueRegister(), Operand(esp, offset * kPointerSize)); |
| 1133 EmitLoadStoreICSlot(slot); | 1108 EmitLoadStoreICSlot(slot); |
| 1134 CallStoreIC(); | 1109 CallStoreIC(); |
| 1135 } | 1110 } |
| (...skipping 2985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4121 Assembler::target_address_at(call_target_address, | 4096 Assembler::target_address_at(call_target_address, |
| 4122 unoptimized_code)); | 4097 unoptimized_code)); |
| 4123 return OSR_AFTER_STACK_CHECK; | 4098 return OSR_AFTER_STACK_CHECK; |
| 4124 } | 4099 } |
| 4125 | 4100 |
| 4126 | 4101 |
| 4127 } // namespace internal | 4102 } // namespace internal |
| 4128 } // namespace v8 | 4103 } // namespace v8 |
| 4129 | 4104 |
| 4130 #endif // V8_TARGET_ARCH_IA32 | 4105 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |