OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
| 9 #include "src/base/utils/random-number-generator.h" |
9 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 11 #include "src/codegen.h" |
11 #include "src/debug/debug.h" | 12 #include "src/debug/debug.h" |
12 #include "src/ia32/frames-ia32.h" | 13 #include "src/ia32/frames-ia32.h" |
| 14 #include "src/runtime/runtime.h" |
| 15 |
13 #include "src/ia32/macro-assembler-ia32.h" | 16 #include "src/ia32/macro-assembler-ia32.h" |
14 #include "src/runtime/runtime.h" | |
15 | 17 |
16 namespace v8 { | 18 namespace v8 { |
17 namespace internal { | 19 namespace internal { |
18 | 20 |
19 // ------------------------------------------------------------------------- | 21 // ------------------------------------------------------------------------- |
20 // MacroAssembler implementation. | 22 // MacroAssembler implementation. |
21 | 23 |
22 MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size, | 24 MacroAssembler::MacroAssembler(Isolate* isolate, void* buffer, int size, |
23 CodeObjectRequired create_code_object) | 25 CodeObjectRequired create_code_object) |
24 : Assembler(arg_isolate, buffer, size), | 26 : Assembler(isolate, buffer, size), |
25 generating_stub_(false), | 27 generating_stub_(false), |
26 has_frame_(false) { | 28 has_frame_(false), |
| 29 isolate_(isolate), |
| 30 jit_cookie_(0) { |
| 31 if (FLAG_mask_constants_with_cookie) { |
| 32 jit_cookie_ = isolate->random_number_generator()->NextInt(); |
| 33 } |
27 if (create_code_object == CodeObjectRequired::kYes) { | 34 if (create_code_object == CodeObjectRequired::kYes) { |
28 code_object_ = | 35 code_object_ = |
29 Handle<Object>::New(isolate()->heap()->undefined_value(), isolate()); | 36 Handle<Object>::New(isolate_->heap()->undefined_value(), isolate_); |
30 } | 37 } |
31 } | 38 } |
32 | 39 |
33 | 40 |
34 void MacroAssembler::Load(Register dst, const Operand& src, Representation r) { | 41 void MacroAssembler::Load(Register dst, const Operand& src, Representation r) { |
35 DCHECK(!r.IsDouble()); | 42 DCHECK(!r.IsDouble()); |
36 if (r.IsInteger8()) { | 43 if (r.IsInteger8()) { |
37 movsx_b(dst, src); | 44 movsx_b(dst, src); |
38 } else if (r.IsUInteger8()) { | 45 } else if (r.IsUInteger8()) { |
39 movzx_b(dst, src); | 46 movzx_b(dst, src); |
(...skipping 2879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2919 mov(eax, dividend); | 2926 mov(eax, dividend); |
2920 shr(eax, 31); | 2927 shr(eax, 31); |
2921 add(edx, eax); | 2928 add(edx, eax); |
2922 } | 2929 } |
2923 | 2930 |
2924 | 2931 |
2925 } // namespace internal | 2932 } // namespace internal |
2926 } // namespace v8 | 2933 } // namespace v8 |
2927 | 2934 |
2928 #endif // V8_TARGET_ARCH_IA32 | 2935 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |