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 16374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16385 Object* constructor = map->GetConstructor(); | 16385 Object* constructor = map->GetConstructor(); |
16386 if (constructor->IsJSFunction() && | 16386 if (constructor->IsJSFunction() && |
16387 JSFunction::cast(constructor)->initial_map() == map) { | 16387 JSFunction::cast(constructor)->initial_map() == map) { |
16388 // If we still have the original map, set in-object properties directly. | 16388 // If we still have the original map, set in-object properties directly. |
16389 regexp->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex, | 16389 regexp->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex, |
16390 Smi::FromInt(0), SKIP_WRITE_BARRIER); | 16390 Smi::FromInt(0), SKIP_WRITE_BARRIER); |
16391 } else { | 16391 } else { |
16392 // Map has changed, so use generic, but slower, method. | 16392 // Map has changed, so use generic, but slower, method. |
16393 RETURN_ON_EXCEPTION( | 16393 RETURN_ON_EXCEPTION( |
16394 isolate, | 16394 isolate, |
16395 JSReceiver::SetProperty(regexp, factory->last_index_string(), | 16395 JSReceiver::SetProperty(regexp, factory->lastIndex_string(), |
16396 Handle<Smi>(Smi::FromInt(0), isolate), STRICT), | 16396 Handle<Smi>(Smi::FromInt(0), isolate), STRICT), |
16397 JSRegExp); | 16397 JSRegExp); |
16398 } | 16398 } |
16399 | 16399 |
16400 return regexp; | 16400 return regexp; |
16401 } | 16401 } |
16402 | 16402 |
16403 | 16403 |
16404 // RegExpKey carries the source and flags of a regular expression as key. | 16404 // RegExpKey carries the source and flags of a regular expression as key. |
16405 class RegExpKey : public HashTableKey { | 16405 class RegExpKey : public HashTableKey { |
(...skipping 3025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19431 for (PrototypeIterator iter(isolate, this, kStartAtReceiver, | 19431 for (PrototypeIterator iter(isolate, this, kStartAtReceiver, |
19432 PrototypeIterator::END_AT_NULL); | 19432 PrototypeIterator::END_AT_NULL); |
19433 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) { | 19433 !iter.IsAtEnd(); iter.AdvanceIgnoringProxies()) { |
19434 if (iter.GetCurrent<Object>()->IsJSProxy()) return true; | 19434 if (iter.GetCurrent<Object>()->IsJSProxy()) return true; |
19435 } | 19435 } |
19436 return false; | 19436 return false; |
19437 } | 19437 } |
19438 | 19438 |
19439 } // namespace internal | 19439 } // namespace internal |
19440 } // namespace v8 | 19440 } // namespace v8 |
OLD | NEW |