Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
| (...skipping 3041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3052 | 3052 |
| 3053 #if defined(DEBUG) | 3053 #if defined(DEBUG) |
| 3054 void Assembler::VerifyObjectOrSmi(const Address& dest) { | 3054 void Assembler::VerifyObjectOrSmi(const Address& dest) { |
| 3055 Label ok; | 3055 Label ok; |
| 3056 testb(dest, Immediate(kHeapObjectTag)); | 3056 testb(dest, Immediate(kHeapObjectTag)); |
| 3057 j(ZERO, &ok, Assembler::kNearJump); | 3057 j(ZERO, &ok, Assembler::kNearJump); |
| 3058 // Non-smi case: Verify object pointer is word-aligned when untagged. | 3058 // Non-smi case: Verify object pointer is word-aligned when untagged. |
| 3059 COMPILE_ASSERT(kHeapObjectTag == 1); | 3059 COMPILE_ASSERT(kHeapObjectTag == 1); |
| 3060 testb(dest, Immediate((kWordSize - 1) - kHeapObjectTag)); | 3060 testb(dest, Immediate((kWordSize - 1) - kHeapObjectTag)); |
| 3061 j(ZERO, &ok, Assembler::kNearJump); | 3061 j(ZERO, &ok, Assembler::kNearJump); |
| 3062 Stop("Expected heap object or Smi"); | 3062 static const bool kFixedLengthEncoding = true; |
|
Florian Schneider
2015/01/12 10:31:51
It does not matter here, but I think we tend not t
| |
| 3063 Stop("Expected heap object or Smi", kFixedLengthEncoding); | |
| 3063 Bind(&ok); | 3064 Bind(&ok); |
| 3064 } | 3065 } |
| 3065 | 3066 |
| 3066 | 3067 |
| 3067 void Assembler::VerifyUninitialized(const Address& dest) { | 3068 void Assembler::VerifyUninitialized(const Address& dest) { |
| 3068 Label ok; | 3069 Label ok; |
| 3069 testb(dest, Immediate(kHeapObjectTag)); | 3070 testb(dest, Immediate(kHeapObjectTag)); |
| 3070 j(ZERO, &ok, Assembler::kNearJump); | 3071 j(ZERO, &ok, Assembler::kNearJump); |
| 3071 // Non-smi case: Check for the special zap word or null. | 3072 // Non-smi case: Check for the special zap word or null. |
| 3072 #if defined(DEBUG) | 3073 #if defined(DEBUG) |
| 3073 cmpq(dest, Immediate(Heap::kZap64Bits)); | 3074 cmpq(dest, Immediate(Heap::kZap64Bits)); |
| 3074 j(EQUAL, &ok, Assembler::kNearJump); | 3075 j(EQUAL, &ok, Assembler::kNearJump); |
| 3075 #else | 3076 #else |
| 3076 #error Only supported in DEBUG mode | 3077 #error Only supported in DEBUG mode |
| 3077 #endif | 3078 #endif |
| 3078 cmpq(dest, Immediate(reinterpret_cast<uint64_t>(Object::null()))); | 3079 cmpq(dest, Immediate(reinterpret_cast<uint64_t>(Object::null()))); |
| 3079 j(EQUAL, &ok, Assembler::kNearJump); | 3080 j(EQUAL, &ok, Assembler::kNearJump); |
| 3080 Stop("Expected zapped, Smi or null"); | 3081 static const bool kFixedLengthEncoding = true; |
|
Florian Schneider
2015/01/12 10:31:51
Same.
| |
| 3082 Stop("Expected zapped, Smi or null", kFixedLengthEncoding); | |
| 3081 Bind(&ok); | 3083 Bind(&ok); |
| 3082 } | 3084 } |
| 3083 | 3085 |
| 3084 | 3086 |
| 3085 void Assembler::VerifySmi(const Address& dest, const char* stop_msg) { | 3087 void Assembler::VerifySmi(const Address& dest, const char* stop_msg) { |
| 3086 Label done; | 3088 Label done; |
| 3087 testb(dest, Immediate(kHeapObjectTag)); | 3089 testb(dest, Immediate(kHeapObjectTag)); |
| 3088 j(ZERO, &done, Assembler::kNearJump); | 3090 j(ZERO, &done, Assembler::kNearJump); |
| 3089 static const bool kFixedLengthEncoding = true; | 3091 static const bool kFixedLengthEncoding = true; |
| 3090 Stop(stop_msg, kFixedLengthEncoding); | 3092 Stop(stop_msg, kFixedLengthEncoding); |
| (...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4000 | 4002 |
| 4001 | 4003 |
| 4002 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 4004 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 4003 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 4005 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
| 4004 return xmm_reg_names[reg]; | 4006 return xmm_reg_names[reg]; |
| 4005 } | 4007 } |
| 4006 | 4008 |
| 4007 } // namespace dart | 4009 } // namespace dart |
| 4008 | 4010 |
| 4009 #endif // defined TARGET_ARCH_X64 | 4011 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |