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

Side by Side Diff: src/objects.cc

Issue 2394713003: [regexp] Port test, match, and search (Closed)
Patch Set: Rebase Created 4 years, 2 months 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
OLDNEW
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 16521 matching lines...) Expand 10 before | Expand all | Expand 10 after
16532 Object* constructor = map->GetConstructor(); 16532 Object* constructor = map->GetConstructor();
16533 if (constructor->IsJSFunction() && 16533 if (constructor->IsJSFunction() &&
16534 JSFunction::cast(constructor)->initial_map() == map) { 16534 JSFunction::cast(constructor)->initial_map() == map) {
16535 // If we still have the original map, set in-object properties directly. 16535 // If we still have the original map, set in-object properties directly.
16536 regexp->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex, 16536 regexp->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex,
16537 Smi::FromInt(0), SKIP_WRITE_BARRIER); 16537 Smi::FromInt(0), SKIP_WRITE_BARRIER);
16538 } else { 16538 } else {
16539 // Map has changed, so use generic, but slower, method. 16539 // Map has changed, so use generic, but slower, method.
16540 RETURN_ON_EXCEPTION( 16540 RETURN_ON_EXCEPTION(
16541 isolate, 16541 isolate,
16542 JSReceiver::SetProperty(regexp, factory->last_index_string(), 16542 JSReceiver::SetProperty(regexp, factory->lastIndex_string(),
16543 Handle<Smi>(Smi::FromInt(0), isolate), STRICT), 16543 Handle<Smi>(Smi::FromInt(0), isolate), STRICT),
16544 JSRegExp); 16544 JSRegExp);
16545 } 16545 }
16546 16546
16547 return regexp; 16547 return regexp;
16548 } 16548 }
16549 16549
16550 16550
16551 // RegExpKey carries the source and flags of a regular expression as key. 16551 // RegExpKey carries the source and flags of a regular expression as key.
16552 class RegExpKey : public HashTableKey { 16552 class RegExpKey : public HashTableKey {
(...skipping 3380 matching lines...) Expand 10 before | Expand all | Expand 10 after
19933 } 19933 }
19934 19934
19935 // Evaluation of module body. 19935 // Evaluation of module body.
19936 Handle<JSFunction> resume( 19936 Handle<JSFunction> resume(
19937 isolate->native_context()->generator_next_internal(), isolate); 19937 isolate->native_context()->generator_next_internal(), isolate);
19938 return Execution::Call(isolate, resume, generator, 0, nullptr); 19938 return Execution::Call(isolate, resume, generator, 0, nullptr);
19939 } 19939 }
19940 19940
19941 } // namespace internal 19941 } // namespace internal
19942 } // namespace v8 19942 } // namespace v8
OLDNEW
« src/builtins/builtins-regexp.cc ('K') | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698