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

Side by Side Diff: src/factory.cc

Issue 2405313002: [modules] Store Module metadata in per-Context EmbedderData (Closed)
Patch Set: Formatting Created 4 years, 2 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/d8.cc ('k') | src/objects.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/allocation-site-scopes.h" 8 #include "src/allocation-site-scopes.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after
1758 isolate()); 1758 isolate());
1759 Handle<ObjectHashTable> exports = 1759 Handle<ObjectHashTable> exports =
1760 ObjectHashTable::New(isolate(), module_info->regular_exports()->length()); 1760 ObjectHashTable::New(isolate(), module_info->regular_exports()->length());
1761 int requested_modules_length = module_info->module_requests()->length(); 1761 int requested_modules_length = module_info->module_requests()->length();
1762 Handle<FixedArray> requested_modules = 1762 Handle<FixedArray> requested_modules =
1763 requested_modules_length > 0 ? NewFixedArray(requested_modules_length) 1763 requested_modules_length > 0 ? NewFixedArray(requested_modules_length)
1764 : empty_fixed_array(); 1764 : empty_fixed_array();
1765 1765
1766 Handle<Module> module = Handle<Module>::cast(NewStruct(MODULE_TYPE)); 1766 Handle<Module> module = Handle<Module>::cast(NewStruct(MODULE_TYPE));
1767 module->set_code(*code); 1767 module->set_code(*code);
1768 module->set_embedder_data(isolate()->heap()->undefined_value());
1769 module->set_exports(*exports); 1768 module->set_exports(*exports);
1770 module->set_flags(0); 1769 module->set_flags(0);
1771 module->set_hash(isolate()->GenerateIdentityHash(Smi::kMaxValue)); 1770 module->set_hash(isolate()->GenerateIdentityHash(Smi::kMaxValue));
1772 module->set_module_namespace(isolate()->heap()->undefined_value()); 1771 module->set_module_namespace(isolate()->heap()->undefined_value());
1773 module->set_requested_modules(*requested_modules); 1772 module->set_requested_modules(*requested_modules);
1774 return module; 1773 return module;
1775 } 1774 }
1776 1775
1777 Handle<JSArrayBuffer> Factory::NewJSArrayBuffer(SharedFlag shared, 1776 Handle<JSArrayBuffer> Factory::NewJSArrayBuffer(SharedFlag shared,
1778 PretenureFlag pretenure) { 1777 PretenureFlag pretenure) {
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
2605 Handle<AccessorInfo> prototype = 2604 Handle<AccessorInfo> prototype =
2606 Accessors::FunctionPrototypeInfo(isolate(), attribs); 2605 Accessors::FunctionPrototypeInfo(isolate(), attribs);
2607 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), 2606 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())),
2608 prototype, attribs); 2607 prototype, attribs);
2609 map->AppendDescriptor(&d); 2608 map->AppendDescriptor(&d);
2610 } 2609 }
2611 } 2610 }
2612 2611
2613 } // namespace internal 2612 } // namespace internal
2614 } // namespace v8 2613 } // namespace v8
OLDNEW
« no previous file with comments | « src/d8.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698