OLD | NEW |
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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include "test/cctest/test-api.h" | 7 #include "test/cctest/test-api.h" |
8 | 8 |
9 #include "include/v8-util.h" | 9 #include "include/v8-util.h" |
10 #include "src/api.h" | 10 #include "src/api.h" |
(...skipping 2583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2594 } | 2594 } |
2595 | 2595 |
2596 | 2596 |
2597 // Test interceptor load/call IC where the interceptor throws an | 2597 // Test interceptor load/call IC where the interceptor throws an |
2598 // exception once in a while. | 2598 // exception once in a while. |
2599 THREADED_TEST(InterceptorICGetterExceptions) { | 2599 THREADED_TEST(InterceptorICGetterExceptions) { |
2600 interceptor_ic_exception_get_count = 0; | 2600 interceptor_ic_exception_get_count = 0; |
2601 v8::Isolate* isolate = CcTest::isolate(); | 2601 v8::Isolate* isolate = CcTest::isolate(); |
2602 v8::HandleScope scope(isolate); | 2602 v8::HandleScope scope(isolate); |
2603 v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(isolate); | 2603 v8::Handle<v8::ObjectTemplate> templ = ObjectTemplate::New(isolate); |
2604 // Generous limit for bootstrapping. | |
2605 templ->SetHandler( | 2604 templ->SetHandler( |
2606 v8::NamedPropertyHandlerConfiguration(InterceptorICExceptionGetter)); | 2605 v8::NamedPropertyHandlerConfiguration(InterceptorICExceptionGetter)); |
2607 is_bootstrapping = true; | 2606 is_bootstrapping = true; |
2608 LocalContext context(0, templ, v8::Handle<Value>()); | 2607 LocalContext context(0, templ, v8::Handle<Value>()); |
2609 is_bootstrapping = false; | 2608 is_bootstrapping = false; |
2610 call_ic_function3 = v8_compile("function h(x) { return x; }; h")->Run(); | 2609 call_ic_function3 = v8_compile("function h(x) { return x; }; h")->Run(); |
2611 v8::Handle<Value> value = CompileRun( | 2610 v8::Handle<Value> value = CompileRun( |
2612 "function f() {" | 2611 "function f() {" |
2613 " for (var i = 0; i < 100; i++) {" | 2612 " for (var i = 0; i < 100; i++) {" |
2614 " try { x; } catch(e) { return true; }" | 2613 " try { x; } catch(e) { return true; }" |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3316 "var obj = intercepted_1;" | 3315 "var obj = intercepted_1;" |
3317 "obj.x = 4;" | 3316 "obj.x = 4;" |
3318 "eval('obj.x');" | 3317 "eval('obj.x');" |
3319 "eval('obj.x');" | 3318 "eval('obj.x');" |
3320 "eval('obj.x');" | 3319 "eval('obj.x');" |
3321 "obj = intercepted_2;" | 3320 "obj = intercepted_2;" |
3322 "obj.x = 9;" | 3321 "obj.x = 9;" |
3323 "eval('obj.x');", | 3322 "eval('obj.x');", |
3324 9); | 3323 9); |
3325 } | 3324 } |
OLD | NEW |