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

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

Issue 2380463006: [wasm] Properly handlify WasmCompiledModule::Clone. (Closed)
Patch Set: Created 4 years, 2 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/wasm-module.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 #ifndef V8_WASM_MODULE_H_ 5 #ifndef V8_WASM_MODULE_H_
6 #define V8_WASM_MODULE_H_ 6 #define V8_WASM_MODULE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "src/api.h" 10 #include "src/api.h"
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 #define WCM_INIT_LARGE_NUMBER(IGNORE, NAME) \ 435 #define WCM_INIT_LARGE_NUMBER(IGNORE, NAME) \
436 number = isolate->factory()->NewHeapNumber(0.0, MUTABLE, TENURED); \ 436 number = isolate->factory()->NewHeapNumber(0.0, MUTABLE, TENURED); \
437 ret->set(kID_##NAME, *number); 437 ret->set(kID_##NAME, *number);
438 438
439 #define INITIALIZER(KIND, TYPE, NAME) WCM_INIT_##KIND(TYPE, NAME) 439 #define INITIALIZER(KIND, TYPE, NAME) WCM_INIT_##KIND(TYPE, NAME)
440 WCM_PROPERTY_TABLE(INITIALIZER) 440 WCM_PROPERTY_TABLE(INITIALIZER)
441 #undef INITIALIZER 441 #undef INITIALIZER
442 return handle(WasmCompiledModule::cast(*ret)); 442 return handle(WasmCompiledModule::cast(*ret));
443 } 443 }
444 444
445 Handle<WasmCompiledModule> Clone(Isolate* isolate) { 445 static Handle<WasmCompiledModule> Clone(Isolate* isolate,
446 Handle<WasmCompiledModule> ret = handle(WasmCompiledModule::cast( 446 Handle<WasmCompiledModule> module) {
447 *isolate->factory()->CopyFixedArray(handle(this)))); 447 Handle<WasmCompiledModule> ret = Handle<WasmCompiledModule>::cast(
448 isolate->factory()->CopyFixedArray(module));
448 Handle<HeapNumber> number = 449 Handle<HeapNumber> number =
449 isolate->factory()->NewHeapNumber(0.0, MUTABLE, TENURED); 450 isolate->factory()->NewHeapNumber(0.0, MUTABLE, TENURED);
450 ret->set(kID_mem_size, *number); 451 ret->set(kID_mem_size, *number);
451 ret->set_mem_size(mem_size()); 452 ret->set_mem_size(module->mem_size());
452 return ret; 453 return ret;
453 } 454 }
454 455
455 #define DECLARATION(KIND, TYPE, NAME) WCM_##KIND(TYPE, NAME) 456 #define DECLARATION(KIND, TYPE, NAME) WCM_##KIND(TYPE, NAME)
456 WCM_PROPERTY_TABLE(DECLARATION) 457 WCM_PROPERTY_TABLE(DECLARATION)
457 #undef DECLARATION 458 #undef DECLARATION
458 459
459 private: 460 private:
460 DISALLOW_IMPLICIT_CONSTRUCTORS(WasmCompiledModule); 461 DISALLOW_IMPLICIT_CONSTRUCTORS(WasmCompiledModule);
461 }; 462 };
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 int instance_count); 545 int instance_count);
545 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); 546 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj);
546 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); 547 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance);
547 548
548 } // namespace testing 549 } // namespace testing
549 } // namespace wasm 550 } // namespace wasm
550 } // namespace internal 551 } // namespace internal
551 } // namespace v8 552 } // namespace v8
552 553
553 #endif // V8_WASM_MODULE_H_ 554 #endif // V8_WASM_MODULE_H_
OLDNEW
« no previous file with comments | « no previous file | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698