OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/compiler/wasm-compiler.h" | 9 #include "src/compiler/wasm-compiler.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 const Address entry = Isolate::c_entry_fp(isolate->thread_local_top()); | 51 const Address entry = Isolate::c_entry_fp(isolate->thread_local_top()); |
52 Address pc = | 52 Address pc = |
53 Memory::Address_at(entry + StandardFrameConstants::kCallerPCOffset); | 53 Memory::Address_at(entry + StandardFrameConstants::kCallerPCOffset); |
54 Code* code = | 54 Code* code = |
55 isolate->inner_pointer_to_code_cache()->GetCacheEntry(pc)->code; | 55 isolate->inner_pointer_to_code_cache()->GetCacheEntry(pc)->code; |
56 WasmInstanceObject* owning_instance = wasm::GetOwningWasmInstance(code); | 56 WasmInstanceObject* owning_instance = wasm::GetOwningWasmInstance(code); |
57 CHECK_NOT_NULL(owning_instance); | 57 CHECK_NOT_NULL(owning_instance); |
58 instance = handle(owning_instance, isolate); | 58 instance = handle(owning_instance, isolate); |
59 } | 59 } |
60 return *isolate->factory()->NewNumberFromInt( | 60 return *isolate->factory()->NewNumberFromInt( |
61 wasm::GrowMemory(isolate, instance, delta_pages)); | 61 wasm::GrowInstanceMemory(isolate, instance, delta_pages)); |
62 } | 62 } |
63 | 63 |
64 RUNTIME_FUNCTION(Runtime_WasmThrowTypeError) { | 64 RUNTIME_FUNCTION(Runtime_WasmThrowTypeError) { |
65 HandleScope scope(isolate); | 65 HandleScope scope(isolate); |
66 DCHECK_EQ(0, args.length()); | 66 DCHECK_EQ(0, args.length()); |
67 THROW_NEW_ERROR_RETURN_FAILURE( | 67 THROW_NEW_ERROR_RETURN_FAILURE( |
68 isolate, NewTypeError(MessageTemplate::kWasmTrapTypeError)); | 68 isolate, NewTypeError(MessageTemplate::kWasmTrapTypeError)); |
69 } | 69 } |
70 | 70 |
71 RUNTIME_FUNCTION(Runtime_WasmThrow) { | 71 RUNTIME_FUNCTION(Runtime_WasmThrow) { |
(...skipping 13 matching lines...) Expand all Loading... |
85 Object* exception = args[0]; | 85 Object* exception = args[0]; |
86 // The unwinder will only deliver exceptions to wasm if the exception is a | 86 // The unwinder will only deliver exceptions to wasm if the exception is a |
87 // Number or a Smi (which we have just converted to a Number.) This logic | 87 // Number or a Smi (which we have just converted to a Number.) This logic |
88 // lives in Isolate::is_catchable_by_wasm(Object*). | 88 // lives in Isolate::is_catchable_by_wasm(Object*). |
89 CHECK(exception->IsNumber()); | 89 CHECK(exception->IsNumber()); |
90 return exception; | 90 return exception; |
91 } | 91 } |
92 | 92 |
93 } // namespace internal | 93 } // namespace internal |
94 } // namespace v8 | 94 } // namespace v8 |
OLD | NEW |