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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1616 mov(result, FieldOperand(map, Map::kConstructorOrBackPointerOffset)); | 1616 mov(result, FieldOperand(map, Map::kConstructorOrBackPointerOffset)); |
1617 bind(&loop); | 1617 bind(&loop); |
1618 JumpIfSmi(result, &done, Label::kNear); | 1618 JumpIfSmi(result, &done, Label::kNear); |
1619 CmpObjectType(result, MAP_TYPE, temp); | 1619 CmpObjectType(result, MAP_TYPE, temp); |
1620 j(not_equal, &done, Label::kNear); | 1620 j(not_equal, &done, Label::kNear); |
1621 mov(result, FieldOperand(result, Map::kConstructorOrBackPointerOffset)); | 1621 mov(result, FieldOperand(result, Map::kConstructorOrBackPointerOffset)); |
1622 jmp(&loop); | 1622 jmp(&loop); |
1623 bind(&done); | 1623 bind(&done); |
1624 } | 1624 } |
1625 | 1625 |
1626 | |
1627 void MacroAssembler::TryGetFunctionPrototype(Register function, Register result, | |
1628 Register scratch, Label* miss) { | |
1629 // Get the prototype or initial map from the function. | |
1630 mov(result, | |
1631 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | |
1632 | |
1633 // If the prototype or initial map is the hole, don't return it and | |
1634 // simply miss the cache instead. This will allow us to allocate a | |
1635 // prototype object on-demand in the runtime system. | |
1636 cmp(result, Immediate(isolate()->factory()->the_hole_value())); | |
1637 j(equal, miss); | |
1638 | |
1639 // If the function does not have an initial map, we're done. | |
1640 Label done; | |
1641 CmpObjectType(result, MAP_TYPE, scratch); | |
1642 j(not_equal, &done, Label::kNear); | |
1643 | |
1644 // Get the prototype from the initial map. | |
1645 mov(result, FieldOperand(result, Map::kPrototypeOffset)); | |
1646 | |
1647 // All done. | |
1648 bind(&done); | |
1649 } | |
1650 | |
1651 | |
1652 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { | 1626 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { |
1653 DCHECK(AllowThisStubCall(stub)); // Calls are not allowed in some stubs. | 1627 DCHECK(AllowThisStubCall(stub)); // Calls are not allowed in some stubs. |
1654 call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id); | 1628 call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id); |
1655 } | 1629 } |
1656 | 1630 |
1657 | 1631 |
1658 void MacroAssembler::TailCallStub(CodeStub* stub) { | 1632 void MacroAssembler::TailCallStub(CodeStub* stub) { |
1659 jmp(stub->GetCode(), RelocInfo::CODE_TARGET); | 1633 jmp(stub->GetCode(), RelocInfo::CODE_TARGET); |
1660 } | 1634 } |
1661 | 1635 |
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2795 mov(eax, dividend); | 2769 mov(eax, dividend); |
2796 shr(eax, 31); | 2770 shr(eax, 31); |
2797 add(edx, eax); | 2771 add(edx, eax); |
2798 } | 2772 } |
2799 | 2773 |
2800 | 2774 |
2801 } // namespace internal | 2775 } // namespace internal |
2802 } // namespace v8 | 2776 } // namespace v8 |
2803 | 2777 |
2804 #endif // V8_TARGET_ARCH_X87 | 2778 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |