| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 #ifdef DEBUG | 279 #ifdef DEBUG |
| 280 if (msg != NULL) { | 280 if (msg != NULL) { |
| 281 RecordComment("Abort message: "); | 281 RecordComment("Abort message: "); |
| 282 RecordComment(msg); | 282 RecordComment(msg); |
| 283 } | 283 } |
| 284 #endif | 284 #endif |
| 285 push(rax); | 285 push(rax); |
| 286 movq(kScratchRegister, p0, RelocInfo::NONE); | 286 movq(kScratchRegister, p0, RelocInfo::NONE); |
| 287 push(kScratchRegister); | 287 push(kScratchRegister); |
| 288 movq(kScratchRegister, | 288 movq(kScratchRegister, |
| 289 reinterpret_cast<intptr_t>(Smi::FromInt(p1 - p0)), | 289 reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(p1 - p0))), |
| 290 RelocInfo::NONE); | 290 RelocInfo::NONE); |
| 291 push(kScratchRegister); | 291 push(kScratchRegister); |
| 292 CallRuntime(Runtime::kAbort, 2); | 292 CallRuntime(Runtime::kAbort, 2); |
| 293 // will not return here | 293 // will not return here |
| 294 } | 294 } |
| 295 | 295 |
| 296 | 296 |
| 297 void MacroAssembler::CallStub(CodeStub* stub) { | 297 void MacroAssembler::CallStub(CodeStub* stub) { |
| 298 ASSERT(allow_stub_calls()); // calls are not allowed in some stubs | 298 ASSERT(allow_stub_calls()); // calls are not allowed in some stubs |
| 299 Call(stub->GetCode(), RelocInfo::CODE_TARGET); | 299 Call(stub->GetCode(), RelocInfo::CODE_TARGET); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 movq(rdi, FieldOperand(rdx, builtins_offset)); | 395 movq(rdi, FieldOperand(rdx, builtins_offset)); |
| 396 | 396 |
| 397 return Builtins::GetCode(id, resolved); | 397 return Builtins::GetCode(id, resolved); |
| 398 } | 398 } |
| 399 | 399 |
| 400 | 400 |
| 401 void MacroAssembler::Set(Register dst, int64_t x) { | 401 void MacroAssembler::Set(Register dst, int64_t x) { |
| 402 if (x == 0) { | 402 if (x == 0) { |
| 403 xor_(dst, dst); | 403 xor_(dst, dst); |
| 404 } else if (is_int32(x)) { | 404 } else if (is_int32(x)) { |
| 405 movq(dst, Immediate(x)); | 405 movq(dst, Immediate(static_cast<int32_t>(x))); |
| 406 } else if (is_uint32(x)) { | 406 } else if (is_uint32(x)) { |
| 407 movl(dst, Immediate(x)); | 407 movl(dst, Immediate(static_cast<uint32_t>(x))); |
| 408 } else { | 408 } else { |
| 409 movq(dst, x, RelocInfo::NONE); | 409 movq(dst, x, RelocInfo::NONE); |
| 410 } | 410 } |
| 411 } | 411 } |
| 412 | 412 |
| 413 | 413 |
| 414 void MacroAssembler::Set(const Operand& dst, int64_t x) { | 414 void MacroAssembler::Set(const Operand& dst, int64_t x) { |
| 415 if (x == 0) { | 415 if (x == 0) { |
| 416 xor_(kScratchRegister, kScratchRegister); | 416 xor_(kScratchRegister, kScratchRegister); |
| 417 movq(dst, kScratchRegister); | 417 movq(dst, kScratchRegister); |
| 418 } else if (is_int32(x)) { | 418 } else if (is_int32(x)) { |
| 419 movq(dst, Immediate(x)); | 419 movq(dst, Immediate(static_cast<int32_t>(x))); |
| 420 } else if (is_uint32(x)) { | 420 } else if (is_uint32(x)) { |
| 421 movl(dst, Immediate(x)); | 421 movl(dst, Immediate(static_cast<uint32_t>(x))); |
| 422 } else { | 422 } else { |
| 423 movq(kScratchRegister, x, RelocInfo::NONE); | 423 movq(kScratchRegister, x, RelocInfo::NONE); |
| 424 movq(dst, kScratchRegister); | 424 movq(dst, kScratchRegister); |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 // ---------------------------------------------------------------------------- | 428 // ---------------------------------------------------------------------------- |
| 429 // Smi tagging, untagging and tag detection. | 429 // Smi tagging, untagging and tag detection. |
| 430 | 430 |
| 431 static int kSmiShift = kSmiTagSize + kSmiShiftSize; | 431 static int kSmiShift = kSmiTagSize + kSmiShiftSize; |
| (...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2241 CodePatcher::~CodePatcher() { | 2241 CodePatcher::~CodePatcher() { |
| 2242 // Indicate that code has changed. | 2242 // Indicate that code has changed. |
| 2243 CPU::FlushICache(address_, size_); | 2243 CPU::FlushICache(address_, size_); |
| 2244 | 2244 |
| 2245 // Check that the code was patched as expected. | 2245 // Check that the code was patched as expected. |
| 2246 ASSERT(masm_.pc_ == address_ + size_); | 2246 ASSERT(masm_.pc_ == address_ + size_); |
| 2247 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2247 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 2248 } | 2248 } |
| 2249 | 2249 |
| 2250 } } // namespace v8::internal | 2250 } } // namespace v8::internal |
| OLD | NEW |