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

Side by Side Diff: src/compiler/ia32/code-generator-ia32.cc

Issue 1759383003: [compiler] Add relocatable pointer constants for wasm memory references. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removing additional check Created 4 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 offset.offset() + extra); 58 offset.offset() + extra);
59 } 59 }
60 60
61 Operand HighOperand(InstructionOperand* op) { 61 Operand HighOperand(InstructionOperand* op) {
62 DCHECK(op->IsDoubleStackSlot()); 62 DCHECK(op->IsDoubleStackSlot());
63 return ToOperand(op, kPointerSize); 63 return ToOperand(op, kPointerSize);
64 } 64 }
65 65
66 Immediate ToImmediate(InstructionOperand* operand) { 66 Immediate ToImmediate(InstructionOperand* operand) {
67 Constant constant = ToConstant(operand); 67 Constant constant = ToConstant(operand);
68 if (constant.type() == Constant::kInt32 &&
69 constant.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) {
70 return Immediate(reinterpret_cast<Address>(constant.ToInt32()),
71 constant.rmode());
72 }
68 switch (constant.type()) { 73 switch (constant.type()) {
69 case Constant::kInt32: 74 case Constant::kInt32:
70 return Immediate(constant.ToInt32()); 75 return Immediate(constant.ToInt32());
71 case Constant::kFloat32: 76 case Constant::kFloat32:
72 return Immediate( 77 return Immediate(
73 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED)); 78 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED));
74 case Constant::kFloat64: 79 case Constant::kFloat64:
75 return Immediate( 80 return Immediate(
76 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED)); 81 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED));
77 case Constant::kExternalReference: 82 case Constant::kExternalReference:
(...skipping 1796 matching lines...) Expand 10 before | Expand all | Expand 10 after
1874 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 1879 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
1875 __ Nop(padding_size); 1880 __ Nop(padding_size);
1876 } 1881 }
1877 } 1882 }
1878 1883
1879 #undef __ 1884 #undef __
1880 1885
1881 } // namespace compiler 1886 } // namespace compiler
1882 } // namespace internal 1887 } // namespace internal
1883 } // namespace v8 1888 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698