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

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: less magic in names Created 6 years, 5 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/vector.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/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/extensions/externalize-string-extension.h" 9 #include "src/extensions/externalize-string-extension.h"
10 #include "src/extensions/free-buffer-extension.h" 10 #include "src/extensions/free-buffer-extension.h"
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1756 // Builtin functions for Script. 1756 // Builtin functions for Script.
1757 Handle<JSFunction> script_fun = InstallFunction( 1757 Handle<JSFunction> script_fun = InstallFunction(
1758 builtins, "Script", JS_VALUE_TYPE, JSValue::kSize, 1758 builtins, "Script", JS_VALUE_TYPE, JSValue::kSize,
1759 isolate()->initial_object_prototype(), Builtins::kIllegal); 1759 isolate()->initial_object_prototype(), Builtins::kIllegal);
1760 Handle<JSObject> prototype = 1760 Handle<JSObject> prototype =
1761 factory()->NewJSObject(isolate()->object_function(), TENURED); 1761 factory()->NewJSObject(isolate()->object_function(), TENURED);
1762 Accessors::FunctionSetPrototype(script_fun, prototype); 1762 Accessors::FunctionSetPrototype(script_fun, prototype);
1763 native_context()->set_script_function(*script_fun); 1763 native_context()->set_script_function(*script_fun);
1764 1764
1765 Handle<Map> script_map = Handle<Map>(script_fun->initial_map()); 1765 Handle<Map> script_map = Handle<Map>(script_fun->initial_map());
1766 Map::EnsureDescriptorSlack(script_map, 13); 1766 Map::EnsureDescriptorSlack(script_map, 14);
1767 1767
1768 PropertyAttributes attribs = 1768 PropertyAttributes attribs =
1769 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); 1769 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
1770 1770
1771 Handle<AccessorInfo> script_column = 1771 Handle<AccessorInfo> script_column =
1772 Accessors::ScriptColumnOffsetInfo(isolate(), attribs); 1772 Accessors::ScriptColumnOffsetInfo(isolate(), attribs);
1773 { 1773 {
1774 CallbacksDescriptor d(Handle<Name>(Name::cast(script_column->name())), 1774 CallbacksDescriptor d(Handle<Name>(Name::cast(script_column->name())),
1775 script_column, attribs); 1775 script_column, attribs);
1776 script_map->AppendDescriptor(&d); 1776 script_map->AppendDescriptor(&d);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1863 1863
1864 Handle<AccessorInfo> script_eval_from_function_name = 1864 Handle<AccessorInfo> script_eval_from_function_name =
1865 Accessors::ScriptEvalFromFunctionNameInfo(isolate(), attribs); 1865 Accessors::ScriptEvalFromFunctionNameInfo(isolate(), attribs);
1866 { 1866 {
1867 CallbacksDescriptor d( 1867 CallbacksDescriptor d(
1868 Handle<Name>(Name::cast(script_eval_from_function_name->name())), 1868 Handle<Name>(Name::cast(script_eval_from_function_name->name())),
1869 script_eval_from_function_name, attribs); 1869 script_eval_from_function_name, attribs);
1870 script_map->AppendDescriptor(&d); 1870 script_map->AppendDescriptor(&d);
1871 } 1871 }
1872 1872
1873 Handle<AccessorInfo> script_source_url =
1874 Accessors::ScriptSourceUrlInfo(isolate(), attribs);
1875 {
1876 CallbacksDescriptor d(Handle<Name>(Name::cast(script_source_url->name())),
1877 script_source_url, attribs);
1878 script_map->AppendDescriptor(&d);
1879 }
1880
1881 Handle<AccessorInfo> script_source_mapping_url =
1882 Accessors::ScriptSourceMappingUrlInfo(isolate(), attribs);
1883 {
1884 CallbacksDescriptor d(
1885 Handle<Name>(Name::cast(script_source_mapping_url->name())),
1886 script_source_mapping_url, attribs);
1887 script_map->AppendDescriptor(&d);
1888 }
1889
1873 // Allocate the empty script. 1890 // Allocate the empty script.
1874 Handle<Script> script = factory()->NewScript(factory()->empty_string()); 1891 Handle<Script> script = factory()->NewScript(factory()->empty_string());
1875 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); 1892 script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
1876 heap()->public_set_empty_script(*script); 1893 heap()->public_set_empty_script(*script);
1877 } 1894 }
1878 { 1895 {
1879 // Builtin function for OpaqueReference -- a JSValue-based object, 1896 // Builtin function for OpaqueReference -- a JSValue-based object,
1880 // that keeps its field isolated from JavaScript code. It may store 1897 // that keeps its field isolated from JavaScript code. It may store
1881 // objects, that JavaScript code may not access. 1898 // objects, that JavaScript code may not access.
1882 Handle<JSFunction> opaque_reference_fun = InstallFunction( 1899 Handle<JSFunction> opaque_reference_fun = InstallFunction(
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
2732 return from + sizeof(NestingCounterType); 2749 return from + sizeof(NestingCounterType);
2733 } 2750 }
2734 2751
2735 2752
2736 // Called when the top-level V8 mutex is destroyed. 2753 // Called when the top-level V8 mutex is destroyed.
2737 void Bootstrapper::FreeThreadResources() { 2754 void Bootstrapper::FreeThreadResources() {
2738 ASSERT(!IsActive()); 2755 ASSERT(!IsActive());
2739 } 2756 }
2740 2757
2741 } } // namespace v8::internal 2758 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/heap.h » ('j') | src/vector.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698