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

Side by Side Diff: src/bootstrapper.cc

Issue 316173002: Handle "//# sourceURL" comments in the Parser instead of the JS. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code review (svenpanne@) Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/heap.h » ('j') | src/scanner.h » ('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/isolate-inl.h" 8 #include "src/isolate-inl.h"
9 #include "src/natives.h" 9 #include "src/natives.h"
10 #include "src/snapshot.h" 10 #include "src/snapshot.h"
(...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 // Builtin functions for Script. 1738 // Builtin functions for Script.
1739 Handle<JSFunction> script_fun = InstallFunction( 1739 Handle<JSFunction> script_fun = InstallFunction(
1740 builtins, "Script", JS_VALUE_TYPE, JSValue::kSize, 1740 builtins, "Script", JS_VALUE_TYPE, JSValue::kSize,
1741 isolate()->initial_object_prototype(), Builtins::kIllegal); 1741 isolate()->initial_object_prototype(), Builtins::kIllegal);
1742 Handle<JSObject> prototype = 1742 Handle<JSObject> prototype =
1743 factory()->NewJSObject(isolate()->object_function(), TENURED); 1743 factory()->NewJSObject(isolate()->object_function(), TENURED);
1744 Accessors::FunctionSetPrototype(script_fun, prototype); 1744 Accessors::FunctionSetPrototype(script_fun, prototype);
1745 native_context()->set_script_function(*script_fun); 1745 native_context()->set_script_function(*script_fun);
1746 1746
1747 Handle<Map> script_map = Handle<Map>(script_fun->initial_map()); 1747 Handle<Map> script_map = Handle<Map>(script_fun->initial_map());
1748 Map::EnsureDescriptorSlack(script_map, 13); 1748 Map::EnsureDescriptorSlack(script_map, 14);
1749 1749
1750 PropertyAttributes attribs = 1750 PropertyAttributes attribs =
1751 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); 1751 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
1752 1752
1753 Handle<AccessorInfo> script_column = 1753 Handle<AccessorInfo> script_column =
1754 Accessors::ScriptColumnOffsetInfo(isolate(), attribs); 1754 Accessors::ScriptColumnOffsetInfo(isolate(), attribs);
1755 { 1755 {
1756 CallbacksDescriptor d(Handle<Name>(Name::cast(script_column->name())), 1756 CallbacksDescriptor d(Handle<Name>(Name::cast(script_column->name())),
1757 script_column, attribs); 1757 script_column, attribs);
1758 script_map->AppendDescriptor(&d); 1758 script_map->AppendDescriptor(&d);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1845 1845
1846 Handle<AccessorInfo> script_eval_from_function_name = 1846 Handle<AccessorInfo> script_eval_from_function_name =
1847 Accessors::ScriptEvalFromFunctionNameInfo(isolate(), attribs); 1847 Accessors::ScriptEvalFromFunctionNameInfo(isolate(), attribs);
1848 { 1848 {
1849 CallbacksDescriptor d( 1849 CallbacksDescriptor d(
1850 Handle<Name>(Name::cast(script_eval_from_function_name->name())), 1850 Handle<Name>(Name::cast(script_eval_from_function_name->name())),
1851 script_eval_from_function_name, attribs); 1851 script_eval_from_function_name, attribs);
1852 script_map->AppendDescriptor(&d); 1852 script_map->AppendDescriptor(&d);
1853 } 1853 }
1854 1854
1855 Handle<AccessorInfo> script_source_url =
1856 Accessors::ScriptSourceUrlInfo(isolate(), attribs);
1857 {
1858 CallbacksDescriptor d(Handle<Name>(Name::cast(script_source_url->name())),
1859 script_source_url, attribs);
1860 script_map->AppendDescriptor(&d);
1861 }
1862
1863 Handle<AccessorInfo> script_source_mapping_url =
1864 Accessors::ScriptSourceMappingUrlInfo(isolate(), attribs);
1865 {
1866 CallbacksDescriptor d(
1867 Handle<Name>(Name::cast(script_source_mapping_url->name())),
1868 script_source_mapping_url, attribs);
1869 script_map->AppendDescriptor(&d);
1870 }
1871
1855 // Allocate the empty script. 1872 // Allocate the empty script.
1856 Handle<Script> script = factory()->NewScript(factory()->empty_string()); 1873 Handle<Script> script = factory()->NewScript(factory()->empty_string());
1857 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); 1874 script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
1858 heap()->public_set_empty_script(*script); 1875 heap()->public_set_empty_script(*script);
1859 } 1876 }
1860 { 1877 {
1861 // Builtin function for OpaqueReference -- a JSValue-based object, 1878 // Builtin function for OpaqueReference -- a JSValue-based object,
1862 // that keeps its field isolated from JavaScript code. It may store 1879 // that keeps its field isolated from JavaScript code. It may store
1863 // objects, that JavaScript code may not access. 1880 // objects, that JavaScript code may not access.
1864 Handle<JSFunction> opaque_reference_fun = InstallFunction( 1881 Handle<JSFunction> opaque_reference_fun = InstallFunction(
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
2718 return from + sizeof(NestingCounterType); 2735 return from + sizeof(NestingCounterType);
2719 } 2736 }
2720 2737
2721 2738
2722 // Called when the top-level V8 mutex is destroyed. 2739 // Called when the top-level V8 mutex is destroyed.
2723 void Bootstrapper::FreeThreadResources() { 2740 void Bootstrapper::FreeThreadResources() {
2724 ASSERT(!IsActive()); 2741 ASSERT(!IsActive());
2725 } 2742 }
2726 2743
2727 } } // namespace v8::internal 2744 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/heap.h » ('j') | src/scanner.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698