| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 MacroAssembler::MacroAssembler(void* buffer, int size) | 39 MacroAssembler::MacroAssembler(void* buffer, int size) |
| 40 : Assembler(buffer, size), | 40 : Assembler(buffer, size), |
| 41 unresolved_(0), | 41 unresolved_(0), |
| 42 generating_stub_(false), | 42 generating_stub_(false), |
| 43 allow_stub_calls_(true), | 43 allow_stub_calls_(true), |
| 44 code_object_(Heap::undefined_value()) { | 44 code_object_(Heap::undefined_value()) { |
| 45 } | 45 } |
| 46 | 46 |
| 47 | 47 |
| 48 // TODO(x64): For now, the write barrier is disabled on x64 and we |
| 49 // therefore generate no code. This should be fixed when the write |
| 50 // barrier is enabled. |
| 51 void MacroAssembler::RecordWrite(Register object, int offset, |
| 52 Register value, Register scratch) { |
| 53 } |
| 54 |
| 55 |
| 48 void MacroAssembler::Assert(Condition cc, const char* msg) { | 56 void MacroAssembler::Assert(Condition cc, const char* msg) { |
| 49 if (FLAG_debug_code) Check(cc, msg); | 57 if (FLAG_debug_code) Check(cc, msg); |
| 50 } | 58 } |
| 51 | 59 |
| 52 | 60 |
| 53 void MacroAssembler::Check(Condition cc, const char* msg) { | 61 void MacroAssembler::Check(Condition cc, const char* msg) { |
| 54 Label L; | 62 Label L; |
| 55 j(cc, &L); | 63 j(cc, &L); |
| 56 Abort(msg); | 64 Abort(msg); |
| 57 // will not return here | 65 // will not return here |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 // Link this handler. | 351 // Link this handler. |
| 344 movq(Operand(kScratchRegister, 0), rsp); | 352 movq(Operand(kScratchRegister, 0), rsp); |
| 345 } | 353 } |
| 346 | 354 |
| 347 | 355 |
| 348 void MacroAssembler::Ret() { | 356 void MacroAssembler::Ret() { |
| 349 ret(0); | 357 ret(0); |
| 350 } | 358 } |
| 351 | 359 |
| 352 | 360 |
| 361 void MacroAssembler::CmpHeapObject(Register heap_object_reg, |
| 362 Handle<Object> heap_object) { |
| 363 ASSERT(heap_object->IsHeapObject()); |
| 364 movq(kScratchRegister, heap_object, RelocInfo::EMBEDDED_OBJECT); |
| 365 cmpq(heap_object_reg, kScratchRegister); |
| 366 } |
| 367 |
| 368 |
| 369 void MacroAssembler::PushHeapObject(Handle<Object> heap_object) { |
| 370 ASSERT(heap_object->IsHeapObject()); |
| 371 movq(kScratchRegister, heap_object, RelocInfo::EMBEDDED_OBJECT); |
| 372 push(kScratchRegister); |
| 373 } |
| 374 |
| 375 |
| 353 void MacroAssembler::CmpObjectType(Register heap_object, | 376 void MacroAssembler::CmpObjectType(Register heap_object, |
| 354 InstanceType type, | 377 InstanceType type, |
| 355 Register map) { | 378 Register map) { |
| 356 movq(map, FieldOperand(heap_object, HeapObject::kMapOffset)); | 379 movq(map, FieldOperand(heap_object, HeapObject::kMapOffset)); |
| 357 CmpInstanceType(map, type); | 380 CmpInstanceType(map, type); |
| 358 } | 381 } |
| 359 | 382 |
| 360 | 383 |
| 361 void MacroAssembler::CmpInstanceType(Register map, InstanceType type) { | 384 void MacroAssembler::CmpInstanceType(Register map, InstanceType type) { |
| 362 cmpb(FieldOperand(map, Map::kInstanceTypeOffset), | 385 cmpb(FieldOperand(map, Map::kInstanceTypeOffset), |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 push(rcx); | 755 push(rcx); |
| 733 | 756 |
| 734 // Clear the top frame. | 757 // Clear the top frame. |
| 735 ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address); | 758 ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address); |
| 736 movq(kScratchRegister, c_entry_fp_address); | 759 movq(kScratchRegister, c_entry_fp_address); |
| 737 movq(Operand(kScratchRegister, 0), Immediate(0)); | 760 movq(Operand(kScratchRegister, 0), Immediate(0)); |
| 738 } | 761 } |
| 739 | 762 |
| 740 | 763 |
| 741 } } // namespace v8::internal | 764 } } // namespace v8::internal |
| OLD | NEW |