| 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 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2002 | 2002 |
| 2003 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2003 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
| 2004 SetExpressionPosition(prop); | 2004 SetExpressionPosition(prop); |
| 2005 Literal* key = prop->key()->AsLiteral(); | 2005 Literal* key = prop->key()->AsLiteral(); |
| 2006 DCHECK(!key->value()->IsSmi()); | 2006 DCHECK(!key->value()->IsSmi()); |
| 2007 DCHECK(!prop->IsSuperAccess()); | 2007 DCHECK(!prop->IsSuperAccess()); |
| 2008 | 2008 |
| 2009 __ mov(LoadDescriptor::NameRegister(), Immediate(key->value())); | 2009 __ mov(LoadDescriptor::NameRegister(), Immediate(key->value())); |
| 2010 __ mov(LoadDescriptor::SlotRegister(), | 2010 __ mov(LoadDescriptor::SlotRegister(), |
| 2011 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2011 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2012 CallLoadIC(NOT_INSIDE_TYPEOF, language_mode()); | 2012 CallLoadIC(NOT_INSIDE_TYPEOF); |
| 2013 } | 2013 } |
| 2014 | 2014 |
| 2015 | 2015 |
| 2016 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2016 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
| 2017 // Stack: receiver, home_object. | 2017 // Stack: receiver, home_object. |
| 2018 SetExpressionPosition(prop); | 2018 SetExpressionPosition(prop); |
| 2019 Literal* key = prop->key()->AsLiteral(); | 2019 Literal* key = prop->key()->AsLiteral(); |
| 2020 DCHECK(!key->value()->IsSmi()); | 2020 DCHECK(!key->value()->IsSmi()); |
| 2021 DCHECK(prop->IsSuperAccess()); | 2021 DCHECK(prop->IsSuperAccess()); |
| 2022 | 2022 |
| 2023 __ push(Immediate(key->value())); | 2023 __ push(Immediate(key->value())); |
| 2024 __ push(Immediate(Smi::FromInt(language_mode()))); | |
| 2025 __ CallRuntime(Runtime::kLoadFromSuper); | 2024 __ CallRuntime(Runtime::kLoadFromSuper); |
| 2026 } | 2025 } |
| 2027 | 2026 |
| 2028 | 2027 |
| 2029 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2028 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
| 2030 SetExpressionPosition(prop); | 2029 SetExpressionPosition(prop); |
| 2031 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); | 2030 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
| 2032 __ mov(LoadDescriptor::SlotRegister(), | 2031 __ mov(LoadDescriptor::SlotRegister(), |
| 2033 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2032 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2034 CallIC(ic); | 2033 CallIC(ic); |
| 2035 } | 2034 } |
| 2036 | 2035 |
| 2037 | 2036 |
| 2038 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2037 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
| 2039 // Stack: receiver, home_object, key. | 2038 // Stack: receiver, home_object, key. |
| 2040 SetExpressionPosition(prop); | 2039 SetExpressionPosition(prop); |
| 2041 __ push(Immediate(Smi::FromInt(language_mode()))); | |
| 2042 __ CallRuntime(Runtime::kLoadKeyedFromSuper); | 2040 __ CallRuntime(Runtime::kLoadKeyedFromSuper); |
| 2043 } | 2041 } |
| 2044 | 2042 |
| 2045 | 2043 |
| 2046 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2044 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
| 2047 Token::Value op, | 2045 Token::Value op, |
| 2048 Expression* left, | 2046 Expression* left, |
| 2049 Expression* right) { | 2047 Expression* right) { |
| 2050 // Do combined smi check of the operands. Left operand is on the | 2048 // Do combined smi check of the operands. Left operand is on the |
| 2051 // stack. Right operand is in eax. | 2049 // stack. Right operand is in eax. |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2542 Literal* key = prop->key()->AsLiteral(); | 2540 Literal* key = prop->key()->AsLiteral(); |
| 2543 DCHECK(!key->value()->IsSmi()); | 2541 DCHECK(!key->value()->IsSmi()); |
| 2544 // Load the function from the receiver. | 2542 // Load the function from the receiver. |
| 2545 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2543 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
| 2546 VisitForStackValue(super_ref->home_object()); | 2544 VisitForStackValue(super_ref->home_object()); |
| 2547 VisitForAccumulatorValue(super_ref->this_var()); | 2545 VisitForAccumulatorValue(super_ref->this_var()); |
| 2548 __ push(eax); | 2546 __ push(eax); |
| 2549 __ push(eax); | 2547 __ push(eax); |
| 2550 __ push(Operand(esp, kPointerSize * 2)); | 2548 __ push(Operand(esp, kPointerSize * 2)); |
| 2551 __ push(Immediate(key->value())); | 2549 __ push(Immediate(key->value())); |
| 2552 __ push(Immediate(Smi::FromInt(language_mode()))); | |
| 2553 // Stack here: | 2550 // Stack here: |
| 2554 // - home_object | 2551 // - home_object |
| 2555 // - this (receiver) | 2552 // - this (receiver) |
| 2556 // - this (receiver) <-- LoadFromSuper will pop here and below. | 2553 // - this (receiver) <-- LoadFromSuper will pop here and below. |
| 2557 // - home_object | 2554 // - home_object |
| 2558 // - key | 2555 // - key |
| 2559 // - language_mode | |
| 2560 __ CallRuntime(Runtime::kLoadFromSuper); | 2556 __ CallRuntime(Runtime::kLoadFromSuper); |
| 2561 | 2557 |
| 2562 // Replace home_object with target function. | 2558 // Replace home_object with target function. |
| 2563 __ mov(Operand(esp, kPointerSize), eax); | 2559 __ mov(Operand(esp, kPointerSize), eax); |
| 2564 | 2560 |
| 2565 // Stack here: | 2561 // Stack here: |
| 2566 // - target function | 2562 // - target function |
| 2567 // - this (receiver) | 2563 // - this (receiver) |
| 2568 EmitCall(expr); | 2564 EmitCall(expr); |
| 2569 } | 2565 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2600 | 2596 |
| 2601 SetExpressionPosition(prop); | 2597 SetExpressionPosition(prop); |
| 2602 // Load the function from the receiver. | 2598 // Load the function from the receiver. |
| 2603 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2599 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
| 2604 VisitForStackValue(super_ref->home_object()); | 2600 VisitForStackValue(super_ref->home_object()); |
| 2605 VisitForAccumulatorValue(super_ref->this_var()); | 2601 VisitForAccumulatorValue(super_ref->this_var()); |
| 2606 __ push(eax); | 2602 __ push(eax); |
| 2607 __ push(eax); | 2603 __ push(eax); |
| 2608 __ push(Operand(esp, kPointerSize * 2)); | 2604 __ push(Operand(esp, kPointerSize * 2)); |
| 2609 VisitForStackValue(prop->key()); | 2605 VisitForStackValue(prop->key()); |
| 2610 __ push(Immediate(Smi::FromInt(language_mode()))); | |
| 2611 // Stack here: | 2606 // Stack here: |
| 2612 // - home_object | 2607 // - home_object |
| 2613 // - this (receiver) | 2608 // - this (receiver) |
| 2614 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 2609 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
| 2615 // - home_object | 2610 // - home_object |
| 2616 // - key | 2611 // - key |
| 2617 // - language_mode | |
| 2618 __ CallRuntime(Runtime::kLoadKeyedFromSuper); | 2612 __ CallRuntime(Runtime::kLoadKeyedFromSuper); |
| 2619 | 2613 |
| 2620 // Replace home_object with target function. | 2614 // Replace home_object with target function. |
| 2621 __ mov(Operand(esp, kPointerSize), eax); | 2615 __ mov(Operand(esp, kPointerSize), eax); |
| 2622 | 2616 |
| 2623 // Stack here: | 2617 // Stack here: |
| 2624 // - target function | 2618 // - target function |
| 2625 // - this (receiver) | 2619 // - this (receiver) |
| 2626 EmitCall(expr); | 2620 EmitCall(expr); |
| 2627 } | 2621 } |
| (...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4504 Assembler::target_address_at(call_target_address, | 4498 Assembler::target_address_at(call_target_address, |
| 4505 unoptimized_code)); | 4499 unoptimized_code)); |
| 4506 return OSR_AFTER_STACK_CHECK; | 4500 return OSR_AFTER_STACK_CHECK; |
| 4507 } | 4501 } |
| 4508 | 4502 |
| 4509 | 4503 |
| 4510 } // namespace internal | 4504 } // namespace internal |
| 4511 } // namespace v8 | 4505 } // namespace v8 |
| 4512 | 4506 |
| 4513 #endif // V8_TARGET_ARCH_IA32 | 4507 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |