Chromium Code Reviews| 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/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/extensions/externalize-string-extension.h" | 10 #include "src/extensions/externalize-string-extension.h" |
| (...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1218 Builtins::kIllegal); | 1218 Builtins::kIllegal); |
| 1219 native_context()->set_regexp_function(*regexp_fun); | 1219 native_context()->set_regexp_function(*regexp_fun); |
| 1220 | 1220 |
| 1221 DCHECK(regexp_fun->has_initial_map()); | 1221 DCHECK(regexp_fun->has_initial_map()); |
| 1222 Handle<Map> initial_map(regexp_fun->initial_map()); | 1222 Handle<Map> initial_map(regexp_fun->initial_map()); |
| 1223 | 1223 |
| 1224 DCHECK_EQ(0, initial_map->GetInObjectProperties()); | 1224 DCHECK_EQ(0, initial_map->GetInObjectProperties()); |
| 1225 | 1225 |
| 1226 PropertyAttributes final = | 1226 PropertyAttributes final = |
| 1227 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); | 1227 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 1228 Map::EnsureDescriptorSlack(initial_map, 5); | 1228 Map::EnsureDescriptorSlack(initial_map, 5); |
|
Igor Sheludko
2015/11/06 19:34:34
DBC: shouldn't it now reserve only 3 entries?
| |
| 1229 | 1229 |
| 1230 { | 1230 { |
| 1231 // ECMA-262, section 15.10.7.1. | 1231 // ES6 21.2.3.2.1 |
| 1232 DataDescriptor field(factory->source_string(), | 1232 DataDescriptor field(factory->regexp_source_symbol(), |
| 1233 JSRegExp::kSourceFieldIndex, final, | 1233 JSRegExp::kSourceFieldIndex, final, |
| 1234 Representation::Tagged()); | 1234 Representation::Tagged()); |
| 1235 initial_map->AppendDescriptor(&field); | 1235 initial_map->AppendDescriptor(&field); |
| 1236 } | 1236 } |
| 1237 { | 1237 { |
| 1238 // ECMA-262, section 15.10.7.2. | 1238 DataDescriptor field(factory->regexp_flags_symbol(), |
| 1239 DataDescriptor field(factory->global_string(), | 1239 JSRegExp::kFlagsFieldIndex, final, |
| 1240 JSRegExp::kGlobalFieldIndex, final, | 1240 Representation::Smi()); |
| 1241 Representation::Tagged()); | |
| 1242 initial_map->AppendDescriptor(&field); | 1241 initial_map->AppendDescriptor(&field); |
| 1243 } | 1242 } |
| 1244 { | 1243 { |
| 1245 // ECMA-262, section 15.10.7.3. | |
| 1246 DataDescriptor field(factory->ignore_case_string(), | |
| 1247 JSRegExp::kIgnoreCaseFieldIndex, final, | |
| 1248 Representation::Tagged()); | |
| 1249 initial_map->AppendDescriptor(&field); | |
| 1250 } | |
| 1251 { | |
| 1252 // ECMA-262, section 15.10.7.4. | |
| 1253 DataDescriptor field(factory->multiline_string(), | |
| 1254 JSRegExp::kMultilineFieldIndex, final, | |
| 1255 Representation::Tagged()); | |
| 1256 initial_map->AppendDescriptor(&field); | |
| 1257 } | |
| 1258 { | |
| 1259 // ECMA-262, section 15.10.7.5. | 1244 // ECMA-262, section 15.10.7.5. |
| 1260 PropertyAttributes writable = | 1245 PropertyAttributes writable = |
| 1261 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); | 1246 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); |
| 1262 DataDescriptor field(factory->last_index_string(), | 1247 DataDescriptor field(factory->last_index_string(), |
| 1263 JSRegExp::kLastIndexFieldIndex, writable, | 1248 JSRegExp::kLastIndexFieldIndex, writable, |
| 1264 Representation::Tagged()); | 1249 Representation::Tagged()); |
| 1265 initial_map->AppendDescriptor(&field); | 1250 initial_map->AppendDescriptor(&field); |
| 1266 } | 1251 } |
| 1267 | 1252 |
| 1268 static const int num_fields = JSRegExp::kInObjectFieldCount; | 1253 static const int num_fields = JSRegExp::kInObjectFieldCount; |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2048 HandleScope scope(isolate); | 2033 HandleScope scope(isolate); |
| 2049 | 2034 |
| 2050 #define INITIALIZE_FLAG(FLAG) \ | 2035 #define INITIALIZE_FLAG(FLAG) \ |
| 2051 { \ | 2036 { \ |
| 2052 Handle<String> name = \ | 2037 Handle<String> name = \ |
| 2053 isolate->factory()->NewStringFromAsciiChecked(#FLAG); \ | 2038 isolate->factory()->NewStringFromAsciiChecked(#FLAG); \ |
| 2054 JSObject::AddProperty(container, name, \ | 2039 JSObject::AddProperty(container, name, \ |
| 2055 isolate->factory()->ToBoolean(FLAG), NONE); \ | 2040 isolate->factory()->ToBoolean(FLAG), NONE); \ |
| 2056 } | 2041 } |
| 2057 | 2042 |
| 2058 INITIALIZE_FLAG(FLAG_harmony_regexps) | |
| 2059 INITIALIZE_FLAG(FLAG_harmony_unicode_regexps) | |
| 2060 INITIALIZE_FLAG(FLAG_harmony_tostring) | 2043 INITIALIZE_FLAG(FLAG_harmony_tostring) |
| 2061 INITIALIZE_FLAG(FLAG_harmony_tolength) | 2044 INITIALIZE_FLAG(FLAG_harmony_tolength) |
| 2062 | 2045 |
| 2063 #undef INITIALIZE_FLAG | 2046 #undef INITIALIZE_FLAG |
| 2064 } | 2047 } |
| 2065 | 2048 |
| 2066 | 2049 |
| 2067 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \ | 2050 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \ |
| 2068 void Genesis::InitializeGlobal_##id() {} | 2051 void Genesis::InitializeGlobal_##id() {} |
| 2069 | 2052 |
| (...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3262 } | 3245 } |
| 3263 | 3246 |
| 3264 | 3247 |
| 3265 // Called when the top-level V8 mutex is destroyed. | 3248 // Called when the top-level V8 mutex is destroyed. |
| 3266 void Bootstrapper::FreeThreadResources() { | 3249 void Bootstrapper::FreeThreadResources() { |
| 3267 DCHECK(!IsActive()); | 3250 DCHECK(!IsActive()); |
| 3268 } | 3251 } |
| 3269 | 3252 |
| 3270 } // namespace internal | 3253 } // namespace internal |
| 3271 } // namespace v8 | 3254 } // namespace v8 |
| OLD | NEW |