OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 16488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16499 Map* map = regexp->map(); | 16499 Map* map = regexp->map(); |
16500 Object* constructor = map->GetConstructor(); | 16500 Object* constructor = map->GetConstructor(); |
16501 if (constructor->IsJSFunction() && | 16501 if (constructor->IsJSFunction() && |
16502 JSFunction::cast(constructor)->initial_map() == map) { | 16502 JSFunction::cast(constructor)->initial_map() == map) { |
16503 // If we still have the original map, set in-object properties directly. | 16503 // If we still have the original map, set in-object properties directly. |
16504 regexp->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex, Smi::kZero, | 16504 regexp->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex, Smi::kZero, |
16505 SKIP_WRITE_BARRIER); | 16505 SKIP_WRITE_BARRIER); |
16506 } else { | 16506 } else { |
16507 // Map has changed, so use generic, but slower, method. | 16507 // Map has changed, so use generic, but slower, method. |
16508 RETURN_ON_EXCEPTION(isolate, JSReceiver::SetProperty( | 16508 RETURN_ON_EXCEPTION(isolate, JSReceiver::SetProperty( |
16509 regexp, factory->last_index_string(), | 16509 regexp, factory->lastIndex_string(), |
16510 Handle<Smi>(Smi::kZero, isolate), STRICT), | 16510 Handle<Smi>(Smi::kZero, isolate), STRICT), |
16511 JSRegExp); | 16511 JSRegExp); |
16512 } | 16512 } |
16513 | 16513 |
16514 return regexp; | 16514 return regexp; |
16515 } | 16515 } |
16516 | 16516 |
16517 | 16517 |
16518 // RegExpKey carries the source and flags of a regular expression as key. | 16518 // RegExpKey carries the source and flags of a regular expression as key. |
16519 class RegExpKey : public HashTableKey { | 16519 class RegExpKey : public HashTableKey { |
(...skipping 3565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20085 ns, Accessors::ModuleNamespaceEntryInfo(isolate, name, attr)) | 20085 ns, Accessors::ModuleNamespaceEntryInfo(isolate, name, attr)) |
20086 .Check(); | 20086 .Check(); |
20087 } | 20087 } |
20088 JSObject::PreventExtensions(ns, THROW_ON_ERROR).ToChecked(); | 20088 JSObject::PreventExtensions(ns, THROW_ON_ERROR).ToChecked(); |
20089 | 20089 |
20090 return ns; | 20090 return ns; |
20091 } | 20091 } |
20092 | 20092 |
20093 } // namespace internal | 20093 } // namespace internal |
20094 } // namespace v8 | 20094 } // namespace v8 |
OLD | NEW |