| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 namespace v8 { | 41 namespace v8 { |
| 42 namespace internal { | 42 namespace internal { |
| 43 | 43 |
| 44 | 44 |
| 45 #define __ ACCESS_MASM(masm_) | 45 #define __ ACCESS_MASM(masm_) |
| 46 | 46 |
| 47 | 47 |
| 48 class JumpPatchSite BASE_EMBEDDED { | 48 class JumpPatchSite BASE_EMBEDDED { |
| 49 public: | 49 public: |
| 50 explicit JumpPatchSite(MacroAssembler* masm) | 50 explicit JumpPatchSite(MacroAssembler* masm) : masm_(masm) { |
| 51 : masm_(masm) { | |
| 52 #ifdef DEBUG | 51 #ifdef DEBUG |
| 53 info_emitted_ = false; | 52 info_emitted_ = false; |
| 54 #endif | 53 #endif |
| 55 } | 54 } |
| 56 | 55 |
| 57 ~JumpPatchSite() { | 56 ~JumpPatchSite() { |
| 58 ASSERT(patch_site_.is_bound() == info_emitted_); | 57 ASSERT(patch_site_.is_bound() == info_emitted_); |
| 59 } | 58 } |
| 60 | 59 |
| 61 void EmitJumpIfNotSmi(Register reg, NearLabel* target) { | 60 void EmitJumpIfNotSmi(Register reg, NearLabel* target) { |
| 62 __ test(reg, Immediate(kSmiTagMask)); | 61 __ test(reg, Immediate(kSmiTagMask)); |
| 63 EmitJump(not_carry, target); // Always taken before patched. | 62 EmitJump(not_carry, target); // Always taken before patched. |
| 64 } | 63 } |
| 65 | 64 |
| 66 void EmitJumpIfSmi(Register reg, NearLabel* target) { | 65 void EmitJumpIfSmi(Register reg, NearLabel* target) { |
| 67 __ test(reg, Immediate(kSmiTagMask)); | 66 __ test(reg, Immediate(kSmiTagMask)); |
| 68 EmitJump(carry, target); // Never taken before patched. | 67 EmitJump(carry, target); // Never taken before patched. |
| 69 } | 68 } |
| 70 | 69 |
| 71 void EmitPatchInfo() { | 70 void EmitPatchInfo() { |
| 72 int delta_to_patch_site = masm_->SizeOfCodeGeneratedSince(&patch_site_); | 71 int delta_to_patch_site = masm_->SizeOfCodeGeneratedSince(&patch_site_); |
| 73 ASSERT(is_int8(delta_to_patch_site)); | 72 ASSERT(is_int8(delta_to_patch_site)); |
| (...skipping 4325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4399 // And return. | 4398 // And return. |
| 4400 __ ret(0); | 4399 __ ret(0); |
| 4401 } | 4400 } |
| 4402 | 4401 |
| 4403 | 4402 |
| 4404 #undef __ | 4403 #undef __ |
| 4405 | 4404 |
| 4406 } } // namespace v8::internal | 4405 } } // namespace v8::internal |
| 4407 | 4406 |
| 4408 #endif // V8_TARGET_ARCH_IA32 | 4407 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |