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

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

Issue 2204703002: [wasm] Get rid of extra wrappers when import another wasm export (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make test case code more clean Created 4 years, 4 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/runtime/runtime-test.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-typer.h" 7 #include "src/asmjs/asm-typer.h"
8 #include "src/asmjs/asm-wasm-builder.h" 8 #include "src/asmjs/asm-wasm-builder.h"
9 #include "src/assert-scope.h" 9 #include "src/assert-scope.h"
10 #include "src/ast/ast.h" 10 #include "src/ast/ast.h"
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 if (!context->get(Context::WASM_FUNCTION_MAP_INDEX)->IsMap()) { 539 if (!context->get(Context::WASM_FUNCTION_MAP_INDEX)->IsMap()) {
540 // TODO(titzer): Move this to bootstrapper.cc?? 540 // TODO(titzer): Move this to bootstrapper.cc??
541 // TODO(titzer): Also make one for strict mode functions? 541 // TODO(titzer): Also make one for strict mode functions?
542 Handle<Map> prev_map = Handle<Map>(context->sloppy_function_map(), isolate); 542 Handle<Map> prev_map = Handle<Map>(context->sloppy_function_map(), isolate);
543 543
544 InstanceType instance_type = prev_map->instance_type(); 544 InstanceType instance_type = prev_map->instance_type();
545 int internal_fields = JSObject::GetInternalFieldCount(*prev_map); 545 int internal_fields = JSObject::GetInternalFieldCount(*prev_map);
546 CHECK_EQ(0, internal_fields); 546 CHECK_EQ(0, internal_fields);
547 int pre_allocated = 547 int pre_allocated =
548 prev_map->GetInObjectProperties() - prev_map->unused_property_fields(); 548 prev_map->GetInObjectProperties() - prev_map->unused_property_fields();
549 int instance_size; 549 int instance_size = 0;
550 int in_object_properties; 550 int in_object_properties = 0;
551 JSFunction::CalculateInstanceSizeHelper(instance_type, internal_fields + 1, 551 int wasm_internal_fields = internal_fields + 1 // module instance object
552 + 1 // function arity
553 + 1; // function signature
554 JSFunction::CalculateInstanceSizeHelper(instance_type, wasm_internal_fields,
552 0, &instance_size, 555 0, &instance_size,
553 &in_object_properties); 556 &in_object_properties);
554 557
555 int unused_property_fields = in_object_properties - pre_allocated; 558 int unused_property_fields = in_object_properties - pre_allocated;
556 Handle<Map> map = Map::CopyInitialMap( 559 Handle<Map> map = Map::CopyInitialMap(
557 prev_map, instance_size, in_object_properties, unused_property_fields); 560 prev_map, instance_size, in_object_properties, unused_property_fields);
558 561
559 context->set_wasm_function_map(*map); 562 context->set_wasm_function_map(*map);
560 } 563 }
561 } 564 }
562 565
563 } // namespace internal 566 } // namespace internal
564 } // namespace v8 567 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698