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