OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 CHECK(code->contains(pc)); | 457 CHECK(code->contains(pc)); |
458 iter.Advance(); | 458 iter.Advance(); |
459 } | 459 } |
460 } | 460 } |
461 | 461 |
462 | 462 |
463 THREADED_TEST(StackIteration) { | 463 THREADED_TEST(StackIteration) { |
464 LocalContext env; | 464 LocalContext env; |
465 v8::HandleScope scope(env->GetIsolate()); | 465 v8::HandleScope scope(env->GetIsolate()); |
466 v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); | 466 v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); |
467 i::StringStream::ClearMentionedObjectCache(); | 467 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(env->GetIsolate()); |
| 468 i::StringStream::ClearMentionedObjectCache(isolate); |
468 obj->SetAccessor(v8_str("xxx"), StackCheck); | 469 obj->SetAccessor(v8_str("xxx"), StackCheck); |
469 env->Global()->Set(v8_str("obj"), obj->NewInstance()); | 470 env->Global()->Set(v8_str("obj"), obj->NewInstance()); |
470 Script::Compile(String::New( | 471 Script::Compile(String::New( |
471 "function foo() {" | 472 "function foo() {" |
472 " return obj.xxx;" | 473 " return obj.xxx;" |
473 "}" | 474 "}" |
474 "for (var i = 0; i < 100; i++) {" | 475 "for (var i = 0; i < 100; i++) {" |
475 " foo();" | 476 " foo();" |
476 "}"))->Run(); | 477 "}"))->Run(); |
477 } | 478 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 LocalContext env; | 521 LocalContext env; |
521 v8::HandleScope scope(env->GetIsolate()); | 522 v8::HandleScope scope(env->GetIsolate()); |
522 | 523 |
523 v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); | 524 v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); |
524 obj->SetNamedPropertyHandler( | 525 obj->SetNamedPropertyHandler( |
525 JSONStringifyGetter, NULL, NULL, NULL, JSONStringifyEnumerator); | 526 JSONStringifyGetter, NULL, NULL, NULL, JSONStringifyEnumerator); |
526 env->Global()->Set(v8_str("obj"), obj->NewInstance()); | 527 env->Global()->Set(v8_str("obj"), obj->NewInstance()); |
527 v8::Handle<v8::String> expected = v8_str("{\"regress\":\"crbug-161028\"}"); | 528 v8::Handle<v8::String> expected = v8_str("{\"regress\":\"crbug-161028\"}"); |
528 CHECK(CompileRun("JSON.stringify(obj)")->Equals(expected)); | 529 CHECK(CompileRun("JSON.stringify(obj)")->Equals(expected)); |
529 } | 530 } |
OLD | NEW |