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

Unified Diff: src/bootstrapper.cc

Issue 736003002: Correctly escape RegExp source. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@regexpref
Patch Set: update webkit expectations Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/accessors.cc ('k') | src/json-stringifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 02af9d2fbc1f62cc86717504991ad3c5c08a3811..7ba90200fa6a375930783444bd0138534678713e 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1044,11 +1044,10 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> global_object,
{
// ECMA-262, section 15.10.7.1.
- FieldDescriptor field(factory->source_string(),
- JSRegExp::kSourceFieldIndex,
- final,
- Representation::Tagged());
- initial_map->AppendDescriptor(&field);
+ Handle<AccessorInfo> regexp_source(
+ Accessors::RegExpSourceInfo(isolate, final));
+ CallbacksDescriptor d(factory->source_string(), regexp_source, final);
+ initial_map->AppendDescriptor(&d);
}
{
// ECMA-262, section 15.10.7.2.
@@ -1085,18 +1084,17 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> global_object,
initial_map->AppendDescriptor(&field);
}
- initial_map->set_inobject_properties(5);
- initial_map->set_pre_allocated_property_fields(5);
+ static const int num_fields = JSRegExp::kInObjectFieldCount;
+ initial_map->set_inobject_properties(num_fields);
+ initial_map->set_pre_allocated_property_fields(num_fields);
initial_map->set_unused_property_fields(0);
- initial_map->set_instance_size(
- initial_map->instance_size() + 5 * kPointerSize);
+ initial_map->set_instance_size(initial_map->instance_size() +
+ num_fields * kPointerSize);
// RegExp prototype object is itself a RegExp.
Handle<Map> proto_map = Map::Copy(initial_map, "RegExpPrototype");
proto_map->set_prototype(native_context()->initial_object_prototype());
Handle<JSObject> proto = factory->NewJSObjectFromMap(proto_map);
- proto->InObjectPropertyAtPut(JSRegExp::kSourceFieldIndex,
- heap->query_colon_string());
proto->InObjectPropertyAtPut(JSRegExp::kGlobalFieldIndex,
heap->false_value());
proto->InObjectPropertyAtPut(JSRegExp::kIgnoreCaseFieldIndex,
« no previous file with comments | « src/accessors.cc ('k') | src/json-stringifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698