Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 2732273003: Disentangle assembler from isolate. (Closed)
Patch Set: Address feedback. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x87/assembler-x87.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_X64 5 #if V8_TARGET_ARCH_X64
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/counters.h" 12 #include "src/counters.h"
12 #include "src/debug/debug.h" 13 #include "src/debug/debug.h"
13 #include "src/heap/heap-inl.h" 14 #include "src/heap/heap-inl.h"
14 #include "src/objects-inl.h" 15 #include "src/objects-inl.h"
15 #include "src/register-configuration.h" 16 #include "src/register-configuration.h"
16 #include "src/x64/assembler-x64.h" 17 #include "src/x64/assembler-x64.h"
17 18
18 #include "src/x64/macro-assembler-x64.h" // Cannot be the first include. 19 #include "src/x64/macro-assembler-x64.h" // Cannot be the first include.
19 20
20 namespace v8 { 21 namespace v8 {
21 namespace internal { 22 namespace internal {
22 23
23 MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size, 24 MacroAssembler::MacroAssembler(Isolate* isolate, void* buffer, int size,
24 CodeObjectRequired create_code_object) 25 CodeObjectRequired create_code_object)
25 : Assembler(arg_isolate, buffer, size), 26 : Assembler(isolate, buffer, size),
26 generating_stub_(false), 27 generating_stub_(false),
27 has_frame_(false), 28 has_frame_(false),
28 root_array_available_(true) { 29 isolate_(isolate),
30 root_array_available_(true),
31 jit_cookie_(0) {
32 if (FLAG_mask_constants_with_cookie) {
33 jit_cookie_ = isolate->random_number_generator()->NextInt();
34 }
29 if (create_code_object == CodeObjectRequired::kYes) { 35 if (create_code_object == CodeObjectRequired::kYes) {
30 code_object_ = 36 code_object_ =
31 Handle<Object>::New(isolate()->heap()->undefined_value(), isolate()); 37 Handle<Object>::New(isolate_->heap()->undefined_value(), isolate_);
32 } 38 }
33 } 39 }
34 40
35 41
36 static const int64_t kInvalidRootRegisterDelta = -1; 42 static const int64_t kInvalidRootRegisterDelta = -1;
37 43
38 44
39 int64_t MacroAssembler::RootRegisterDelta(ExternalReference other) { 45 int64_t MacroAssembler::RootRegisterDelta(ExternalReference other) {
40 if (predictable_code_size() && 46 if (predictable_code_size() &&
41 (other.address() < reinterpret_cast<Address>(isolate()) || 47 (other.address() < reinterpret_cast<Address>(isolate()) ||
(...skipping 5232 matching lines...) Expand 10 before | Expand all | Expand 10 after
5274 movl(rax, dividend); 5280 movl(rax, dividend);
5275 shrl(rax, Immediate(31)); 5281 shrl(rax, Immediate(31));
5276 addl(rdx, rax); 5282 addl(rdx, rax);
5277 } 5283 }
5278 5284
5279 5285
5280 } // namespace internal 5286 } // namespace internal
5281 } // namespace v8 5287 } // namespace v8
5282 5288
5283 #endif // V8_TARGET_ARCH_X64 5289 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x87/assembler-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698