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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 } else { | 1168 } else { |
1169 __ push(Immediate(info)); | 1169 __ push(Immediate(info)); |
1170 __ CallRuntime( | 1170 __ CallRuntime( |
1171 pretenure ? Runtime::kNewClosure_Tenured : Runtime::kNewClosure, 1); | 1171 pretenure ? Runtime::kNewClosure_Tenured : Runtime::kNewClosure, 1); |
1172 } | 1172 } |
1173 context()->Plug(eax); | 1173 context()->Plug(eax); |
1174 } | 1174 } |
1175 | 1175 |
1176 | 1176 |
1177 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, | 1177 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, |
1178 FeedbackVectorICSlot slot) { | 1178 FeedbackVectorSlot slot) { |
1179 DCHECK(NeedsHomeObject(initializer)); | 1179 DCHECK(NeedsHomeObject(initializer)); |
1180 __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); | 1180 __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); |
1181 __ mov(StoreDescriptor::NameRegister(), | 1181 __ mov(StoreDescriptor::NameRegister(), |
1182 Immediate(isolate()->factory()->home_object_symbol())); | 1182 Immediate(isolate()->factory()->home_object_symbol())); |
1183 __ mov(StoreDescriptor::ValueRegister(), Operand(esp, offset * kPointerSize)); | 1183 __ mov(StoreDescriptor::ValueRegister(), Operand(esp, offset * kPointerSize)); |
1184 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 1184 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
1185 CallStoreIC(); | 1185 CallStoreIC(); |
1186 } | 1186 } |
1187 | 1187 |
1188 | 1188 |
1189 void FullCodeGenerator::EmitSetHomeObjectAccumulator( | 1189 void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, |
1190 Expression* initializer, int offset, FeedbackVectorICSlot slot) { | 1190 int offset, |
| 1191 FeedbackVectorSlot slot) { |
1191 DCHECK(NeedsHomeObject(initializer)); | 1192 DCHECK(NeedsHomeObject(initializer)); |
1192 __ mov(StoreDescriptor::ReceiverRegister(), eax); | 1193 __ mov(StoreDescriptor::ReceiverRegister(), eax); |
1193 __ mov(StoreDescriptor::NameRegister(), | 1194 __ mov(StoreDescriptor::NameRegister(), |
1194 Immediate(isolate()->factory()->home_object_symbol())); | 1195 Immediate(isolate()->factory()->home_object_symbol())); |
1195 __ mov(StoreDescriptor::ValueRegister(), Operand(esp, offset * kPointerSize)); | 1196 __ mov(StoreDescriptor::ValueRegister(), Operand(esp, offset * kPointerSize)); |
1196 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 1197 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
1197 CallStoreIC(); | 1198 CallStoreIC(); |
1198 } | 1199 } |
1199 | 1200 |
1200 | 1201 |
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2410 Handle<Code> code = | 2411 Handle<Code> code = |
2411 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | 2412 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2412 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2413 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2413 CallIC(code, expr->BinaryOperationFeedbackId()); | 2414 CallIC(code, expr->BinaryOperationFeedbackId()); |
2414 patch_site.EmitPatchInfo(); | 2415 patch_site.EmitPatchInfo(); |
2415 context()->Plug(eax); | 2416 context()->Plug(eax); |
2416 } | 2417 } |
2417 | 2418 |
2418 | 2419 |
2419 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2420 void FullCodeGenerator::EmitAssignment(Expression* expr, |
2420 FeedbackVectorICSlot slot) { | 2421 FeedbackVectorSlot slot) { |
2421 DCHECK(expr->IsValidReferenceExpressionOrThis()); | 2422 DCHECK(expr->IsValidReferenceExpressionOrThis()); |
2422 | 2423 |
2423 Property* prop = expr->AsProperty(); | 2424 Property* prop = expr->AsProperty(); |
2424 LhsKind assign_type = Property::GetAssignType(prop); | 2425 LhsKind assign_type = Property::GetAssignType(prop); |
2425 | 2426 |
2426 switch (assign_type) { | 2427 switch (assign_type) { |
2427 case VARIABLE: { | 2428 case VARIABLE: { |
2428 Variable* var = expr->AsVariableProxy()->var(); | 2429 Variable* var = expr->AsVariableProxy()->var(); |
2429 EffectContext context(this); | 2430 EffectContext context(this); |
2430 EmitVariableAssignment(var, Token::ASSIGN, slot); | 2431 EmitVariableAssignment(var, Token::ASSIGN, slot); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2501 __ mov(location, eax); | 2502 __ mov(location, eax); |
2502 if (var->IsContextSlot()) { | 2503 if (var->IsContextSlot()) { |
2503 __ mov(edx, eax); | 2504 __ mov(edx, eax); |
2504 int offset = Context::SlotOffset(var->index()); | 2505 int offset = Context::SlotOffset(var->index()); |
2505 __ RecordWriteContextSlot(ecx, offset, edx, ebx, kDontSaveFPRegs); | 2506 __ RecordWriteContextSlot(ecx, offset, edx, ebx, kDontSaveFPRegs); |
2506 } | 2507 } |
2507 } | 2508 } |
2508 | 2509 |
2509 | 2510 |
2510 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, | 2511 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
2511 FeedbackVectorICSlot slot) { | 2512 FeedbackVectorSlot slot) { |
2512 if (var->IsUnallocated()) { | 2513 if (var->IsUnallocated()) { |
2513 // Global var, const, or let. | 2514 // Global var, const, or let. |
2514 __ mov(StoreDescriptor::NameRegister(), var->name()); | 2515 __ mov(StoreDescriptor::NameRegister(), var->name()); |
2515 __ mov(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 2516 __ mov(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
2516 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 2517 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
2517 CallStoreIC(); | 2518 CallStoreIC(); |
2518 | 2519 |
2519 } else if (var->IsGlobalSlot()) { | 2520 } else if (var->IsGlobalSlot()) { |
2520 // Global var, const, or let. | 2521 // Global var, const, or let. |
2521 DCHECK(var->index() > 0); | 2522 DCHECK(var->index() > 0); |
(...skipping 2529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5051 | 5052 |
5052 void FullCodeGenerator::ClearPendingMessage() { | 5053 void FullCodeGenerator::ClearPendingMessage() { |
5053 DCHECK(!result_register().is(edx)); | 5054 DCHECK(!result_register().is(edx)); |
5054 ExternalReference pending_message_obj = | 5055 ExternalReference pending_message_obj = |
5055 ExternalReference::address_of_pending_message_obj(isolate()); | 5056 ExternalReference::address_of_pending_message_obj(isolate()); |
5056 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); | 5057 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); |
5057 __ mov(Operand::StaticVariable(pending_message_obj), edx); | 5058 __ mov(Operand::StaticVariable(pending_message_obj), edx); |
5058 } | 5059 } |
5059 | 5060 |
5060 | 5061 |
5061 void FullCodeGenerator::EmitLoadStoreICSlot(FeedbackVectorICSlot slot) { | 5062 void FullCodeGenerator::EmitLoadStoreICSlot(FeedbackVectorSlot slot) { |
5062 DCHECK(FLAG_vector_stores && !slot.IsInvalid()); | 5063 DCHECK(FLAG_vector_stores && !slot.IsInvalid()); |
5063 __ mov(VectorStoreICTrampolineDescriptor::SlotRegister(), | 5064 __ mov(VectorStoreICTrampolineDescriptor::SlotRegister(), |
5064 Immediate(SmiFromSlot(slot))); | 5065 Immediate(SmiFromSlot(slot))); |
5065 } | 5066 } |
5066 | 5067 |
5067 | 5068 |
5068 #undef __ | 5069 #undef __ |
5069 | 5070 |
5070 | 5071 |
5071 static const byte kJnsInstruction = 0x79; | 5072 static const byte kJnsInstruction = 0x79; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5142 Assembler::target_address_at(call_target_address, | 5143 Assembler::target_address_at(call_target_address, |
5143 unoptimized_code)); | 5144 unoptimized_code)); |
5144 return OSR_AFTER_STACK_CHECK; | 5145 return OSR_AFTER_STACK_CHECK; |
5145 } | 5146 } |
5146 | 5147 |
5147 | 5148 |
5148 } // namespace internal | 5149 } // namespace internal |
5149 } // namespace v8 | 5150 } // namespace v8 |
5150 | 5151 |
5151 #endif // V8_TARGET_ARCH_IA32 | 5152 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |