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

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

Issue 2771803005: Hide WasmModule.origin field behind readable accessors. (Closed)
Patch Set: Fix origin references in debug build. 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 | « no previous file | src/wasm/function-body-decoder.cc » ('j') | src/wasm/wasm-module.cc » ('J')
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/assembler-inl.h" 9 #include "src/assembler-inl.h"
10 #include "src/base/platform/elapsed-timer.h" 10 #include "src/base/platform/elapsed-timer.h"
(...skipping 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after
2849 return mem_buffer_; 2849 return mem_buffer_;
2850 } else { 2850 } else {
2851 return jsgraph()->RelocatableIntPtrConstant( 2851 return jsgraph()->RelocatableIntPtrConstant(
2852 mem_start + offset, RelocInfo::WASM_MEMORY_REFERENCE); 2852 mem_start + offset, RelocInfo::WASM_MEMORY_REFERENCE);
2853 } 2853 }
2854 } 2854 }
2855 2855
2856 Node* WasmGraphBuilder::CurrentMemoryPages() { 2856 Node* WasmGraphBuilder::CurrentMemoryPages() {
2857 // CurrentMemoryPages will not be called from asm.js, hence we cannot be in 2857 // CurrentMemoryPages will not be called from asm.js, hence we cannot be in
2858 // lazy-compilation mode, hence the instance will be set. 2858 // lazy-compilation mode, hence the instance will be set.
2859 DCHECK_EQ(wasm::kWasmOrigin, module_->module->origin); 2859 DCHECK_EQ(wasm::kWasmOrigin, module_->module->get_origin());
Karl 2017/03/24 22:29:11 Fixed debug check here.
2860 DCHECK_NOT_NULL(module_); 2860 DCHECK_NOT_NULL(module_);
2861 DCHECK_NOT_NULL(module_->instance); 2861 DCHECK_NOT_NULL(module_->instance);
2862 2862
2863 Runtime::FunctionId function_id = Runtime::kWasmMemorySize; 2863 Runtime::FunctionId function_id = Runtime::kWasmMemorySize;
2864 const Runtime::Function* function = Runtime::FunctionForId(function_id); 2864 const Runtime::Function* function = Runtime::FunctionForId(function_id);
2865 CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( 2865 CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor(
2866 jsgraph()->zone(), function_id, function->nargs, Operator::kNoThrow, 2866 jsgraph()->zone(), function_id, function->nargs, Operator::kNoThrow,
2867 CallDescriptor::kNoFlags); 2867 CallDescriptor::kNoFlags);
2868 Node* inputs[] = { 2868 Node* inputs[] = {
2869 jsgraph()->CEntryStubConstant(function->result_size), // C entry 2869 jsgraph()->CEntryStubConstant(function->result_size), // C entry
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
3960 3960
3961 // Run the compiler pipeline to generate machine code. 3961 // Run the compiler pipeline to generate machine code.
3962 CallDescriptor* descriptor = wasm::ModuleEnv::GetWasmCallDescriptor( 3962 CallDescriptor* descriptor = wasm::ModuleEnv::GetWasmCallDescriptor(
3963 &compilation_zone_, func_body_.sig); 3963 &compilation_zone_, func_body_.sig);
3964 if (jsgraph_->machine()->Is32()) { 3964 if (jsgraph_->machine()->Is32()) {
3965 descriptor = 3965 descriptor =
3966 module_env_->GetI32WasmCallDescriptor(&compilation_zone_, descriptor); 3966 module_env_->GetI32WasmCallDescriptor(&compilation_zone_, descriptor);
3967 } 3967 }
3968 job_.reset(Pipeline::NewWasmCompilationJob( 3968 job_.reset(Pipeline::NewWasmCompilationJob(
3969 &info_, jsgraph_, descriptor, source_positions, &protected_instructions_, 3969 &info_, jsgraph_, descriptor, source_positions, &protected_instructions_,
3970 module_env_->module->origin != wasm::kWasmOrigin)); 3970 !module_env_->module->is_wasm()));
Karl 2017/03/24 22:29:11 Fixed merge with master error here.
3971 ok_ = job_->ExecuteJob() == CompilationJob::SUCCEEDED; 3971 ok_ = job_->ExecuteJob() == CompilationJob::SUCCEEDED;
3972 // TODO(bradnelson): Improve histogram handling of size_t. 3972 // TODO(bradnelson): Improve histogram handling of size_t.
3973 // TODO(ahaas): The counters are not thread-safe at the moment. 3973 // TODO(ahaas): The counters are not thread-safe at the moment.
3974 // isolate_->counters()->wasm_compile_function_peak_memory_bytes() 3974 // isolate_->counters()->wasm_compile_function_peak_memory_bytes()
3975 // ->AddSample( 3975 // ->AddSample(
3976 // static_cast<int>(jsgraph->graph()->zone()->allocation_size())); 3976 // static_cast<int>(jsgraph->graph()->zone()->allocation_size()));
3977 3977
3978 if (FLAG_trace_wasm_decode_time) { 3978 if (FLAG_trace_wasm_decode_time) {
3979 double pipeline_ms = pipeline_timer.Elapsed().InMillisecondsF(); 3979 double pipeline_ms = pipeline_timer.Elapsed().InMillisecondsF();
3980 PrintF( 3980 PrintF(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
4035 wasm::ErrorThrower* thrower, Isolate* isolate, 4035 wasm::ErrorThrower* thrower, Isolate* isolate,
4036 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { 4036 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) {
4037 WasmCompilationUnit unit(isolate, module_env, function); 4037 WasmCompilationUnit unit(isolate, module_env, function);
4038 unit.ExecuteCompilation(); 4038 unit.ExecuteCompilation();
4039 return unit.FinishCompilation(thrower); 4039 return unit.FinishCompilation(thrower);
4040 } 4040 }
4041 4041
4042 } // namespace compiler 4042 } // namespace compiler
4043 } // namespace internal 4043 } // namespace internal
4044 } // namespace v8 4044 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/wasm/function-body-decoder.cc » ('j') | src/wasm/wasm-module.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698