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

Side by Side Diff: src/objects.cc

Issue 1633573002: [interpreter] Fix lookup of overlapping handler ranges. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_interpreter-remove-fallback
Patch Set: Rebased. Created 4 years, 11 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 | « no previous file | test/mjsunit/mjsunit.status » ('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 <sstream> 9 #include <sstream>
10 10
(...skipping 10934 matching lines...) Expand 10 before | Expand all | Expand 10 after
10945 number_of_literals + kFirstLiteralIndex, pretenure); 10945 number_of_literals + kFirstLiteralIndex, pretenure);
10946 Handle<LiteralsArray> casted_literals = Handle<LiteralsArray>::cast(literals); 10946 Handle<LiteralsArray> casted_literals = Handle<LiteralsArray>::cast(literals);
10947 casted_literals->set_feedback_vector(*vector); 10947 casted_literals->set_feedback_vector(*vector);
10948 return casted_literals; 10948 return casted_literals;
10949 } 10949 }
10950 10950
10951 10951
10952 int HandlerTable::LookupRange(int pc_offset, int* stack_depth_out, 10952 int HandlerTable::LookupRange(int pc_offset, int* stack_depth_out,
10953 CatchPrediction* prediction_out) { 10953 CatchPrediction* prediction_out) {
10954 int innermost_handler = -1, innermost_start = -1; 10954 int innermost_handler = -1, innermost_start = -1;
10955 #ifdef DEBUG
10956 // Assuming that ranges are well nested, we don't need to track the innermost
10957 // end offset. This is just to verify that the table is actually well nested.
10958 int innermost_end = std::numeric_limits<int>::max();
10959 #endif
10955 for (int i = 0; i < length(); i += kRangeEntrySize) { 10960 for (int i = 0; i < length(); i += kRangeEntrySize) {
10956 int start_offset = Smi::cast(get(i + kRangeStartIndex))->value(); 10961 int start_offset = Smi::cast(get(i + kRangeStartIndex))->value();
10957 int end_offset = Smi::cast(get(i + kRangeEndIndex))->value(); 10962 int end_offset = Smi::cast(get(i + kRangeEndIndex))->value();
10958 int handler_field = Smi::cast(get(i + kRangeHandlerIndex))->value(); 10963 int handler_field = Smi::cast(get(i + kRangeHandlerIndex))->value();
10959 int handler_offset = HandlerOffsetField::decode(handler_field); 10964 int handler_offset = HandlerOffsetField::decode(handler_field);
10960 CatchPrediction prediction = HandlerPredictionField::decode(handler_field); 10965 CatchPrediction prediction = HandlerPredictionField::decode(handler_field);
10961 int stack_depth = Smi::cast(get(i + kRangeDepthIndex))->value(); 10966 int stack_depth = Smi::cast(get(i + kRangeDepthIndex))->value();
10962 if (pc_offset > start_offset && pc_offset <= end_offset) { 10967 if (pc_offset > start_offset && pc_offset <= end_offset) {
10963 DCHECK_NE(start_offset, innermost_start);
10964 if (start_offset < innermost_start) continue; 10968 if (start_offset < innermost_start) continue;
10969 DCHECK_LT(end_offset, innermost_end);
10965 innermost_handler = handler_offset; 10970 innermost_handler = handler_offset;
10966 innermost_start = start_offset; 10971 innermost_start = start_offset;
10972 #ifdef DEBUG
10973 innermost_end = end_offset;
10974 #endif
10967 *stack_depth_out = stack_depth; 10975 *stack_depth_out = stack_depth;
10968 if (prediction_out) *prediction_out = prediction; 10976 if (prediction_out) *prediction_out = prediction;
10969 } 10977 }
10970 } 10978 }
10971 return innermost_handler; 10979 return innermost_handler;
10972 } 10980 }
10973 10981
10974 10982
10975 // TODO(turbofan): Make sure table is sorted and use binary search. 10983 // TODO(turbofan): Make sure table is sorted and use binary search.
10976 int HandlerTable::LookupReturn(int pc_offset, CatchPrediction* prediction_out) { 10984 int HandlerTable::LookupReturn(int pc_offset, CatchPrediction* prediction_out) {
(...skipping 8758 matching lines...) Expand 10 before | Expand all | Expand 10 after
19735 if (cell->value() != *new_value) { 19743 if (cell->value() != *new_value) {
19736 cell->set_value(*new_value); 19744 cell->set_value(*new_value);
19737 Isolate* isolate = cell->GetIsolate(); 19745 Isolate* isolate = cell->GetIsolate();
19738 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19746 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19739 isolate, DependentCode::kPropertyCellChangedGroup); 19747 isolate, DependentCode::kPropertyCellChangedGroup);
19740 } 19748 }
19741 } 19749 }
19742 19750
19743 } // namespace internal 19751 } // namespace internal
19744 } // namespace v8 19752 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698