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

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

Issue 1881913002: Revert of [compiler] Add relocatable pointer constants for wasm memory references. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/compiler/wasm-compiler.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('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 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 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 __ movq(dst, tmp); 2071 __ movq(dst, tmp);
2072 } 2072 }
2073 } else if (source->IsConstant()) { 2073 } else if (source->IsConstant()) {
2074 ConstantOperand* constant_source = ConstantOperand::cast(source); 2074 ConstantOperand* constant_source = ConstantOperand::cast(source);
2075 Constant src = g.ToConstant(constant_source); 2075 Constant src = g.ToConstant(constant_source);
2076 if (destination->IsRegister() || destination->IsStackSlot()) { 2076 if (destination->IsRegister() || destination->IsStackSlot()) {
2077 Register dst = destination->IsRegister() ? g.ToRegister(destination) 2077 Register dst = destination->IsRegister() ? g.ToRegister(destination)
2078 : kScratchRegister; 2078 : kScratchRegister;
2079 switch (src.type()) { 2079 switch (src.type()) {
2080 case Constant::kInt32: { 2080 case Constant::kInt32: {
2081 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { 2081 // TODO(dcarney): don't need scratch in this case.
2082 __ movq(dst, src.ToInt64(), src.rmode()); 2082 int32_t value = src.ToInt32();
2083 if (value == 0) {
2084 __ xorl(dst, dst);
2083 } else { 2085 } else {
2084 // TODO(dcarney): don't need scratch in this case. 2086 __ movl(dst, Immediate(value));
2085 int32_t value = src.ToInt32();
2086 if (value == 0) {
2087 __ xorl(dst, dst);
2088 } else {
2089 __ movl(dst, Immediate(value));
2090 }
2091 } 2087 }
2092 break; 2088 break;
2093 } 2089 }
2094 case Constant::kInt64: 2090 case Constant::kInt64:
2095 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { 2091 __ Set(dst, src.ToInt64());
2096 __ movq(dst, src.ToInt64(), src.rmode());
2097 } else {
2098 __ Set(dst, src.ToInt64());
2099 }
2100 break; 2092 break;
2101 case Constant::kFloat32: 2093 case Constant::kFloat32:
2102 __ Move(dst, 2094 __ Move(dst,
2103 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); 2095 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED));
2104 break; 2096 break;
2105 case Constant::kFloat64: 2097 case Constant::kFloat64:
2106 __ Move(dst, 2098 __ Move(dst,
2107 isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); 2099 isolate()->factory()->NewNumber(src.ToFloat64(), TENURED));
2108 break; 2100 break;
2109 case Constant::kExternalReference: 2101 case Constant::kExternalReference:
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
2260 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 2252 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
2261 __ Nop(padding_size); 2253 __ Nop(padding_size);
2262 } 2254 }
2263 } 2255 }
2264 2256
2265 #undef __ 2257 #undef __
2266 2258
2267 } // namespace compiler 2259 } // namespace compiler
2268 } // namespace internal 2260 } // namespace internal
2269 } // namespace v8 2261 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698