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

Side by Side Diff: src/bootstrapper.cc

Issue 2547483002: Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID (Closed)
Patch Set: updates Created 4 years 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 | « no previous file | src/compiler.cc » ('j') | src/debug/liveedit.js » ('J')
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/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/base/ieee754.h" 9 #include "src/base/ieee754.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 DCHECK(!empty_function_map->is_dictionary_map()); 589 DCHECK(!empty_function_map->is_dictionary_map());
590 Map::SetPrototype(empty_function_map, object_function_prototype); 590 Map::SetPrototype(empty_function_map, object_function_prototype);
591 empty_function_map->set_is_prototype_map(true); 591 empty_function_map->set_is_prototype_map(true);
592 592
593 empty_function->set_map(*empty_function_map); 593 empty_function->set_map(*empty_function_map);
594 594
595 // --- E m p t y --- 595 // --- E m p t y ---
596 Handle<String> source = factory->NewStringFromStaticChars("() {}"); 596 Handle<String> source = factory->NewStringFromStaticChars("() {}");
597 Handle<Script> script = factory->NewScript(source); 597 Handle<Script> script = factory->NewScript(source);
598 script->set_type(Script::TYPE_NATIVE); 598 script->set_type(Script::TYPE_NATIVE);
599 Handle<FixedArray> infos = factory->NewFixedArray(2);
600 script->set_shared_function_infos(*infos);
599 empty_function->shared()->set_start_position(0); 601 empty_function->shared()->set_start_position(0);
600 empty_function->shared()->set_end_position(source->length()); 602 empty_function->shared()->set_end_position(source->length());
603 empty_function->shared()->set_function_literal_id(1);
601 empty_function->shared()->DontAdaptArguments(); 604 empty_function->shared()->DontAdaptArguments();
602 SharedFunctionInfo::SetScript(handle(empty_function->shared()), script); 605 SharedFunctionInfo::SetScript(handle(empty_function->shared()), script);
603 606
604 // Set prototypes for the function maps. 607 // Set prototypes for the function maps.
605 Handle<Map> sloppy_function_map(native_context()->sloppy_function_map(), 608 Handle<Map> sloppy_function_map(native_context()->sloppy_function_map(),
606 isolate); 609 isolate);
607 Handle<Map> sloppy_function_without_prototype_map( 610 Handle<Map> sloppy_function_without_prototype_map(
608 native_context()->sloppy_function_without_prototype_map(), isolate); 611 native_context()->sloppy_function_without_prototype_map(), isolate);
609 Map::SetPrototype(sloppy_function_map, empty_function); 612 Map::SetPrototype(sloppy_function_map, empty_function);
610 Map::SetPrototype(sloppy_function_without_prototype_map, empty_function); 613 Map::SetPrototype(sloppy_function_without_prototype_map, empty_function);
(...skipping 4040 matching lines...) Expand 10 before | Expand all | Expand 10 after
4651 } 4654 }
4652 4655
4653 4656
4654 // Called when the top-level V8 mutex is destroyed. 4657 // Called when the top-level V8 mutex is destroyed.
4655 void Bootstrapper::FreeThreadResources() { 4658 void Bootstrapper::FreeThreadResources() {
4656 DCHECK(!IsActive()); 4659 DCHECK(!IsActive());
4657 } 4660 }
4658 4661
4659 } // namespace internal 4662 } // namespace internal
4660 } // namespace v8 4663 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | src/debug/liveedit.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698