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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 push(Immediate(smi)); | 311 push(Immediate(smi)); |
312 } | 312 } |
313 } else { | 313 } else { |
314 ASSERT(source->IsHeapObject()); | 314 ASSERT(source->IsHeapObject()); |
315 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT); | 315 movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT); |
316 push(kScratchRegister); | 316 push(kScratchRegister); |
317 } | 317 } |
318 } | 318 } |
319 | 319 |
320 | 320 |
| 321 void MacroAssembler::Push(Smi* source) { |
| 322 if (IsUnsafeSmi(source)) { |
| 323 LoadUnsafeSmi(kScratchRegister, source); |
| 324 push(kScratchRegister); |
| 325 } else { |
| 326 int32_t smi = static_cast<int32_t>(reinterpret_cast<intptr_t>(source)); |
| 327 push(Immediate(smi)); |
| 328 } |
| 329 } |
| 330 |
| 331 |
321 void MacroAssembler::Jump(ExternalReference ext) { | 332 void MacroAssembler::Jump(ExternalReference ext) { |
322 movq(kScratchRegister, ext); | 333 movq(kScratchRegister, ext); |
323 jmp(kScratchRegister); | 334 jmp(kScratchRegister); |
324 } | 335 } |
325 | 336 |
326 | 337 |
327 void MacroAssembler::Jump(Address destination, RelocInfo::Mode rmode) { | 338 void MacroAssembler::Jump(Address destination, RelocInfo::Mode rmode) { |
328 movq(kScratchRegister, destination, rmode); | 339 movq(kScratchRegister, destination, rmode); |
329 jmp(kScratchRegister); | 340 jmp(kScratchRegister); |
330 } | 341 } |
(...skipping 25 matching lines...) Expand all Loading... |
356 movq(kScratchRegister, destination, rmode); | 367 movq(kScratchRegister, destination, rmode); |
357 call(kScratchRegister); | 368 call(kScratchRegister); |
358 } | 369 } |
359 | 370 |
360 | 371 |
361 void MacroAssembler::Call(Handle<Code> code_object, RelocInfo::Mode rmode) { | 372 void MacroAssembler::Call(Handle<Code> code_object, RelocInfo::Mode rmode) { |
362 WriteRecordedPositions(); | 373 WriteRecordedPositions(); |
363 ASSERT(RelocInfo::IsCodeTarget(rmode)); | 374 ASSERT(RelocInfo::IsCodeTarget(rmode)); |
364 movq(kScratchRegister, code_object, rmode); | 375 movq(kScratchRegister, code_object, rmode); |
365 #ifdef DEBUG | 376 #ifdef DEBUG |
| 377 // Patch target is kPointer size bytes *before* target label. |
366 Label target; | 378 Label target; |
367 bind(&target); | 379 bind(&target); |
368 #endif | 380 #endif |
369 call(kScratchRegister); | 381 call(kScratchRegister); |
370 #ifdef DEBUG | 382 #ifdef DEBUG |
371 ASSERT_EQ(kTargetAddrToReturnAddrDist, | 383 ASSERT_EQ(kTargetAddrToReturnAddrDist, |
372 SizeOfCodeGeneratedSince(&target) + kPointerSize); | 384 SizeOfCodeGeneratedSince(&target) + kPointerSize); |
373 #endif | 385 #endif |
374 } | 386 } |
375 | 387 |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 Context::SECURITY_TOKEN_INDEX * kPointerSize; | 1045 Context::SECURITY_TOKEN_INDEX * kPointerSize; |
1034 movq(scratch, FieldOperand(scratch, token_offset)); | 1046 movq(scratch, FieldOperand(scratch, token_offset)); |
1035 cmpq(scratch, FieldOperand(kScratchRegister, token_offset)); | 1047 cmpq(scratch, FieldOperand(kScratchRegister, token_offset)); |
1036 j(not_equal, miss); | 1048 j(not_equal, miss); |
1037 | 1049 |
1038 bind(&same_contexts); | 1050 bind(&same_contexts); |
1039 } | 1051 } |
1040 | 1052 |
1041 | 1053 |
1042 } } // namespace v8::internal | 1054 } } // namespace v8::internal |
OLD | NEW |