OLD | NEW |
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/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/base/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 DCHECK(regexp_fun->has_initial_map()); | 1237 DCHECK(regexp_fun->has_initial_map()); |
1238 Handle<Map> initial_map(regexp_fun->initial_map()); | 1238 Handle<Map> initial_map(regexp_fun->initial_map()); |
1239 | 1239 |
1240 DCHECK_EQ(0, initial_map->GetInObjectProperties()); | 1240 DCHECK_EQ(0, initial_map->GetInObjectProperties()); |
1241 | 1241 |
1242 PropertyAttributes final = | 1242 PropertyAttributes final = |
1243 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); | 1243 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
1244 Map::EnsureDescriptorSlack(initial_map, 5); | 1244 Map::EnsureDescriptorSlack(initial_map, 5); |
1245 | 1245 |
1246 { | 1246 { |
1247 // ECMA-262, section 15.10.7.1. | 1247 // ES6 21.2.3.2.1 |
1248 DataDescriptor field(factory->source_string(), | 1248 DataDescriptor field(factory->regexp_source_symbol(), |
1249 JSRegExp::kSourceFieldIndex, final, | 1249 JSRegExp::kSourceFieldIndex, final, |
1250 Representation::Tagged()); | 1250 Representation::Tagged()); |
1251 initial_map->AppendDescriptor(&field); | 1251 initial_map->AppendDescriptor(&field); |
1252 } | 1252 } |
1253 { | 1253 { |
1254 // ECMA-262, section 15.10.7.2. | 1254 DataDescriptor field(factory->regexp_flags_symbol(), |
1255 DataDescriptor field(factory->global_string(), | 1255 JSRegExp::kFlagsFieldIndex, final, |
1256 JSRegExp::kGlobalFieldIndex, final, | 1256 Representation::Smi()); |
1257 Representation::Tagged()); | |
1258 initial_map->AppendDescriptor(&field); | 1257 initial_map->AppendDescriptor(&field); |
1259 } | 1258 } |
1260 { | 1259 { |
1261 // ECMA-262, section 15.10.7.3. | |
1262 DataDescriptor field(factory->ignore_case_string(), | |
1263 JSRegExp::kIgnoreCaseFieldIndex, final, | |
1264 Representation::Tagged()); | |
1265 initial_map->AppendDescriptor(&field); | |
1266 } | |
1267 { | |
1268 // ECMA-262, section 15.10.7.4. | |
1269 DataDescriptor field(factory->multiline_string(), | |
1270 JSRegExp::kMultilineFieldIndex, final, | |
1271 Representation::Tagged()); | |
1272 initial_map->AppendDescriptor(&field); | |
1273 } | |
1274 { | |
1275 // ECMA-262, section 15.10.7.5. | 1260 // ECMA-262, section 15.10.7.5. |
1276 PropertyAttributes writable = | 1261 PropertyAttributes writable = |
1277 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); | 1262 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); |
1278 DataDescriptor field(factory->last_index_string(), | 1263 DataDescriptor field(factory->last_index_string(), |
1279 JSRegExp::kLastIndexFieldIndex, writable, | 1264 JSRegExp::kLastIndexFieldIndex, writable, |
1280 Representation::Tagged()); | 1265 Representation::Tagged()); |
1281 initial_map->AppendDescriptor(&field); | 1266 initial_map->AppendDescriptor(&field); |
1282 } | 1267 } |
1283 | 1268 |
1284 static const int num_fields = JSRegExp::kInObjectFieldCount; | 1269 static const int num_fields = JSRegExp::kInObjectFieldCount; |
(...skipping 2019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3304 } | 3289 } |
3305 | 3290 |
3306 | 3291 |
3307 // Called when the top-level V8 mutex is destroyed. | 3292 // Called when the top-level V8 mutex is destroyed. |
3308 void Bootstrapper::FreeThreadResources() { | 3293 void Bootstrapper::FreeThreadResources() { |
3309 DCHECK(!IsActive()); | 3294 DCHECK(!IsActive()); |
3310 } | 3295 } |
3311 | 3296 |
3312 } // namespace internal | 3297 } // namespace internal |
3313 } // namespace v8 | 3298 } // namespace v8 |
OLD | NEW |