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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 2448463002: [regexp] Remove unused code (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | src/full-codegen/full-codegen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index ea10da4e4a774838bef3c55db024fb170ab19a73..7182b6586c9f4a17af0bffc7b13373a80a4a4065 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -1844,67 +1844,6 @@ HValue* HGraphBuilder::BuildCreateIterResultObject(HValue* value,
}
-HValue* HGraphBuilder::BuildRegExpConstructResult(HValue* length,
- HValue* index,
- HValue* input) {
- NoObservableSideEffectsScope scope(this);
- HConstant* max_length = Add<HConstant>(JSArray::kInitialMaxFastElementArray);
- Add<HBoundsCheck>(length, max_length);
-
- // Generate size calculation code here in order to make it dominate
- // the JSRegExpResult allocation.
- ElementsKind elements_kind = FAST_ELEMENTS;
- HValue* size = BuildCalculateElementsSize(elements_kind, length);
-
- // Allocate the JSRegExpResult and the FixedArray in one step.
- HValue* result =
- Add<HAllocate>(Add<HConstant>(JSRegExpResult::kSize), HType::JSArray(),
- NOT_TENURED, JS_ARRAY_TYPE, graph()->GetConstant0());
-
- // Initialize the JSRegExpResult header.
- HValue* native_context = Add<HLoadNamedField>(
- context(), nullptr,
- HObjectAccess::ForContextSlot(Context::NATIVE_CONTEXT_INDEX));
- Add<HStoreNamedField>(
- result, HObjectAccess::ForMap(),
- Add<HLoadNamedField>(
- native_context, nullptr,
- HObjectAccess::ForContextSlot(Context::REGEXP_RESULT_MAP_INDEX)));
- HConstant* empty_fixed_array =
- Add<HConstant>(isolate()->factory()->empty_fixed_array());
- Add<HStoreNamedField>(
- result, HObjectAccess::ForJSArrayOffset(JSArray::kPropertiesOffset),
- empty_fixed_array);
- Add<HStoreNamedField>(
- result, HObjectAccess::ForJSArrayOffset(JSArray::kElementsOffset),
- empty_fixed_array);
- Add<HStoreNamedField>(
- result, HObjectAccess::ForJSArrayOffset(JSArray::kLengthOffset), length);
-
- // Initialize the additional fields.
- Add<HStoreNamedField>(
- result, HObjectAccess::ForJSArrayOffset(JSRegExpResult::kIndexOffset),
- index);
- Add<HStoreNamedField>(
- result, HObjectAccess::ForJSArrayOffset(JSRegExpResult::kInputOffset),
- input);
-
- // Allocate and initialize the elements header.
- HAllocate* elements = BuildAllocateElements(elements_kind, size);
- BuildInitializeElementsHeader(elements, elements_kind, length);
-
- Add<HStoreNamedField>(
- result, HObjectAccess::ForJSArrayOffset(JSArray::kElementsOffset),
- elements);
-
- // Initialize the elements contents with undefined.
- BuildFillElementsWithValue(
- elements, elements_kind, graph()->GetConstant0(), length,
- graph()->GetConstantUndefined());
-
- return result;
-}
-
HValue* HGraphBuilder::BuildNumberToString(HValue* object, AstType* type) {
NoObservableSideEffectsScope scope(this);
@@ -12168,40 +12107,6 @@ void HOptimizedGraphBuilder::GenerateRegExpExec(CallRuntime* call) {
}
-void HOptimizedGraphBuilder::GenerateRegExpFlags(CallRuntime* call) {
- DCHECK_EQ(1, call->arguments()->length());
- CHECK_ALIVE(VisitExpressions(call->arguments()));
- HValue* regexp = Pop();
- HInstruction* result =
- New<HLoadNamedField>(regexp, nullptr, HObjectAccess::ForJSRegExpFlags());
- return ast_context()->ReturnInstruction(result, call->id());
-}
-
-
-void HOptimizedGraphBuilder::GenerateRegExpSource(CallRuntime* call) {
- DCHECK_EQ(1, call->arguments()->length());
- CHECK_ALIVE(VisitExpressions(call->arguments()));
- HValue* regexp = Pop();
- HInstruction* result =
- New<HLoadNamedField>(regexp, nullptr, HObjectAccess::ForJSRegExpSource());
- return ast_context()->ReturnInstruction(result, call->id());
-}
-
-
-// Construct a RegExp exec result with two in-object properties.
-void HOptimizedGraphBuilder::GenerateRegExpConstructResult(CallRuntime* call) {
- DCHECK_EQ(3, call->arguments()->length());
- CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
- CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
- CHECK_ALIVE(VisitForValue(call->arguments()->at(2)));
- HValue* input = Pop();
- HValue* index = Pop();
- HValue* length = Pop();
- HValue* result = BuildRegExpConstructResult(length, index, input);
- return ast_context()->ReturnValue(result);
-}
-
-
// Fast support for number to string.
void HOptimizedGraphBuilder::GenerateNumberToString(CallRuntime* call) {
DCHECK_EQ(1, call->arguments()->length());
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | src/full-codegen/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698