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

Side by Side Diff: src/asmjs/asm-wasm-builder.cc

Issue 2165633006: [wasm] Remove special memory type for (internal) globals and use local type instead. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [wasm] Remove special memory type for (internal) globals and use local type instead. Created 4 years, 5 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 | « no previous file | src/compiler/wasm-compiler.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/v8.h" 5 #include "src/v8.h"
6 6
7 // Required to get M_E etc. in MSVC. 7 // Required to get M_E etc. in MSVC.
8 #if defined(_WIN32) 8 #if defined(_WIN32)
9 #define _USE_MATH_DEFINES 9 #define _USE_MATH_DEFINES
10 #endif 10 #endif
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1691 container->index = index; 1691 container->index = index;
1692 entry = local_variables_.LookupOrInsert(v, ComputePointerHash(v), 1692 entry = local_variables_.LookupOrInsert(v, ComputePointerHash(v),
1693 ZoneAllocationPolicy(zone())); 1693 ZoneAllocationPolicy(zone()));
1694 entry->value = container; 1694 entry->value = container;
1695 } 1695 }
1696 1696
1697 uint32_t LookupOrInsertGlobal(Variable* v, LocalType type) { 1697 uint32_t LookupOrInsertGlobal(Variable* v, LocalType type) {
1698 ZoneHashMap::Entry* entry = 1698 ZoneHashMap::Entry* entry =
1699 global_variables_.Lookup(v, ComputePointerHash(v)); 1699 global_variables_.Lookup(v, ComputePointerHash(v));
1700 if (entry == nullptr) { 1700 if (entry == nullptr) {
1701 uint32_t index = 1701 uint32_t index = builder_->AddGlobal(type, 0);
1702 builder_->AddGlobal(WasmOpcodes::MachineTypeFor(type), 0);
1703 IndexContainer* container = new (zone()) IndexContainer(); 1702 IndexContainer* container = new (zone()) IndexContainer();
1704 container->index = index; 1703 container->index = index;
1705 entry = global_variables_.LookupOrInsert(v, ComputePointerHash(v), 1704 entry = global_variables_.LookupOrInsert(v, ComputePointerHash(v),
1706 ZoneAllocationPolicy(zone())); 1705 ZoneAllocationPolicy(zone()));
1707 entry->value = container; 1706 entry->value = container;
1708 } 1707 }
1709 return (reinterpret_cast<IndexContainer*>(entry->value))->index; 1708 return (reinterpret_cast<IndexContainer*>(entry->value))->index;
1710 } 1709 }
1711 1710
1712 uint32_t LookupOrInsertFunction(Variable* v) { 1711 uint32_t LookupOrInsertFunction(Variable* v) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1777 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, typer_); 1776 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, typer_);
1778 impl.Build(); 1777 impl.Build();
1779 *foreign_args = impl.GetForeignArgs(); 1778 *foreign_args = impl.GetForeignArgs();
1780 ZoneBuffer* buffer = new (zone_) ZoneBuffer(zone_); 1779 ZoneBuffer* buffer = new (zone_) ZoneBuffer(zone_);
1781 impl.builder_->WriteTo(*buffer); 1780 impl.builder_->WriteTo(*buffer);
1782 return buffer; 1781 return buffer;
1783 } 1782 }
1784 } // namespace wasm 1783 } // namespace wasm
1785 } // namespace internal 1784 } // namespace internal
1786 } // namespace v8 1785 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698