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

Side by Side Diff: test/cctest/interpreter/test-interpreter.cc

Issue 1615063002: [interpreter] Fix return address when entering exception handler. (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 unified diff | Download patch
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | no next file » | 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/execution.h" 7 #include "src/execution.h"
8 #include "src/handles.h" 8 #include "src/handles.h"
9 #include "src/interpreter/bytecode-array-builder.h" 9 #include "src/interpreter/bytecode-array-builder.h"
10 #include "src/interpreter/interpreter.h" 10 #include "src/interpreter/interpreter.h"
(...skipping 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after
2023 HandleAndZoneScope handles; 2023 HandleAndZoneScope handles;
2024 i::Isolate* isolate = handles.main_isolate(); 2024 i::Isolate* isolate = handles.main_isolate();
2025 2025
2026 std::pair<const char*, Handle<Object>> catches[] = { 2026 std::pair<const char*, Handle<Object>> catches[] = {
2027 std::make_pair("var a = 1; try { a = 2 } catch(e) { a = 3 }; return a;", 2027 std::make_pair("var a = 1; try { a = 2 } catch(e) { a = 3 }; return a;",
2028 handle(Smi::FromInt(2), isolate)), 2028 handle(Smi::FromInt(2), isolate)),
2029 std::make_pair("var a; try { undef.x } catch(e) { a = 2 }; return a;", 2029 std::make_pair("var a; try { undef.x } catch(e) { a = 2 }; return a;",
2030 handle(Smi::FromInt(2), isolate)), 2030 handle(Smi::FromInt(2), isolate)),
2031 std::make_pair("var a; try { throw 1 } catch(e) { a = e + 2 }; return a;", 2031 std::make_pair("var a; try { throw 1 } catch(e) { a = e + 2 }; return a;",
2032 handle(Smi::FromInt(3), isolate)), 2032 handle(Smi::FromInt(3), isolate)),
2033 std::make_pair("var a; try { throw 1 } catch(e) { a = e + 2 };"
2034 " try { throw a } catch(e) { a = e + 3 }; return a;",
2035 handle(Smi::FromInt(6), isolate)),
2033 }; 2036 };
2034 2037
2035 for (size_t i = 0; i < arraysize(catches); i++) { 2038 for (size_t i = 0; i < arraysize(catches); i++) {
2036 std::string source(InterpreterTester::SourceForBody(catches[i].first)); 2039 std::string source(InterpreterTester::SourceForBody(catches[i].first));
2037 InterpreterTester tester(handles.main_isolate(), source.c_str()); 2040 InterpreterTester tester(handles.main_isolate(), source.c_str());
2038 auto callable = tester.GetCallable<>(); 2041 auto callable = tester.GetCallable<>();
2039 2042
2040 Handle<i::Object> return_value = callable().ToHandleChecked(); 2043 Handle<i::Object> return_value = callable().ToHandleChecked();
2041 CHECK(return_value->SameValue(*catches[i].second)); 2044 CHECK(return_value->SameValue(*catches[i].second));
2042 } 2045 }
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after
3530 auto callable = tester.GetCallable<>(); 3533 auto callable = tester.GetCallable<>();
3531 3534
3532 Handle<i::Object> return_value = callable().ToHandleChecked(); 3535 Handle<i::Object> return_value = callable().ToHandleChecked();
3533 CHECK(return_value->SameValue(*eval_func_decl[i].second)); 3536 CHECK(return_value->SameValue(*eval_func_decl[i].second));
3534 } 3537 }
3535 } 3538 }
3536 3539
3537 } // namespace interpreter 3540 } // namespace interpreter
3538 } // namespace internal 3541 } // namespace internal
3539 } // namespace v8 3542 } // namespace v8
OLDNEW
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698