Lines Matching defs:isolate
7 #include "src/execution/isolate.h"
18 Isolate* isolate, Handle<RegExpMatchInfo> match_info, int capture,
23 return isolate->factory()->empty_string();
30 return isolate->factory()->empty_string();
34 Handle<String> last_subject(match_info->LastSubject(), isolate);
35 return isolate->factory()->NewSubString(last_subject, match_start, match_end);
40 V8_INLINE bool HasInitialRegExpMap(Isolate* isolate, JSReceiver recv) {
41 return recv.map() == isolate->regexp_function()->initial_map();
46 MaybeHandle<Object> RegExpUtils::SetLastIndex(Isolate* isolate,
50 isolate->factory()->NewNumberFromInt64(value);
51 if (HasInitialRegExpMap(isolate, *recv)) {
57 isolate, recv, isolate->factory()->lastIndex_string(), value_as_object,
62 MaybeHandle<Object> RegExpUtils::GetLastIndex(Isolate* isolate,
64 if (HasInitialRegExpMap(isolate, *recv)) {
65 return handle(JSRegExp::cast(*recv).last_index(), isolate);
67 return Object::GetProperty(isolate, recv,
68 isolate->factory()->lastIndex_string());
75 MaybeHandle<Object> RegExpUtils::RegExpExec(Isolate* isolate,
79 if (exec->IsUndefined(isolate)) {
81 isolate, exec,
82 Object::GetProperty(isolate, regexp, isolate->factory()->exec_string()),
93 isolate, result,
94 Execution::Call(isolate, exec, regexp, argc, argv.begin()), Object);
96 if (!result->IsJSReceiver() && !result->IsNull(isolate)) {
97 THROW_NEW_ERROR(isolate,
105 THROW_NEW_ERROR(isolate,
107 isolate->factory()->NewStringFromAsciiChecked(
114 Handle<JSFunction> regexp_exec = isolate->regexp_exec_function();
120 return Execution::Call(isolate, regexp_exec, regexp, argc, argv.begin());
124 bool RegExpUtils::IsUnmodifiedRegExp(Isolate* isolate, Handle<Object> obj) {
126 if (isolate->force_slow_path()) return false;
133 if (!HasInitialRegExpMap(isolate, recv)) return false;
139 Handle<Map> initial_proto_initial_map = isolate->regexp_prototype_map();
149 DCHECK_EQ(*(isolate->factory()->exec_string()),
150 proto_map.instance_descriptors(isolate).GetKey(kExecIndex));
151 if (proto_map.instance_descriptors(isolate)
163 if (!Protectors::IsRegExpSpeciesLookupChainIntact(isolate)) return false;
190 Isolate* isolate, Handle<JSReceiver> regexp, Handle<String> string,
194 isolate, last_index_obj,
195 Object::GetProperty(isolate, regexp,
196 isolate->factory()->lastIndex_string()),
199 ASSIGN_RETURN_ON_EXCEPTION(isolate, last_index_obj,
200 Object::ToLength(isolate, last_index_obj), Object);
205 return SetLastIndex(isolate, regexp, new_last_index);