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

Unified Diff: test/cctest/test-log-stack-tracer.cc

Issue 4100005: Version 2.5.2 (Closed)
Patch Set: Created 10 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-log.cc ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-log-stack-tracer.cc
diff --git a/test/cctest/test-log-stack-tracer.cc b/test/cctest/test-log-stack-tracer.cc
index 7d7bd406bfc2c187216cc02d58f01da9f8b5e933..65be6bd85ef60fdee953776f30c5b947e98b61a9 100644
--- a/test/cctest/test-log-stack-tracer.cc
+++ b/test/cctest/test-log-stack-tracer.cc
@@ -199,13 +199,6 @@ static void InitializeVM() {
}
-static Handle<JSFunction> CompileFunction(const char* source) {
- Handle<JSFunction> result(JSFunction::cast(
- *v8::Utils::OpenHandle(*Script::Compile(String::New(source)))));
- return result;
-}
-
-
static void CheckJSFunctionAtAddress(const char* func_name, Address addr) {
i::Object* obj = i::HeapObject::FromAddress(addr);
CHECK(obj->IsJSFunction());
@@ -218,16 +211,6 @@ static void CheckJSFunctionAtAddress(const char* func_name, Address addr) {
}
-static void SetGlobalProperty(const char* name, Local<Value> value) {
- env->Global()->Set(String::New(name), value);
-}
-
-
-static Handle<v8::internal::String> NewString(const char* s) {
- return i::Factory::NewStringFromAscii(i::CStrVector(s));
-}
-
-
// This C++ function is called as a constructor, to grab the frame pointer
// from the calling function. When this function runs, the stack contains
// a C_Entry frame and a Construct frame above the calling function's frame.
@@ -273,25 +256,18 @@ static void CreateTraceCallerFunction(const char* func_name,
const char* trace_func_name) {
i::EmbeddedVector<char, 256> trace_call_buf;
i::OS::SNPrintF(trace_call_buf,
- "fp = new FPGrabber(); %s(fp.low_bits, fp.high_bits);",
- trace_func_name);
+ "function %s() {"
+ " fp = new FPGrabber();"
+ " %s(fp.low_bits, fp.high_bits);"
+ "}",
+ func_name, trace_func_name);
// Create the FPGrabber function, which grabs the caller's frame pointer
// when called as a constructor.
CreateFramePointerGrabberConstructor("FPGrabber");
// Compile the script.
- Handle<JSFunction> func = CompileFunction(trace_call_buf.start());
- CHECK(!func.is_null());
- func->shared()->set_name(*NewString(func_name));
-
-#ifdef DEBUG
- v8::internal::Code* func_code = func->code();
- CHECK(func_code->IsCode());
- func_code->Print();
-#endif
-
- SetGlobalProperty(func_name, v8::ToApi<Value>(func));
+ CompileRun(trace_call_buf.start());
}
« no previous file with comments | « test/cctest/test-log.cc ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698