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

Side by Side Diff: src/builtins/builtins-regexp.cc

Issue 2396353002: Revert "Add Smi::Zero and replace all Smi::FromInt(0) calls" (Closed)
Patch Set: 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/builtins/builtins-math.cc ('k') | src/builtins/builtins-string.cc » ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/builtins/builtins-utils.h" 5 #include "src/builtins/builtins-utils.h"
6 #include "src/builtins/builtins.h" 6 #include "src/builtins/builtins.h"
7 7
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/regexp/jsregexp.h" 9 #include "src/regexp/jsregexp.h"
10 10
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 typedef compiler::Node Node; 315 typedef compiler::Node Node;
316 316
317 Isolate* const isolate = a->isolate(); 317 Isolate* const isolate = a->isolate();
318 318
319 Node* const receiver = a->Parameter(0); 319 Node* const receiver = a->Parameter(0);
320 Node* const maybe_string = a->Parameter(1); 320 Node* const maybe_string = a->Parameter(1);
321 Node* const context = a->Parameter(4); 321 Node* const context = a->Parameter(4);
322 322
323 Node* const null = a->NullConstant(); 323 Node* const null = a->NullConstant();
324 Node* const int_zero = a->IntPtrConstant(0); 324 Node* const int_zero = a->IntPtrConstant(0);
325 Node* const smi_zero = a->SmiConstant(Smi::kZero); 325 Node* const smi_zero = a->SmiConstant(Smi::FromInt(0));
326 326
327 // Ensure {receiver} is a JSRegExp. 327 // Ensure {receiver} is a JSRegExp.
328 Node* const regexp_map = a->ThrowIfNotInstanceType( 328 Node* const regexp_map = a->ThrowIfNotInstanceType(
329 context, receiver, JS_REGEXP_TYPE, "RegExp.prototype.exec"); 329 context, receiver, JS_REGEXP_TYPE, "RegExp.prototype.exec");
330 Node* const regexp = receiver; 330 Node* const regexp = receiver;
331 331
332 // Check whether the regexp instance is unmodified. 332 // Check whether the regexp instance is unmodified.
333 Node* const native_context = a->LoadNativeContext(context); 333 Node* const native_context = a->LoadNativeContext(context);
334 Node* const regexp_fun = 334 Node* const regexp_fun =
335 a->LoadContextElement(native_context, Context::REGEXP_FUNCTION_INDEX); 335 a->LoadContextElement(native_context, Context::REGEXP_FUNCTION_INDEX);
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 BUILTIN(RegExpRightContextGetter) { 903 BUILTIN(RegExpRightContextGetter) {
904 HandleScope scope(isolate); 904 HandleScope scope(isolate);
905 const int start_index = GetLastMatchCapture(isolate, 1); 905 const int start_index = GetLastMatchCapture(isolate, 1);
906 Handle<String> last_subject = GetLastMatchSubject(isolate); 906 Handle<String> last_subject = GetLastMatchSubject(isolate);
907 const int len = last_subject->length(); 907 const int len = last_subject->length();
908 return *isolate->factory()->NewSubString(last_subject, start_index, len); 908 return *isolate->factory()->NewSubString(last_subject, start_index, len);
909 } 909 }
910 910
911 } // namespace internal 911 } // namespace internal
912 } // namespace v8 912 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-math.cc ('k') | src/builtins/builtins-string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698