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

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: . 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
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 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 // Builtin functions for Script. 1730 // Builtin functions for Script.
1731 Handle<JSFunction> script_fun = InstallFunction( 1731 Handle<JSFunction> script_fun = InstallFunction(
1732 builtins, "Script", JS_VALUE_TYPE, JSValue::kSize, 1732 builtins, "Script", JS_VALUE_TYPE, JSValue::kSize,
1733 isolate()->initial_object_prototype(), Builtins::kIllegal); 1733 isolate()->initial_object_prototype(), Builtins::kIllegal);
1734 Handle<JSObject> prototype = 1734 Handle<JSObject> prototype =
1735 factory()->NewJSObject(isolate()->object_function(), TENURED); 1735 factory()->NewJSObject(isolate()->object_function(), TENURED);
1736 Accessors::FunctionSetPrototype(script_fun, prototype); 1736 Accessors::FunctionSetPrototype(script_fun, prototype);
1737 native_context()->set_script_function(*script_fun); 1737 native_context()->set_script_function(*script_fun);
1738 1738
1739 Handle<Map> script_map = Handle<Map>(script_fun->initial_map()); 1739 Handle<Map> script_map = Handle<Map>(script_fun->initial_map());
1740 Map::EnsureDescriptorSlack(script_map, 13); 1740 Map::EnsureDescriptorSlack(script_map, 14);
1741 1741
1742 PropertyAttributes attribs = 1742 PropertyAttributes attribs =
1743 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); 1743 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
1744 1744
1745 Handle<AccessorInfo> script_column = 1745 Handle<AccessorInfo> script_column =
1746 Accessors::ScriptColumnOffsetInfo(isolate(), attribs); 1746 Accessors::ScriptColumnOffsetInfo(isolate(), attribs);
1747 { 1747 {
1748 CallbacksDescriptor d(Handle<Name>(Name::cast(script_column->name())), 1748 CallbacksDescriptor d(Handle<Name>(Name::cast(script_column->name())),
1749 script_column, attribs); 1749 script_column, attribs);
1750 script_map->AppendDescriptor(&d); 1750 script_map->AppendDescriptor(&d);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1837 1837
1838 Handle<AccessorInfo> script_eval_from_function_name = 1838 Handle<AccessorInfo> script_eval_from_function_name =
1839 Accessors::ScriptEvalFromFunctionNameInfo(isolate(), attribs); 1839 Accessors::ScriptEvalFromFunctionNameInfo(isolate(), attribs);
1840 { 1840 {
1841 CallbacksDescriptor d( 1841 CallbacksDescriptor d(
1842 Handle<Name>(Name::cast(script_eval_from_function_name->name())), 1842 Handle<Name>(Name::cast(script_eval_from_function_name->name())),
1843 script_eval_from_function_name, attribs); 1843 script_eval_from_function_name, attribs);
1844 script_map->AppendDescriptor(&d); 1844 script_map->AppendDescriptor(&d);
1845 } 1845 }
1846 1846
1847 Handle<AccessorInfo> script_source_url =
1848 Accessors::ScriptSourceUrlInfo(isolate(), attribs);
1849 {
1850 CallbacksDescriptor d(Handle<Name>(Name::cast(script_source_url->name())),
1851 script_source_url, attribs);
1852 script_map->AppendDescriptor(&d);
1853 }
1854
1855 Handle<AccessorInfo> script_source_mapping_url =
1856 Accessors::ScriptSourceMappingUrlInfo(isolate(), attribs);
1857 {
1858 CallbacksDescriptor d(
1859 Handle<Name>(Name::cast(script_source_mapping_url->name())),
1860 script_source_mapping_url, attribs);
1861 script_map->AppendDescriptor(&d);
1862 }
1863
1847 // Allocate the empty script. 1864 // Allocate the empty script.
1848 Handle<Script> script = factory()->NewScript(factory()->empty_string()); 1865 Handle<Script> script = factory()->NewScript(factory()->empty_string());
1849 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); 1866 script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
1850 heap()->public_set_empty_script(*script); 1867 heap()->public_set_empty_script(*script);
1851 } 1868 }
1852 { 1869 {
1853 // Builtin function for OpaqueReference -- a JSValue-based object, 1870 // Builtin function for OpaqueReference -- a JSValue-based object,
1854 // that keeps its field isolated from JavaScript code. It may store 1871 // that keeps its field isolated from JavaScript code. It may store
1855 // objects, that JavaScript code may not access. 1872 // objects, that JavaScript code may not access.
1856 Handle<JSFunction> opaque_reference_fun = InstallFunction( 1873 Handle<JSFunction> opaque_reference_fun = InstallFunction(
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
2710 return from + sizeof(NestingCounterType); 2727 return from + sizeof(NestingCounterType);
2711 } 2728 }
2712 2729
2713 2730
2714 // Called when the top-level V8 mutex is destroyed. 2731 // Called when the top-level V8 mutex is destroyed.
2715 void Bootstrapper::FreeThreadResources() { 2732 void Bootstrapper::FreeThreadResources() {
2716 ASSERT(!IsActive()); 2733 ASSERT(!IsActive());
2717 } 2734 }
2718 2735
2719 } } // namespace v8::internal 2736 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698