OLD | NEW |
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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 // Required to get M_E etc. in MSVC. | 7 // Required to get M_E etc. in MSVC. |
8 #if defined(_WIN32) | 8 #if defined(_WIN32) |
9 #define _USE_MATH_DEFINES | 9 #define _USE_MATH_DEFINES |
10 #endif | 10 #endif |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 size = 4; | 792 size = 4; |
793 } else if (type->Is(cache_.kFloat32Array)) { | 793 } else if (type->Is(cache_.kFloat32Array)) { |
794 mtype = MachineType::Float32(); | 794 mtype = MachineType::Float32(); |
795 size = 4; | 795 size = 4; |
796 } else if (type->Is(cache_.kFloat64Array)) { | 796 } else if (type->Is(cache_.kFloat64Array)) { |
797 mtype = MachineType::Float64(); | 797 mtype = MachineType::Float64(); |
798 size = 8; | 798 size = 8; |
799 } else { | 799 } else { |
800 UNREACHABLE(); | 800 UNREACHABLE(); |
801 } | 801 } |
802 current_function_builder_->EmitWithU8( | 802 // TODO(titzer): use special asm-compatibility opcodes? |
803 WasmOpcodes::LoadStoreOpcodeOf(mtype, is_set_op_), | 803 current_function_builder_->EmitWithU8U8( |
804 WasmOpcodes::LoadStoreAccessOf(false)); | 804 WasmOpcodes::LoadStoreOpcodeOf(mtype, is_set_op_), 0, 0); |
805 is_set_op_ = false; | 805 is_set_op_ = false; |
806 if (size == 1) { | 806 if (size == 1) { |
807 // Allow more general expression in byte arrays than the spec | 807 // Allow more general expression in byte arrays than the spec |
808 // strictly permits. | 808 // strictly permits. |
809 // Early versions of Emscripten emit HEAP8[HEAP32[..]|0] in | 809 // Early versions of Emscripten emit HEAP8[HEAP32[..]|0] in |
810 // places that strictly should be HEAP8[HEAP32[..]>>0]. | 810 // places that strictly should be HEAP8[HEAP32[..]>>0]. |
811 RECURSE(Visit(expr->key())); | 811 RECURSE(Visit(expr->key())); |
812 return; | 812 return; |
813 } else { | 813 } else { |
814 Literal* value = expr->key()->AsLiteral(); | 814 Literal* value = expr->key()->AsLiteral(); |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1518 // that zone in constructor may be thrown away once wasm module is written. | 1518 // that zone in constructor may be thrown away once wasm module is written. |
1519 WasmModuleIndex* AsmWasmBuilder::Run() { | 1519 WasmModuleIndex* AsmWasmBuilder::Run() { |
1520 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, foreign_, typer_); | 1520 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, foreign_, typer_); |
1521 impl.Compile(); | 1521 impl.Compile(); |
1522 WasmModuleWriter* writer = impl.builder_->Build(zone_); | 1522 WasmModuleWriter* writer = impl.builder_->Build(zone_); |
1523 return writer->WriteTo(zone_); | 1523 return writer->WriteTo(zone_); |
1524 } | 1524 } |
1525 } // namespace wasm | 1525 } // namespace wasm |
1526 } // namespace internal | 1526 } // namespace internal |
1527 } // namespace v8 | 1527 } // namespace v8 |
OLD | NEW |