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

Side by Side Diff: src/compiler/wasm-compiler.cc

Issue 2209433002: [wasm] Make LoadGlobal/StoreGlobal opcodes match what is coming in binary 0xC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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.h ('k') | src/wasm/ast-decoder.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/wasm-compiler.h" 5 #include "src/compiler/wasm-compiler.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 10
(...skipping 2903 matching lines...) Expand 10 before | Expand all | Expand 10 after
2914 break; 2914 break;
2915 case Conversion::kFloat64: 2915 case Conversion::kFloat64:
2916 ret = BuildChangeTaggedToFloat64(ret); 2916 ret = BuildChangeTaggedToFloat64(ret);
2917 break; 2917 break;
2918 default: 2918 default:
2919 break; 2919 break;
2920 } 2920 }
2921 return ret; 2921 return ret;
2922 } 2922 }
2923 2923
2924 Node* WasmGraphBuilder::LoadGlobal(uint32_t index) { 2924 Node* WasmGraphBuilder::GetGlobal(uint32_t index) {
2925 MachineType mem_type = 2925 MachineType mem_type =
2926 wasm::WasmOpcodes::MachineTypeFor(module_->GetGlobalType(index)); 2926 wasm::WasmOpcodes::MachineTypeFor(module_->GetGlobalType(index));
2927 Node* addr = jsgraph()->RelocatableIntPtrConstant( 2927 Node* addr = jsgraph()->RelocatableIntPtrConstant(
2928 reinterpret_cast<uintptr_t>(module_->instance->globals_start + 2928 reinterpret_cast<uintptr_t>(module_->instance->globals_start +
2929 module_->module->globals[index].offset), 2929 module_->module->globals[index].offset),
2930 RelocInfo::WASM_GLOBAL_REFERENCE); 2930 RelocInfo::WASM_GLOBAL_REFERENCE);
2931 const Operator* op = jsgraph()->machine()->Load(mem_type); 2931 const Operator* op = jsgraph()->machine()->Load(mem_type);
2932 Node* node = graph()->NewNode(op, addr, jsgraph()->Int32Constant(0), *effect_, 2932 Node* node = graph()->NewNode(op, addr, jsgraph()->Int32Constant(0), *effect_,
2933 *control_); 2933 *control_);
2934 *effect_ = node; 2934 *effect_ = node;
2935 return node; 2935 return node;
2936 } 2936 }
2937 2937
2938 Node* WasmGraphBuilder::StoreGlobal(uint32_t index, Node* val) { 2938 Node* WasmGraphBuilder::SetGlobal(uint32_t index, Node* val) {
2939 MachineType mem_type = 2939 MachineType mem_type =
2940 wasm::WasmOpcodes::MachineTypeFor(module_->GetGlobalType(index)); 2940 wasm::WasmOpcodes::MachineTypeFor(module_->GetGlobalType(index));
2941 Node* addr = jsgraph()->RelocatableIntPtrConstant( 2941 Node* addr = jsgraph()->RelocatableIntPtrConstant(
2942 reinterpret_cast<uintptr_t>(module_->instance->globals_start + 2942 reinterpret_cast<uintptr_t>(module_->instance->globals_start +
2943 module_->module->globals[index].offset), 2943 module_->module->globals[index].offset),
2944 RelocInfo::WASM_GLOBAL_REFERENCE); 2944 RelocInfo::WASM_GLOBAL_REFERENCE);
2945 const Operator* op = jsgraph()->machine()->Store( 2945 const Operator* op = jsgraph()->machine()->Store(
2946 StoreRepresentation(mem_type.representation(), kNoWriteBarrier)); 2946 StoreRepresentation(mem_type.representation(), kNoWriteBarrier));
2947 Node* node = graph()->NewNode(op, addr, jsgraph()->Int32Constant(0), val, 2947 Node* node = graph()->NewNode(op, addr, jsgraph()->Int32Constant(0), val,
2948 *effect_, *control_); 2948 *effect_, *control_);
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
3496 function_->code_start_offset), 3496 function_->code_start_offset),
3497 compile_ms); 3497 compile_ms);
3498 } 3498 }
3499 3499
3500 return code; 3500 return code;
3501 } 3501 }
3502 3502
3503 } // namespace compiler 3503 } // namespace compiler
3504 } // namespace internal 3504 } // namespace internal
3505 } // namespace v8 3505 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/wasm/ast-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698