| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 // ----------------------------------------------------------------------------- | 118 // ----------------------------------------------------------------------------- |
| 119 // Implementation of AssemblerBase | 119 // Implementation of AssemblerBase |
| 120 | 120 |
| 121 AssemblerBase::AssemblerBase(Isolate* isolate, void* buffer, int buffer_size) | 121 AssemblerBase::AssemblerBase(Isolate* isolate, void* buffer, int buffer_size) |
| 122 : isolate_(isolate), | 122 : isolate_(isolate), |
| 123 jit_cookie_(0), | 123 jit_cookie_(0), |
| 124 enabled_cpu_features_(0), | 124 enabled_cpu_features_(0), |
| 125 emit_debug_code_(FLAG_debug_code), | 125 emit_debug_code_(FLAG_debug_code), |
| 126 predictable_code_size_(false), | 126 predictable_code_size_(false), |
| 127 serializer_enabled_(Serializer::enabled(isolate)) { | 127 // We may use the assembler without an isolate. |
| 128 serializer_enabled_(isolate && isolate->serializer_enabled()) { |
| 128 if (FLAG_mask_constants_with_cookie && isolate != NULL) { | 129 if (FLAG_mask_constants_with_cookie && isolate != NULL) { |
| 129 jit_cookie_ = isolate->random_number_generator()->NextInt(); | 130 jit_cookie_ = isolate->random_number_generator()->NextInt(); |
| 130 } | 131 } |
| 131 if (buffer == NULL) { | 132 if (buffer == NULL) { |
| 132 // Do our own buffer management. | 133 // Do our own buffer management. |
| 133 if (buffer_size <= kMinimalBufferSize) { | 134 if (buffer_size <= kMinimalBufferSize) { |
| 134 buffer_size = kMinimalBufferSize; | 135 buffer_size = kMinimalBufferSize; |
| 135 if (isolate->assembler_spare_buffer() != NULL) { | 136 if (isolate->assembler_spare_buffer() != NULL) { |
| 136 buffer = isolate->assembler_spare_buffer(); | 137 buffer = isolate->assembler_spare_buffer(); |
| 137 isolate->set_assembler_spare_buffer(NULL); | 138 isolate->set_assembler_spare_buffer(NULL); |
| (...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1635 r2 = r2 - ad; | 1636 r2 = r2 - ad; |
| 1636 } | 1637 } |
| 1637 delta = ad - r2; | 1638 delta = ad - r2; |
| 1638 } while (q1 < delta || (q1 == delta && r1 == 0)); | 1639 } while (q1 < delta || (q1 == delta && r1 == 0)); |
| 1639 int32_t mul = static_cast<int32_t>(q2 + 1); | 1640 int32_t mul = static_cast<int32_t>(q2 + 1); |
| 1640 multiplier_ = (d < 0) ? -mul : mul; | 1641 multiplier_ = (d < 0) ? -mul : mul; |
| 1641 shift_ = p - 32; | 1642 shift_ = p - 32; |
| 1642 } | 1643 } |
| 1643 | 1644 |
| 1644 } } // namespace v8::internal | 1645 } } // namespace v8::internal |
| OLD | NEW |