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

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

Issue 2510673002: [wasm] Use more precise types for some WASM objects. (Closed)
Patch Set: Address review comment. Created 4 years, 1 month 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-wasm.cc ('k') | src/wasm/wasm-module.h » ('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/api-natives.h" 5 #include "src/api-natives.h"
6 #include "src/api.h" 6 #include "src/api.h"
7 #include "src/asmjs/asm-js.h" 7 #include "src/asmjs/asm-js.h"
8 #include "src/asmjs/asm-typer.h" 8 #include "src/asmjs/asm-typer.h"
9 #include "src/asmjs/asm-wasm-builder.h" 9 #include "src/asmjs/asm-wasm-builder.h"
10 #include "src/assert-scope.h" 10 #include "src/assert-scope.h"
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 isolate->ThrowException(e); 528 isolate->ThrowException(e);
529 return; 529 return;
530 } 530 }
531 531
532 uint32_t delta = args[0]->Uint32Value(context).FromJust(); 532 uint32_t delta = args[0]->Uint32Value(context).FromJust();
533 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); 533 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
534 i::Handle<i::JSObject> receiver = 534 i::Handle<i::JSObject> receiver =
535 i::Handle<i::JSObject>::cast(Utils::OpenHandle(*args.This())); 535 i::Handle<i::JSObject>::cast(Utils::OpenHandle(*args.This()));
536 i::Handle<i::Object> instance_object( 536 i::Handle<i::Object> instance_object(
537 receiver->GetInternalField(kWasmMemoryInstanceObject), i_isolate); 537 receiver->GetInternalField(kWasmMemoryInstanceObject), i_isolate);
538 i::Handle<i::JSObject> instance( 538 i::Handle<i::WasmInstanceObject> instance(
539 i::Handle<i::JSObject>::cast(instance_object)); 539 i::Handle<i::WasmInstanceObject>::cast(instance_object));
540 540
541 // TODO(gdeepti) Implement growing memory when shared by different 541 // TODO(gdeepti) Implement growing memory when shared by different
542 // instances. 542 // instances.
543 int32_t ret = internal::wasm::GrowInstanceMemory(i_isolate, instance, delta); 543 int32_t ret = internal::wasm::GrowInstanceMemory(i_isolate, instance, delta);
544 if (ret == -1) { 544 if (ret == -1) {
545 v8::Local<v8::Value> e = v8::Exception::Error( 545 v8::Local<v8::Value> e = v8::Exception::Error(
546 v8_str(isolate, "Unable to grow instance memory.")); 546 v8_str(isolate, "Unable to grow instance memory."));
547 isolate->ThrowException(e); 547 isolate->ThrowException(e);
548 return; 548 return;
549 } 549 }
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 i::Handle<i::Symbol> symbol(isolate->context()->wasm_memory_sym(), isolate); 781 i::Handle<i::Symbol> symbol(isolate->context()->wasm_memory_sym(), isolate);
782 return HasBrand(value, symbol); 782 return HasBrand(value, symbol);
783 } 783 }
784 784
785 bool WasmJs::IsWasmTableObject(Isolate* isolate, Handle<Object> value) { 785 bool WasmJs::IsWasmTableObject(Isolate* isolate, Handle<Object> value) {
786 i::Handle<i::Symbol> symbol(isolate->context()->wasm_table_sym(), isolate); 786 i::Handle<i::Symbol> symbol(isolate->context()->wasm_table_sym(), isolate);
787 return HasBrand(value, symbol); 787 return HasBrand(value, symbol);
788 } 788 }
789 } // namespace internal 789 } // namespace internal
790 } // namespace v8 790 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-wasm.cc ('k') | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698