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

Side by Side Diff: src/bootstrapper.cc

Issue 23280004: Handlify Accessors::FunctionSetPrototype method. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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/accessors.cc ('k') | src/handles.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 // Allocate a new prototype for the object function. 484 // Allocate a new prototype for the object function.
485 Handle<JSObject> prototype = factory->NewJSObject( 485 Handle<JSObject> prototype = factory->NewJSObject(
486 isolate->object_function(), 486 isolate->object_function(),
487 TENURED); 487 TENURED);
488 488
489 native_context()->set_initial_object_prototype(*prototype); 489 native_context()->set_initial_object_prototype(*prototype);
490 // For bootstrapping set the array prototype to be the same as the object 490 // For bootstrapping set the array prototype to be the same as the object
491 // prototype, otherwise the missing initial_array_prototype will cause 491 // prototype, otherwise the missing initial_array_prototype will cause
492 // assertions during startup. 492 // assertions during startup.
493 native_context()->set_initial_array_prototype(*prototype); 493 native_context()->set_initial_array_prototype(*prototype);
494 SetPrototype(object_fun, prototype); 494 Accessors::FunctionSetPrototype(object_fun, prototype);
495 } 495 }
496 496
497 // Allocate the empty function as the prototype for function ECMAScript 497 // Allocate the empty function as the prototype for function ECMAScript
498 // 262 15.3.4. 498 // 262 15.3.4.
499 Handle<String> empty_string = 499 Handle<String> empty_string =
500 factory->InternalizeOneByteString(STATIC_ASCII_VECTOR("Empty")); 500 factory->InternalizeOneByteString(STATIC_ASCII_VECTOR("Empty"));
501 Handle<JSFunction> empty_function = 501 Handle<JSFunction> empty_function =
502 factory->NewFunctionWithoutPrototype(empty_string, CLASSIC_MODE); 502 factory->NewFunctionWithoutPrototype(empty_string, CLASSIC_MODE);
503 503
504 // --- E m p t y --- 504 // --- E m p t y ---
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 Handle<JSFunction> array_function = 1625 Handle<JSFunction> array_function =
1626 InstallFunction(builtins, 1626 InstallFunction(builtins,
1627 name, 1627 name,
1628 JS_ARRAY_TYPE, 1628 JS_ARRAY_TYPE,
1629 JSArray::kSize, 1629 JSArray::kSize,
1630 isolate()->initial_object_prototype(), 1630 isolate()->initial_object_prototype(),
1631 Builtins::kInternalArrayCode, 1631 Builtins::kInternalArrayCode,
1632 true, true); 1632 true, true);
1633 Handle<JSObject> prototype = 1633 Handle<JSObject> prototype =
1634 factory()->NewJSObject(isolate()->object_function(), TENURED); 1634 factory()->NewJSObject(isolate()->object_function(), TENURED);
1635 SetPrototype(array_function, prototype); 1635 Accessors::FunctionSetPrototype(array_function, prototype);
1636 1636
1637 InternalArrayConstructorStub internal_array_constructor_stub(isolate()); 1637 InternalArrayConstructorStub internal_array_constructor_stub(isolate());
1638 Handle<Code> code = internal_array_constructor_stub.GetCode(isolate()); 1638 Handle<Code> code = internal_array_constructor_stub.GetCode(isolate());
1639 array_function->shared()->set_construct_stub(*code); 1639 array_function->shared()->set_construct_stub(*code);
1640 array_function->shared()->DontAdaptArguments(); 1640 array_function->shared()->DontAdaptArguments();
1641 1641
1642 Handle<Map> original_map(array_function->initial_map()); 1642 Handle<Map> original_map(array_function->initial_map());
1643 Handle<Map> initial_map = factory()->CopyMap(original_map); 1643 Handle<Map> initial_map = factory()->CopyMap(original_map);
1644 initial_map->set_elements_kind(elements_kind); 1644 initial_map->set_elements_kind(elements_kind);
1645 array_function->set_initial_map(*initial_map); 1645 array_function->set_initial_map(*initial_map);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1723 native_context()->set_runtime_context(*context); 1723 native_context()->set_runtime_context(*context);
1724 1724
1725 { // -- S c r i p t 1725 { // -- S c r i p t
1726 // Builtin functions for Script. 1726 // Builtin functions for Script.
1727 Handle<JSFunction> script_fun = 1727 Handle<JSFunction> script_fun =
1728 InstallFunction(builtins, "Script", JS_VALUE_TYPE, JSValue::kSize, 1728 InstallFunction(builtins, "Script", JS_VALUE_TYPE, JSValue::kSize,
1729 isolate()->initial_object_prototype(), 1729 isolate()->initial_object_prototype(),
1730 Builtins::kIllegal, false, false); 1730 Builtins::kIllegal, false, false);
1731 Handle<JSObject> prototype = 1731 Handle<JSObject> prototype =
1732 factory()->NewJSObject(isolate()->object_function(), TENURED); 1732 factory()->NewJSObject(isolate()->object_function(), TENURED);
1733 SetPrototype(script_fun, prototype); 1733 Accessors::FunctionSetPrototype(script_fun, prototype);
1734 native_context()->set_script_function(*script_fun); 1734 native_context()->set_script_function(*script_fun);
1735 1735
1736 Handle<Map> script_map = Handle<Map>(script_fun->initial_map()); 1736 Handle<Map> script_map = Handle<Map>(script_fun->initial_map());
1737 1737
1738 Handle<DescriptorArray> script_descriptors( 1738 Handle<DescriptorArray> script_descriptors(
1739 factory()->NewDescriptorArray(0, 13)); 1739 factory()->NewDescriptorArray(0, 13));
1740 DescriptorArray::WhitenessWitness witness(*script_descriptors); 1740 DescriptorArray::WhitenessWitness witness(*script_descriptors);
1741 1741
1742 Handle<Foreign> script_source( 1742 Handle<Foreign> script_source(
1743 factory()->NewForeign(&Accessors::ScriptSource)); 1743 factory()->NewForeign(&Accessors::ScriptSource));
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 // Builtin function for OpaqueReference -- a JSValue-based object, 1879 // Builtin function for OpaqueReference -- a JSValue-based object,
1880 // that keeps its field isolated from JavaScript code. It may store 1880 // that keeps its field isolated from JavaScript code. It may store
1881 // objects, that JavaScript code may not access. 1881 // objects, that JavaScript code may not access.
1882 Handle<JSFunction> opaque_reference_fun = 1882 Handle<JSFunction> opaque_reference_fun =
1883 InstallFunction(builtins, "OpaqueReference", JS_VALUE_TYPE, 1883 InstallFunction(builtins, "OpaqueReference", JS_VALUE_TYPE,
1884 JSValue::kSize, 1884 JSValue::kSize,
1885 isolate()->initial_object_prototype(), 1885 isolate()->initial_object_prototype(),
1886 Builtins::kIllegal, false, false); 1886 Builtins::kIllegal, false, false);
1887 Handle<JSObject> prototype = 1887 Handle<JSObject> prototype =
1888 factory()->NewJSObject(isolate()->object_function(), TENURED); 1888 factory()->NewJSObject(isolate()->object_function(), TENURED);
1889 SetPrototype(opaque_reference_fun, prototype); 1889 Accessors::FunctionSetPrototype(opaque_reference_fun, prototype);
1890 native_context()->set_opaque_reference_function(*opaque_reference_fun); 1890 native_context()->set_opaque_reference_function(*opaque_reference_fun);
1891 } 1891 }
1892 1892
1893 // InternalArrays should not use Smi-Only array optimizations. There are too 1893 // InternalArrays should not use Smi-Only array optimizations. There are too
1894 // many places in the C++ runtime code (e.g. RegEx) that assume that 1894 // many places in the C++ runtime code (e.g. RegEx) that assume that
1895 // elements in InternalArrays can be set to non-Smi values without going 1895 // elements in InternalArrays can be set to non-Smi values without going
1896 // through a common bottleneck that would make the SMI_ONLY -> FAST_ELEMENT 1896 // through a common bottleneck that would make the SMI_ONLY -> FAST_ELEMENT
1897 // transition easy to trap. Moreover, they rarely are smi-only. 1897 // transition easy to trap. Moreover, they rarely are smi-only.
1898 { 1898 {
1899 Handle<JSFunction> array_function = 1899 Handle<JSFunction> array_function =
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
2685 return from + sizeof(NestingCounterType); 2685 return from + sizeof(NestingCounterType);
2686 } 2686 }
2687 2687
2688 2688
2689 // Called when the top-level V8 mutex is destroyed. 2689 // Called when the top-level V8 mutex is destroyed.
2690 void Bootstrapper::FreeThreadResources() { 2690 void Bootstrapper::FreeThreadResources() {
2691 ASSERT(!IsActive()); 2691 ASSERT(!IsActive());
2692 } 2692 }
2693 2693
2694 } } // namespace v8::internal 2694 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/accessors.cc ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698