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

Side by Side Diff: src/frames.cc

Issue 2534893002: [runtime] Simplify handler table lookup semantics. (Closed)
Patch Set: Rebased. Created 4 years 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/deoptimizer.cc ('k') | src/isolate.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/frames.h" 5 #include "src/frames.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1350 1350
1351 int InterpretedFrame::position() const { 1351 int InterpretedFrame::position() const {
1352 AbstractCode* code = AbstractCode::cast(GetBytecodeArray()); 1352 AbstractCode* code = AbstractCode::cast(GetBytecodeArray());
1353 int code_offset = GetBytecodeOffset(); 1353 int code_offset = GetBytecodeOffset();
1354 return code->SourcePosition(code_offset); 1354 return code->SourcePosition(code_offset);
1355 } 1355 }
1356 1356
1357 int InterpretedFrame::LookupExceptionHandlerInTable( 1357 int InterpretedFrame::LookupExceptionHandlerInTable(
1358 int* context_register, HandlerTable::CatchPrediction* prediction) { 1358 int* context_register, HandlerTable::CatchPrediction* prediction) {
1359 BytecodeArray* bytecode = function()->shared()->bytecode_array(); 1359 BytecodeArray* bytecode = function()->shared()->bytecode_array();
1360 return bytecode->LookupRangeInHandlerTable(GetBytecodeOffset(), 1360 HandlerTable* table = HandlerTable::cast(bytecode->handler_table());
1361 context_register, prediction); 1361 return table->LookupRange(GetBytecodeOffset(), context_register, prediction);
1362 } 1362 }
1363 1363
1364 int InterpretedFrame::GetBytecodeOffset() const { 1364 int InterpretedFrame::GetBytecodeOffset() const {
1365 const int index = InterpreterFrameConstants::kBytecodeOffsetExpressionIndex; 1365 const int index = InterpreterFrameConstants::kBytecodeOffsetExpressionIndex;
1366 DCHECK_EQ( 1366 DCHECK_EQ(
1367 InterpreterFrameConstants::kBytecodeOffsetFromFp, 1367 InterpreterFrameConstants::kBytecodeOffsetFromFp,
1368 InterpreterFrameConstants::kExpressionsOffset - index * kPointerSize); 1368 InterpreterFrameConstants::kExpressionsOffset - index * kPointerSize);
1369 int raw_offset = Smi::cast(GetExpression(index))->value(); 1369 int raw_offset = Smi::cast(GetExpression(index))->value();
1370 return raw_offset - BytecodeArray::kHeaderSize + kHeapObjectTag; 1370 return raw_offset - BytecodeArray::kHeaderSize + kHeapObjectTag;
1371 } 1371 }
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1981 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1982 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1982 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1983 list.Add(frame, zone); 1983 list.Add(frame, zone);
1984 } 1984 }
1985 return list.ToVector(); 1985 return list.ToVector();
1986 } 1986 }
1987 1987
1988 1988
1989 } // namespace internal 1989 } // namespace internal
1990 } // namespace v8 1990 } // namespace v8
OLDNEW
« no previous file with comments | « src/deoptimizer.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698