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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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 3375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3386 testb(object, Immediate(kSmiTagMask)); | 3386 testb(object, Immediate(kSmiTagMask)); |
3387 Check(not_equal, kOperandIsASmiAndNotAName); | 3387 Check(not_equal, kOperandIsASmiAndNotAName); |
3388 Push(object); | 3388 Push(object); |
3389 movp(object, FieldOperand(object, HeapObject::kMapOffset)); | 3389 movp(object, FieldOperand(object, HeapObject::kMapOffset)); |
3390 CmpInstanceType(object, LAST_NAME_TYPE); | 3390 CmpInstanceType(object, LAST_NAME_TYPE); |
3391 Pop(object); | 3391 Pop(object); |
3392 Check(below_equal, kOperandIsNotAName); | 3392 Check(below_equal, kOperandIsNotAName); |
3393 } | 3393 } |
3394 } | 3394 } |
3395 | 3395 |
3396 | |
3397 void MacroAssembler::AssertFunction(Register object) { | |
3398 if (emit_debug_code()) { | |
3399 testb(object, Immediate(kSmiTagMask)); | |
3400 Check(not_equal, kOperandIsASmiAndNotAFunction); | |
3401 Push(object); | |
3402 CmpObjectType(object, JS_FUNCTION_TYPE, object); | |
3403 Pop(object); | |
3404 Check(not_equal, kOperandIsNotAFunction); | |
3405 } | |
3406 } | |
3407 | |
3408 | 3396 |
3409 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) { | 3397 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) { |
3410 if (emit_debug_code()) { | 3398 if (emit_debug_code()) { |
3411 Label done_checking; | 3399 Label done_checking; |
3412 AssertNotSmi(object); | 3400 AssertNotSmi(object); |
3413 Cmp(object, isolate()->factory()->undefined_value()); | 3401 Cmp(object, isolate()->factory()->undefined_value()); |
3414 j(equal, &done_checking); | 3402 j(equal, &done_checking); |
3415 Cmp(FieldOperand(object, 0), isolate()->factory()->allocation_site_map()); | 3403 Cmp(FieldOperand(object, 0), isolate()->factory()->allocation_site_map()); |
3416 Assert(equal, kExpectedUndefinedOrCell); | 3404 Assert(equal, kExpectedUndefinedOrCell); |
3417 bind(&done_checking); | 3405 bind(&done_checking); |
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4548 // not agree). A variable occurring in such a scope should have | 4536 // not agree). A variable occurring in such a scope should have |
4549 // slot type LOOKUP and not CONTEXT. | 4537 // slot type LOOKUP and not CONTEXT. |
4550 if (emit_debug_code()) { | 4538 if (emit_debug_code()) { |
4551 CompareRoot(FieldOperand(dst, HeapObject::kMapOffset), | 4539 CompareRoot(FieldOperand(dst, HeapObject::kMapOffset), |
4552 Heap::kWithContextMapRootIndex); | 4540 Heap::kWithContextMapRootIndex); |
4553 Check(not_equal, kVariableResolvedToWithContext); | 4541 Check(not_equal, kVariableResolvedToWithContext); |
4554 } | 4542 } |
4555 } | 4543 } |
4556 | 4544 |
4557 | 4545 |
4558 void MacroAssembler::LoadGlobalProxy(Register dst) { | |
4559 movp(dst, GlobalObjectOperand()); | |
4560 movp(dst, FieldOperand(dst, GlobalObject::kGlobalProxyOffset)); | |
4561 } | |
4562 | |
4563 | |
4564 void MacroAssembler::LoadTransitionedArrayMapConditional( | 4546 void MacroAssembler::LoadTransitionedArrayMapConditional( |
4565 ElementsKind expected_kind, | 4547 ElementsKind expected_kind, |
4566 ElementsKind transitioned_kind, | 4548 ElementsKind transitioned_kind, |
4567 Register map_in_out, | 4549 Register map_in_out, |
4568 Register scratch, | 4550 Register scratch, |
4569 Label* no_map_match) { | 4551 Label* no_map_match) { |
4570 // Load the global or builtins object from the current context. | 4552 // Load the global or builtins object from the current context. |
4571 movp(scratch, | 4553 movp(scratch, |
4572 Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 4554 Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
4573 movp(scratch, FieldOperand(scratch, GlobalObject::kNativeContextOffset)); | 4555 movp(scratch, FieldOperand(scratch, GlobalObject::kNativeContextOffset)); |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5065 movl(rax, dividend); | 5047 movl(rax, dividend); |
5066 shrl(rax, Immediate(31)); | 5048 shrl(rax, Immediate(31)); |
5067 addl(rdx, rax); | 5049 addl(rdx, rax); |
5068 } | 5050 } |
5069 | 5051 |
5070 | 5052 |
5071 } // namespace internal | 5053 } // namespace internal |
5072 } // namespace v8 | 5054 } // namespace v8 |
5073 | 5055 |
5074 #endif // V8_TARGET_ARCH_X64 | 5056 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |