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

Side by Side Diff: src/objects.cc

Issue 2415103002: [regexp] Turn last match info into a simple FixedArray (Closed)
Patch Set: Don't check instance type before map check 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
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.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 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 10292 matching lines...) Expand 10 before | Expand all | Expand 10 after
10303 } // namespace 10303 } // namespace
10304 10304
10305 Handle<ArrayList> ArrayList::EnsureSpace(Handle<ArrayList> array, int length) { 10305 Handle<ArrayList> ArrayList::EnsureSpace(Handle<ArrayList> array, int length) {
10306 const bool empty = (array->length() == 0); 10306 const bool empty = (array->length() == 0);
10307 auto ret = Handle<ArrayList>::cast( 10307 auto ret = Handle<ArrayList>::cast(
10308 EnsureSpaceInFixedArray(array, kFirstIndex + length)); 10308 EnsureSpaceInFixedArray(array, kFirstIndex + length));
10309 if (empty) ret->SetLength(0); 10309 if (empty) ret->SetLength(0);
10310 return ret; 10310 return ret;
10311 } 10311 }
10312 10312
10313 Handle<RegExpMatchInfo> RegExpMatchInfo::ReserveCaptures(
10314 Handle<RegExpMatchInfo> match_info, int capture_count) {
10315 DCHECK_GE(match_info->length(), kLastMatchOverhead);
10316 const int required_length = kFirstCaptureIndex + capture_count;
10317 Handle<FixedArray> result =
10318 EnsureSpaceInFixedArray(match_info, required_length);
10319 return Handle<RegExpMatchInfo>::cast(result);
10320 }
10321
10313 // static 10322 // static
10314 Handle<FrameArray> FrameArray::AppendJSFrame(Handle<FrameArray> in, 10323 Handle<FrameArray> FrameArray::AppendJSFrame(Handle<FrameArray> in,
10315 Handle<Object> receiver, 10324 Handle<Object> receiver,
10316 Handle<JSFunction> function, 10325 Handle<JSFunction> function,
10317 Handle<AbstractCode> code, 10326 Handle<AbstractCode> code,
10318 int offset, int flags) { 10327 int offset, int flags) {
10319 const int frame_count = in->FrameCount(); 10328 const int frame_count = in->FrameCount();
10320 const int new_length = LengthFor(frame_count + 1); 10329 const int new_length = LengthFor(frame_count + 1);
10321 Handle<FrameArray> array = EnsureSpace(in, new_length); 10330 Handle<FrameArray> array = EnsureSpace(in, new_length);
10322 array->SetReceiver(frame_count, *receiver); 10331 array->SetReceiver(frame_count, *receiver);
(...skipping 9864 matching lines...) Expand 10 before | Expand all | Expand 10 after
20187 ns, Accessors::ModuleNamespaceEntryInfo(isolate, name, attr)) 20196 ns, Accessors::ModuleNamespaceEntryInfo(isolate, name, attr))
20188 .Check(); 20197 .Check();
20189 } 20198 }
20190 JSObject::PreventExtensions(ns, THROW_ON_ERROR).ToChecked(); 20199 JSObject::PreventExtensions(ns, THROW_ON_ERROR).ToChecked();
20191 20200
20192 return ns; 20201 return ns;
20193 } 20202 }
20194 20203
20195 } // namespace internal 20204 } // namespace internal
20196 } // namespace v8 20205 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698