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

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

Issue 11971015: Skip stack trace formatting in case the global object is already dead. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix leaks in the setter. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/cctest.status ('k') | test/mjsunit/mjsunit.status » ('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 2
3 #include <stdlib.h> 3 #include <stdlib.h>
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "compilation-cache.h" 7 #include "compilation-cache.h"
8 #include "execution.h" 8 #include "execution.h"
9 #include "factory.h" 9 #include "factory.h"
10 #include "macro-assembler.h" 10 #include "macro-assembler.h"
(...skipping 2676 matching lines...) Expand 10 before | Expand all | Expand 10 after
2687 #ifdef DEBUG 2687 #ifdef DEBUG
2688 FLAG_stop_at = "f"; 2688 FLAG_stop_at = "f";
2689 #endif 2689 #endif
2690 CompileRun("%OptimizeFunctionOnNextCall(g);" 2690 CompileRun("%OptimizeFunctionOnNextCall(g);"
2691 "g(false);"); 2691 "g(false);");
2692 2692
2693 // Finish garbage collection cycle. 2693 // Finish garbage collection cycle.
2694 HEAP->CollectAllGarbage(Heap::kNoGCFlags); 2694 HEAP->CollectAllGarbage(Heap::kNoGCFlags);
2695 CHECK(shared1->code()->gc_metadata() == NULL); 2695 CHECK(shared1->code()->gc_metadata() == NULL);
2696 } 2696 }
2697
2698
2699 static v8::Handle<v8::Array> Regress2500Enum(const v8::AccessorInfo& info) {
2700 CHECK(false); // Check that interceptor property names are not enumerated.
2701 return v8::Array::New();
2702 }
2703
2704
2705 TEST(Regress2500) {
2706 v8::HandleScope handle_scope;
2707 LocalContext context;
2708 v8::Context::Scope context_scope(context.local());
2709 // Create an object with interceptor to enumerate property names.
2710 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New();
2711 tmpl->SetNamedPropertyHandler(NULL, NULL, NULL, NULL, Regress2500Enum);
2712 context->Global()->Set(v8_str("obj"), tmpl->NewInstance());
2713 // Trigger an exception in an anonymous function with that object as receiver.
2714 // Keep the error object alive for deferred stack trace formatting after GC.
2715 CompileRun("try { "
2716 " (function () { FAIL }).call(object); "
2717 "} catch (e) { "
2718 " error = e; "
2719 "} ");
2720 HEAP->CollectAllAvailableGarbage("trigger deferred stack trace formatting.");
2721 }
OLDNEW
« no previous file with comments | « test/cctest/cctest.status ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698