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

Side by Side Diff: src/bootstrapper.cc

Issue 1426413002: Revert of Implement flag and source getters on RegExp.prototype. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@rproto
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « src/api.cc ('k') | src/heap/heap.h » ('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 "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 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
1229 1229
1230 { 1230 {
1231 // ES6 21.2.3.2.1 1231 // ECMA-262, section 15.10.7.1.
1232 DataDescriptor field(factory->regexp_source_symbol(), 1232 DataDescriptor field(factory->source_string(),
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 DataDescriptor field(factory->regexp_flags_symbol(), 1238 // ECMA-262, section 15.10.7.2.
1239 JSRegExp::kFlagsFieldIndex, final, 1239 DataDescriptor field(factory->global_string(),
1240 Representation::Smi()); 1240 JSRegExp::kGlobalFieldIndex, final,
1241 Representation::Tagged());
1241 initial_map->AppendDescriptor(&field); 1242 initial_map->AppendDescriptor(&field);
1242 } 1243 }
1243 { 1244 {
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 {
1244 // ECMA-262, section 15.10.7.5. 1259 // ECMA-262, section 15.10.7.5.
1245 PropertyAttributes writable = 1260 PropertyAttributes writable =
1246 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); 1261 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
1247 DataDescriptor field(factory->last_index_string(), 1262 DataDescriptor field(factory->last_index_string(),
1248 JSRegExp::kLastIndexFieldIndex, writable, 1263 JSRegExp::kLastIndexFieldIndex, writable,
1249 Representation::Tagged()); 1264 Representation::Tagged());
1250 initial_map->AppendDescriptor(&field); 1265 initial_map->AppendDescriptor(&field);
1251 } 1266 }
1252 1267
1253 static const int num_fields = JSRegExp::kInObjectFieldCount; 1268 static const int num_fields = JSRegExp::kInObjectFieldCount;
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 HandleScope scope(isolate); 2048 HandleScope scope(isolate);
2034 2049
2035 #define INITIALIZE_FLAG(FLAG) \ 2050 #define INITIALIZE_FLAG(FLAG) \
2036 { \ 2051 { \
2037 Handle<String> name = \ 2052 Handle<String> name = \
2038 isolate->factory()->NewStringFromAsciiChecked(#FLAG); \ 2053 isolate->factory()->NewStringFromAsciiChecked(#FLAG); \
2039 JSObject::AddProperty(container, name, \ 2054 JSObject::AddProperty(container, name, \
2040 isolate->factory()->ToBoolean(FLAG), NONE); \ 2055 isolate->factory()->ToBoolean(FLAG), NONE); \
2041 } 2056 }
2042 2057
2058 INITIALIZE_FLAG(FLAG_harmony_regexps)
2059 INITIALIZE_FLAG(FLAG_harmony_unicode_regexps)
2043 INITIALIZE_FLAG(FLAG_harmony_tostring) 2060 INITIALIZE_FLAG(FLAG_harmony_tostring)
2044 INITIALIZE_FLAG(FLAG_harmony_tolength) 2061 INITIALIZE_FLAG(FLAG_harmony_tolength)
2045 2062
2046 #undef INITIALIZE_FLAG 2063 #undef INITIALIZE_FLAG
2047 } 2064 }
2048 2065
2049 2066
2050 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \ 2067 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \
2051 void Genesis::InitializeGlobal_##id() {} 2068 void Genesis::InitializeGlobal_##id() {}
2052 2069
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
3245 } 3262 }
3246 3263
3247 3264
3248 // Called when the top-level V8 mutex is destroyed. 3265 // Called when the top-level V8 mutex is destroyed.
3249 void Bootstrapper::FreeThreadResources() { 3266 void Bootstrapper::FreeThreadResources() {
3250 DCHECK(!IsActive()); 3267 DCHECK(!IsActive());
3251 } 3268 }
3252 3269
3253 } // namespace internal 3270 } // namespace internal
3254 } // namespace v8 3271 } // namespace v8
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698