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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1994 | 1994 |
1995 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 1995 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
1996 SetExpressionPosition(prop); | 1996 SetExpressionPosition(prop); |
1997 Literal* key = prop->key()->AsLiteral(); | 1997 Literal* key = prop->key()->AsLiteral(); |
1998 DCHECK(!key->value()->IsSmi()); | 1998 DCHECK(!key->value()->IsSmi()); |
1999 DCHECK(!prop->IsSuperAccess()); | 1999 DCHECK(!prop->IsSuperAccess()); |
2000 | 2000 |
2001 __ mov(LoadDescriptor::NameRegister(), Immediate(key->value())); | 2001 __ mov(LoadDescriptor::NameRegister(), Immediate(key->value())); |
2002 __ mov(LoadDescriptor::SlotRegister(), | 2002 __ mov(LoadDescriptor::SlotRegister(), |
2003 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2003 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2004 CallLoadIC(NOT_INSIDE_TYPEOF, language_mode()); | 2004 CallLoadIC(NOT_INSIDE_TYPEOF); |
2005 } | 2005 } |
2006 | 2006 |
2007 | 2007 |
2008 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2008 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
2009 // Stack: receiver, home_object. | 2009 // Stack: receiver, home_object. |
2010 SetExpressionPosition(prop); | 2010 SetExpressionPosition(prop); |
2011 Literal* key = prop->key()->AsLiteral(); | 2011 Literal* key = prop->key()->AsLiteral(); |
2012 DCHECK(!key->value()->IsSmi()); | 2012 DCHECK(!key->value()->IsSmi()); |
2013 DCHECK(prop->IsSuperAccess()); | 2013 DCHECK(prop->IsSuperAccess()); |
2014 | 2014 |
2015 __ push(Immediate(key->value())); | 2015 __ push(Immediate(key->value())); |
2016 __ push(Immediate(Smi::FromInt(language_mode()))); | |
2017 __ CallRuntime(Runtime::kLoadFromSuper); | 2016 __ CallRuntime(Runtime::kLoadFromSuper); |
2018 } | 2017 } |
2019 | 2018 |
2020 | 2019 |
2021 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2020 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
2022 SetExpressionPosition(prop); | 2021 SetExpressionPosition(prop); |
2023 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); | 2022 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
2024 __ mov(LoadDescriptor::SlotRegister(), | 2023 __ mov(LoadDescriptor::SlotRegister(), |
2025 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2024 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2026 CallIC(ic); | 2025 CallIC(ic); |
2027 } | 2026 } |
2028 | 2027 |
2029 | 2028 |
2030 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2029 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
2031 // Stack: receiver, home_object, key. | 2030 // Stack: receiver, home_object, key. |
2032 SetExpressionPosition(prop); | 2031 SetExpressionPosition(prop); |
2033 __ push(Immediate(Smi::FromInt(language_mode()))); | |
2034 __ CallRuntime(Runtime::kLoadKeyedFromSuper); | 2032 __ CallRuntime(Runtime::kLoadKeyedFromSuper); |
2035 } | 2033 } |
2036 | 2034 |
2037 | 2035 |
2038 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2036 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
2039 Token::Value op, | 2037 Token::Value op, |
2040 Expression* left, | 2038 Expression* left, |
2041 Expression* right) { | 2039 Expression* right) { |
2042 // Do combined smi check of the operands. Left operand is on the | 2040 // Do combined smi check of the operands. Left operand is on the |
2043 // stack. Right operand is in eax. | 2041 // stack. Right operand is in eax. |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2534 Literal* key = prop->key()->AsLiteral(); | 2532 Literal* key = prop->key()->AsLiteral(); |
2535 DCHECK(!key->value()->IsSmi()); | 2533 DCHECK(!key->value()->IsSmi()); |
2536 // Load the function from the receiver. | 2534 // Load the function from the receiver. |
2537 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2535 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
2538 VisitForStackValue(super_ref->home_object()); | 2536 VisitForStackValue(super_ref->home_object()); |
2539 VisitForAccumulatorValue(super_ref->this_var()); | 2537 VisitForAccumulatorValue(super_ref->this_var()); |
2540 __ push(eax); | 2538 __ push(eax); |
2541 __ push(eax); | 2539 __ push(eax); |
2542 __ push(Operand(esp, kPointerSize * 2)); | 2540 __ push(Operand(esp, kPointerSize * 2)); |
2543 __ push(Immediate(key->value())); | 2541 __ push(Immediate(key->value())); |
2544 __ push(Immediate(Smi::FromInt(language_mode()))); | |
2545 // Stack here: | 2542 // Stack here: |
2546 // - home_object | 2543 // - home_object |
2547 // - this (receiver) | 2544 // - this (receiver) |
2548 // - this (receiver) <-- LoadFromSuper will pop here and below. | 2545 // - this (receiver) <-- LoadFromSuper will pop here and below. |
2549 // - home_object | 2546 // - home_object |
2550 // - key | 2547 // - key |
2551 // - language_mode | |
2552 __ CallRuntime(Runtime::kLoadFromSuper); | 2548 __ CallRuntime(Runtime::kLoadFromSuper); |
2553 | 2549 |
2554 // Replace home_object with target function. | 2550 // Replace home_object with target function. |
2555 __ mov(Operand(esp, kPointerSize), eax); | 2551 __ mov(Operand(esp, kPointerSize), eax); |
2556 | 2552 |
2557 // Stack here: | 2553 // Stack here: |
2558 // - target function | 2554 // - target function |
2559 // - this (receiver) | 2555 // - this (receiver) |
2560 EmitCall(expr); | 2556 EmitCall(expr); |
2561 } | 2557 } |
(...skipping 30 matching lines...) Expand all Loading... |
2592 | 2588 |
2593 SetExpressionPosition(prop); | 2589 SetExpressionPosition(prop); |
2594 // Load the function from the receiver. | 2590 // Load the function from the receiver. |
2595 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2591 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
2596 VisitForStackValue(super_ref->home_object()); | 2592 VisitForStackValue(super_ref->home_object()); |
2597 VisitForAccumulatorValue(super_ref->this_var()); | 2593 VisitForAccumulatorValue(super_ref->this_var()); |
2598 __ push(eax); | 2594 __ push(eax); |
2599 __ push(eax); | 2595 __ push(eax); |
2600 __ push(Operand(esp, kPointerSize * 2)); | 2596 __ push(Operand(esp, kPointerSize * 2)); |
2601 VisitForStackValue(prop->key()); | 2597 VisitForStackValue(prop->key()); |
2602 __ push(Immediate(Smi::FromInt(language_mode()))); | |
2603 // Stack here: | 2598 // Stack here: |
2604 // - home_object | 2599 // - home_object |
2605 // - this (receiver) | 2600 // - this (receiver) |
2606 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 2601 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
2607 // - home_object | 2602 // - home_object |
2608 // - key | 2603 // - key |
2609 // - language_mode | |
2610 __ CallRuntime(Runtime::kLoadKeyedFromSuper); | 2604 __ CallRuntime(Runtime::kLoadKeyedFromSuper); |
2611 | 2605 |
2612 // Replace home_object with target function. | 2606 // Replace home_object with target function. |
2613 __ mov(Operand(esp, kPointerSize), eax); | 2607 __ mov(Operand(esp, kPointerSize), eax); |
2614 | 2608 |
2615 // Stack here: | 2609 // Stack here: |
2616 // - target function | 2610 // - target function |
2617 // - this (receiver) | 2611 // - this (receiver) |
2618 EmitCall(expr); | 2612 EmitCall(expr); |
2619 } | 2613 } |
(...skipping 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4488 Assembler::target_address_at(call_target_address, | 4482 Assembler::target_address_at(call_target_address, |
4489 unoptimized_code)); | 4483 unoptimized_code)); |
4490 return OSR_AFTER_STACK_CHECK; | 4484 return OSR_AFTER_STACK_CHECK; |
4491 } | 4485 } |
4492 | 4486 |
4493 | 4487 |
4494 } // namespace internal | 4488 } // namespace internal |
4495 } // namespace v8 | 4489 } // namespace v8 |
4496 | 4490 |
4497 #endif // V8_TARGET_ARCH_X87 | 4491 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |