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

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

Issue 10828048: Avoid GC when printing shared function info. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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 | « src/objects-printer.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 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 "execution.h" 7 #include "execution.h"
8 #include "factory.h" 8 #include "factory.h"
9 #include "macro-assembler.h" 9 #include "macro-assembler.h"
10 #include "global-handles.h" 10 #include "global-handles.h"
(...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 } 1959 }
1960 CHECK(t->IsSlicedString()); 1960 CHECK(t->IsSlicedString());
1961 CHECK(!HEAP->InNewSpace(*t)); 1961 CHECK(!HEAP->InNewSpace(*t));
1962 *slice.location() = *t.location(); 1962 *slice.location() = *t.location();
1963 } 1963 }
1964 1964
1965 CHECK(SlicedString::cast(*slice)->parent()->IsSeqAsciiString()); 1965 CHECK(SlicedString::cast(*slice)->parent()->IsSeqAsciiString());
1966 HEAP->CollectAllGarbage(Heap::kNoGCFlags); 1966 HEAP->CollectAllGarbage(Heap::kNoGCFlags);
1967 CHECK(SlicedString::cast(*slice)->parent()->IsSeqAsciiString()); 1967 CHECK(SlicedString::cast(*slice)->parent()->IsSeqAsciiString());
1968 } 1968 }
1969
1970
1971 #ifdef OBJECT_PRINT
1972 TEST(PrintSharedFunctionInfo) {
1973 InitializeVM();
1974 v8::HandleScope scope;
1975 const char* source = "f = function() { return 987654321; }\n"
1976 "g = function() { return 123456789; }\n";
1977 CompileRun(source);
1978 Handle<String> g_symbol = FACTORY->LookupAsciiSymbol("g");
1979 JSFunction* g_func;
1980 MaybeObject* maybe_obj =
1981 Isolate::Current()->context()->global()->GetProperty(*g_symbol);
1982 CHECK(!maybe_obj->IsFailure());
1983 CHECK(maybe_obj->To<JSFunction>(&g_func));
Michael Starzinger 2012/07/27 09:50:27 Consider using the following to get to the "g" fun
1984
1985 AssertNoAllocation no_alloc;
1986 g_func->shared()->PrintLn();
1987 }
1988 #endif // OBJECT_PRINT
OLDNEW
« no previous file with comments | « src/objects-printer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698