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

Unified Diff: src/objects.cc

Issue 1639743002: Simplify HandlerTable::LookupRange search. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index ee212453b8265485245a43db4c2a4b623c4434e2..7057e7b70350d3bf549d870dbdf37118988c533e 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -10951,10 +10951,11 @@ Handle<LiteralsArray> LiteralsArray::New(Isolate* isolate,
int HandlerTable::LookupRange(int pc_offset, int* stack_depth_out,
CatchPrediction* prediction_out) {
- int innermost_handler = -1, innermost_start = -1;
+ int innermost_handler = -1;
#ifdef DEBUG
// Assuming that ranges are well nested, we don't need to track the innermost
- // end offset. This is just to verify that the table is actually well nested.
+ // offsets. This is just to verify that the table is actually well nested.
+ int innermost_start = std::numeric_limits<int>::min();
int innermost_end = std::numeric_limits<int>::max();
#endif
for (int i = 0; i < length(); i += kRangeEntrySize) {
@@ -10965,11 +10966,11 @@ int HandlerTable::LookupRange(int pc_offset, int* stack_depth_out,
CatchPrediction prediction = HandlerPredictionField::decode(handler_field);
int stack_depth = Smi::cast(get(i + kRangeDepthIndex))->value();
if (pc_offset > start_offset && pc_offset <= end_offset) {
- if (start_offset < innermost_start) continue;
+ DCHECK_GE(start_offset, innermost_start);
DCHECK_LT(end_offset, innermost_end);
innermost_handler = handler_offset;
- innermost_start = start_offset;
#ifdef DEBUG
+ innermost_start = start_offset;
innermost_end = end_offset;
#endif
*stack_depth_out = stack_depth;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698