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

Side by Side Diff: src/bootstrapper.cc

Issue 8041015: Make the RegExp.prototype object be a RegExp object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated test expectations. Created 9 years, 2 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 | « no previous file | src/regexp.js » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 descriptors->SetNextEnumerationIndex(enum_index); 988 descriptors->SetNextEnumerationIndex(enum_index);
989 descriptors->Sort(); 989 descriptors->Sort();
990 990
991 initial_map->set_inobject_properties(5); 991 initial_map->set_inobject_properties(5);
992 initial_map->set_pre_allocated_property_fields(5); 992 initial_map->set_pre_allocated_property_fields(5);
993 initial_map->set_unused_property_fields(0); 993 initial_map->set_unused_property_fields(0);
994 initial_map->set_instance_size( 994 initial_map->set_instance_size(
995 initial_map->instance_size() + 5 * kPointerSize); 995 initial_map->instance_size() + 5 * kPointerSize);
996 initial_map->set_instance_descriptors(*descriptors); 996 initial_map->set_instance_descriptors(*descriptors);
997 initial_map->set_visitor_id(StaticVisitorBase::GetVisitorId(*initial_map)); 997 initial_map->set_visitor_id(StaticVisitorBase::GetVisitorId(*initial_map));
998
999 // RegExp prototype object is itself a RegExp.
1000 Handle<Map> proto_map = factory->CopyMapDropTransitions(initial_map);
1001 proto_map->set_prototype(global_context()->initial_object_prototype());
1002 Handle<JSObject> proto = factory->NewJSObjectFromMap(proto_map);
1003 proto->InObjectPropertyAtPut(JSRegExp::kSourceFieldIndex,
1004 heap->empty_string());
1005 proto->InObjectPropertyAtPut(JSRegExp::kGlobalFieldIndex,
1006 heap->false_value());
1007 proto->InObjectPropertyAtPut(JSRegExp::kIgnoreCaseFieldIndex,
1008 heap->false_value());
1009 proto->InObjectPropertyAtPut(JSRegExp::kMultilineFieldIndex,
1010 heap->false_value());
1011 proto->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex,
1012 Smi::FromInt(0),
1013 SKIP_WRITE_BARRIER); // It's a Smi.
1014 initial_map->set_prototype(*proto);
1015 factory->SetRegExpIrregexpData(Handle<JSRegExp>::cast(proto),
1016 JSRegExp::IRREGEXP, factory->empty_string(),
1017 JSRegExp::Flags(0), 0);
998 } 1018 }
999 1019
1000 { // -- J S O N 1020 { // -- J S O N
1001 Handle<String> name = factory->NewStringFromAscii(CStrVector("JSON")); 1021 Handle<String> name = factory->NewStringFromAscii(CStrVector("JSON"));
1002 Handle<JSFunction> cons = factory->NewFunction( 1022 Handle<JSFunction> cons = factory->NewFunction(
1003 name, 1023 name,
1004 factory->the_hole_value()); 1024 factory->the_hole_value());
1005 cons->SetInstancePrototype(global_context()->initial_object_prototype()); 1025 cons->SetInstancePrototype(global_context()->initial_object_prototype());
1006 cons->SetInstanceClassName(*name); 1026 cons->SetInstanceClassName(*name);
1007 Handle<JSObject> json_object = factory->NewJSObject(cons, TENURED); 1027 Handle<JSObject> json_object = factory->NewJSObject(cons, TENURED);
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
2245 return from + sizeof(NestingCounterType); 2265 return from + sizeof(NestingCounterType);
2246 } 2266 }
2247 2267
2248 2268
2249 // Called when the top-level V8 mutex is destroyed. 2269 // Called when the top-level V8 mutex is destroyed.
2250 void Bootstrapper::FreeThreadResources() { 2270 void Bootstrapper::FreeThreadResources() {
2251 ASSERT(!IsActive()); 2271 ASSERT(!IsActive());
2252 } 2272 }
2253 2273
2254 } } // namespace v8::internal 2274 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698