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

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

Issue 2806303002: [debug,api] Do not use embedder field for debug context id. (Closed)
Patch Set: restore enum Created 3 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/runtime/runtime-function.cc ('k') | test/inspector/inspector-impl.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 <memory> 5 #include <memory>
6 6
7 #include "src/assembler-inl.h" 7 #include "src/assembler-inl.h"
8 #include "src/base/adapters.h" 8 #include "src/base/adapters.h"
9 #include "src/base/atomic-utils.h" 9 #include "src/base/atomic-utils.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 Handle<Code> code = code_table->GetValueChecked<Code>(isolate, i); 128 Handle<Code> code = code_table->GetValueChecked<Code>(isolate, i);
129 Assembler::FlushICache(isolate, code->instruction_start(), 129 Assembler::FlushICache(isolate, code->instruction_start(),
130 code->instruction_size()); 130 code->instruction_size());
131 } 131 }
132 } 132 }
133 133
134 Handle<Script> CreateWasmScript(Isolate* isolate, 134 Handle<Script> CreateWasmScript(Isolate* isolate,
135 const ModuleWireBytes& wire_bytes) { 135 const ModuleWireBytes& wire_bytes) {
136 Handle<Script> script = 136 Handle<Script> script =
137 isolate->factory()->NewScript(isolate->factory()->empty_string()); 137 isolate->factory()->NewScript(isolate->factory()->empty_string());
138 FixedArray* array = isolate->native_context()->embedder_data(); 138 script->set_context_data(isolate->native_context()->debug_context_id());
139 script->set_context_data(array->get(v8::Context::kDebugIdIndex));
140 script->set_type(Script::TYPE_WASM); 139 script->set_type(Script::TYPE_WASM);
141 140
142 int hash = StringHasher::HashSequentialString( 141 int hash = StringHasher::HashSequentialString(
143 reinterpret_cast<const char*>(wire_bytes.start()), wire_bytes.length(), 142 reinterpret_cast<const char*>(wire_bytes.start()), wire_bytes.length(),
144 kZeroHashSeed); 143 kZeroHashSeed);
145 144
146 const int kBufferSize = 32; 145 const int kBufferSize = 32;
147 char buffer[kBufferSize]; 146 char buffer[kBufferSize];
148 int url_chars = SNPrintF(ArrayVector(buffer), "wasm://wasm/%08x", hash); 147 int url_chars = SNPrintF(ArrayVector(buffer), "wasm://wasm/%08x", hash);
149 DCHECK(url_chars >= 0 && url_chars < kBufferSize); 148 DCHECK(url_chars >= 0 && url_chars < kBufferSize);
(...skipping 3191 matching lines...) Expand 10 before | Expand all | Expand 10 after
3341 callee_compiled->instruction_start()); 3340 callee_compiled->instruction_start());
3342 } 3341 }
3343 DCHECK_EQ(non_compiled_functions.size(), idx); 3342 DCHECK_EQ(non_compiled_functions.size(), idx);
3344 } 3343 }
3345 3344
3346 Code* ret = 3345 Code* ret =
3347 Code::cast(compiled_module->code_table()->get(func_to_return_idx)); 3346 Code::cast(compiled_module->code_table()->get(func_to_return_idx));
3348 DCHECK_EQ(Code::WASM_FUNCTION, ret->kind()); 3347 DCHECK_EQ(Code::WASM_FUNCTION, ret->kind());
3349 return handle(ret, isolate); 3348 return handle(ret, isolate);
3350 } 3349 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | test/inspector/inspector-impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698