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/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 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1683 mov(result, FieldOperand(map, Map::kConstructorOrBackPointerOffset)); | 1683 mov(result, FieldOperand(map, Map::kConstructorOrBackPointerOffset)); |
1684 bind(&loop); | 1684 bind(&loop); |
1685 JumpIfSmi(result, &done, Label::kNear); | 1685 JumpIfSmi(result, &done, Label::kNear); |
1686 CmpObjectType(result, MAP_TYPE, temp); | 1686 CmpObjectType(result, MAP_TYPE, temp); |
1687 j(not_equal, &done, Label::kNear); | 1687 j(not_equal, &done, Label::kNear); |
1688 mov(result, FieldOperand(result, Map::kConstructorOrBackPointerOffset)); | 1688 mov(result, FieldOperand(result, Map::kConstructorOrBackPointerOffset)); |
1689 jmp(&loop); | 1689 jmp(&loop); |
1690 bind(&done); | 1690 bind(&done); |
1691 } | 1691 } |
1692 | 1692 |
1693 | |
1694 void MacroAssembler::TryGetFunctionPrototype(Register function, Register result, | |
1695 Register scratch, Label* miss) { | |
1696 // Get the prototype or initial map from the function. | |
1697 mov(result, | |
1698 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | |
1699 | |
1700 // If the prototype or initial map is the hole, don't return it and | |
1701 // simply miss the cache instead. This will allow us to allocate a | |
1702 // prototype object on-demand in the runtime system. | |
1703 cmp(result, Immediate(isolate()->factory()->the_hole_value())); | |
1704 j(equal, miss); | |
1705 | |
1706 // If the function does not have an initial map, we're done. | |
1707 Label done; | |
1708 CmpObjectType(result, MAP_TYPE, scratch); | |
1709 j(not_equal, &done, Label::kNear); | |
1710 | |
1711 // Get the prototype from the initial map. | |
1712 mov(result, FieldOperand(result, Map::kPrototypeOffset)); | |
1713 | |
1714 // All done. | |
1715 bind(&done); | |
1716 } | |
1717 | |
1718 | |
1719 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { | 1693 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { |
1720 DCHECK(AllowThisStubCall(stub)); // Calls are not allowed in some stubs. | 1694 DCHECK(AllowThisStubCall(stub)); // Calls are not allowed in some stubs. |
1721 call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id); | 1695 call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id); |
1722 } | 1696 } |
1723 | 1697 |
1724 | 1698 |
1725 void MacroAssembler::TailCallStub(CodeStub* stub) { | 1699 void MacroAssembler::TailCallStub(CodeStub* stub) { |
1726 jmp(stub->GetCode(), RelocInfo::CODE_TARGET); | 1700 jmp(stub->GetCode(), RelocInfo::CODE_TARGET); |
1727 } | 1701 } |
1728 | 1702 |
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2957 mov(eax, dividend); | 2931 mov(eax, dividend); |
2958 shr(eax, 31); | 2932 shr(eax, 31); |
2959 add(edx, eax); | 2933 add(edx, eax); |
2960 } | 2934 } |
2961 | 2935 |
2962 | 2936 |
2963 } // namespace internal | 2937 } // namespace internal |
2964 } // namespace v8 | 2938 } // namespace v8 |
2965 | 2939 |
2966 #endif // V8_TARGET_ARCH_IA32 | 2940 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |