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

Side by Side Diff: src/wasm/encoder.cc

Issue 2280063002: [asm.js] (Re)use temporaries in asm->wasm conversion. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [asm.js] (Re)use temporaries in asm->wasm conversion. Created 4 years, 3 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/wasm/encoder.h ('k') | no next file » | 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/signature.h" 5 #include "src/signature.h"
6 6
7 #include "src/handles.h" 7 #include "src/handles.h"
8 #include "src/v8.h" 8 #include "src/v8.h"
9 #include "src/zone-containers.h" 9 #include "src/zone-containers.h"
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 buffer.patch_u32v(start, static_cast<uint32_t>(buffer.offset() - start - 49 buffer.patch_u32v(start, static_cast<uint32_t>(buffer.offset() - start -
50 kPaddedVarInt32Size)); 50 kPaddedVarInt32Size));
51 } 51 }
52 52
53 WasmFunctionBuilder::WasmFunctionBuilder(WasmModuleBuilder* builder) 53 WasmFunctionBuilder::WasmFunctionBuilder(WasmModuleBuilder* builder)
54 : builder_(builder), 54 : builder_(builder),
55 locals_(builder->zone()), 55 locals_(builder->zone()),
56 signature_index_(0), 56 signature_index_(0),
57 exported_(0), 57 exported_(0),
58 body_(builder->zone()), 58 body_(builder->zone()),
59 name_(builder->zone()) {} 59 name_(builder->zone()),
60 i32_temps_(builder->zone()),
61 i64_temps_(builder->zone()),
62 f32_temps_(builder->zone()),
63 f64_temps_(builder->zone()) {}
60 64
61 void WasmFunctionBuilder::EmitVarInt(uint32_t val) { 65 void WasmFunctionBuilder::EmitVarInt(uint32_t val) {
62 byte buffer[8]; 66 byte buffer[8];
63 byte* ptr = buffer; 67 byte* ptr = buffer;
64 LEBHelper::write_u32v(&ptr, val); 68 LEBHelper::write_u32v(&ptr, val);
65 for (byte* p = buffer; p < ptr; p++) { 69 for (byte* p = buffer; p < ptr; p++) {
66 body_.push_back(*p); 70 body_.push_back(*p);
67 } 71 }
68 } 72 }
69 73
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 377
374 for (auto segment : data_segments_) { 378 for (auto segment : data_segments_) {
375 segment->Write(buffer); 379 segment->Write(buffer);
376 } 380 }
377 FixupSection(buffer, start); 381 FixupSection(buffer, start);
378 } 382 }
379 } 383 }
380 } // namespace wasm 384 } // namespace wasm
381 } // namespace internal 385 } // namespace internal
382 } // namespace v8 386 } // namespace v8
OLDNEW
« no previous file with comments | « src/wasm/encoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698