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

Side by Side Diff: src/bootstrapper.cc

Issue 231973004: Reland r20652 "Handlify and convert string.length to new API-style accessor." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Allow overwriting Created 6 years, 8 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/objects.cc » ('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 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 "bootstrapper.h" 5 #include "bootstrapper.h"
6 6
7 #include "accessors.h" 7 #include "accessors.h"
8 #include "isolate-inl.h" 8 #include "isolate-inl.h"
9 #include "natives.h" 9 #include "natives.h"
10 #include "snapshot.h" 10 #include "snapshot.h"
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 isolate->initial_object_prototype(), 904 isolate->initial_object_prototype(),
905 Builtins::kIllegal, true, true); 905 Builtins::kIllegal, true, true);
906 string_fun->shared()->set_construct_stub( 906 string_fun->shared()->set_construct_stub(
907 isolate->builtins()->builtin(Builtins::kStringConstructCode)); 907 isolate->builtins()->builtin(Builtins::kStringConstructCode));
908 native_context()->set_string_function(*string_fun); 908 native_context()->set_string_function(*string_fun);
909 909
910 Handle<Map> string_map = 910 Handle<Map> string_map =
911 Handle<Map>(native_context()->string_function()->initial_map()); 911 Handle<Map>(native_context()->string_function()->initial_map());
912 Map::EnsureDescriptorSlack(string_map, 1); 912 Map::EnsureDescriptorSlack(string_map, 1);
913 913
914 Handle<Foreign> string_length(
915 factory->NewForeign(&Accessors::StringLength));
916 PropertyAttributes attribs = static_cast<PropertyAttributes>( 914 PropertyAttributes attribs = static_cast<PropertyAttributes>(
917 DONT_ENUM | DONT_DELETE | READ_ONLY); 915 DONT_ENUM | DONT_DELETE | READ_ONLY);
916 Handle<AccessorInfo> string_length(
917 Accessors::StringLengthInfo(isolate, attribs));
918 918
919 { // Add length. 919 { // Add length.
920 CallbacksDescriptor d(factory->length_string(), string_length, attribs); 920 CallbacksDescriptor d(factory->length_string(), string_length, attribs);
921 string_map->AppendDescriptor(&d); 921 string_map->AppendDescriptor(&d);
922 } 922 }
923 } 923 }
924 924
925 { // --- D a t e --- 925 { // --- D a t e ---
926 // Builtin functions for Date.prototype. 926 // Builtin functions for Date.prototype.
927 Handle<JSFunction> date_fun = 927 Handle<JSFunction> date_fun =
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after
2689 return from + sizeof(NestingCounterType); 2689 return from + sizeof(NestingCounterType);
2690 } 2690 }
2691 2691
2692 2692
2693 // Called when the top-level V8 mutex is destroyed. 2693 // Called when the top-level V8 mutex is destroyed.
2694 void Bootstrapper::FreeThreadResources() { 2694 void Bootstrapper::FreeThreadResources() {
2695 ASSERT(!IsActive()); 2695 ASSERT(!IsActive());
2696 } 2696 }
2697 2697
2698 } } // namespace v8::internal 2698 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/accessors.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698