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

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

Issue 3410012: Merge r5467..r5469 into branches/2.3.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/2.3/
Patch Set: '' Created 10 years, 3 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 | « src/x64/frames-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-log-stack-tracer.cc
===================================================================
--- test/cctest/test-log-stack-tracer.cc (revision 5469)
+++ test/cctest/test-log-stack-tracer.cc (working copy)
@@ -175,21 +175,8 @@
}
-static Local<Value> GetGlobalProperty(const char* name) {
- return env->Global()->Get(String::New(name));
-}
-
-
-static Handle<JSFunction> GetGlobalJSFunction(const char* name) {
- Handle<JSFunction> result(JSFunction::cast(
- *v8::Utils::OpenHandle(*GetGlobalProperty(name))));
- return result;
-}
-
-
-static void CheckObjectIsJSFunction(const char* func_name,
- Address addr) {
- i::Object* obj = reinterpret_cast<i::Object*>(addr);
+static void CheckJSFunctionAtAddress(const char* func_name, Address addr) {
+ i::Object* obj = i::HeapObject::FromAddress(addr);
CHECK(obj->IsJSFunction());
CHECK(JSFunction::cast(obj)->shared()->name()->IsString());
i::SmartPointer<char> found_name =
@@ -264,7 +251,6 @@
#endif
SetGlobalProperty(func_name, v8::ToApi<Value>(func));
- CHECK_EQ(*func, *GetGlobalJSFunction(func_name));
}
@@ -298,13 +284,13 @@
// script [JS]
// JSTrace() [JS]
// JSFuncDoTrace() [JS] [captures EBP value and encodes it as Smi]
- // trace(EBP encoded as Smi) [native (extension)]
+ // trace(EBP) [native (extension)]
// DoTrace(EBP) [native]
// StackTracer::Trace
CHECK_GT(sample.frames_count, 1);
// Stack tracing will start from the first JS function, i.e. "JSFuncDoTrace"
- CheckObjectIsJSFunction("JSFuncDoTrace", sample.stack[0]);
- CheckObjectIsJSFunction("JSTrace", sample.stack[1]);
+ CheckJSFunctionAtAddress("JSFuncDoTrace", sample.stack[0]);
+ CheckJSFunctionAtAddress("JSTrace", sample.stack[1]);
}
@@ -342,19 +328,18 @@
// script [JS]
// OuterJSTrace() [JS]
// JSTrace() [JS]
- // JSFuncDoTrace() [JS] [captures EBP value and encodes it as Smi]
- // js_trace(EBP encoded as Smi) [native (extension)]
+ // JSFuncDoTrace() [JS]
+ // js_trace(EBP) [native (extension)]
// DoTraceHideCEntryFPAddress(EBP) [native]
// StackTracer::Trace
//
// The last JS function called. It is only visible through
// sample.function, as its return address is above captured EBP value.
- CHECK_EQ(GetGlobalJSFunction("JSFuncDoTrace")->address(),
- sample.function);
+ CheckJSFunctionAtAddress("JSFuncDoTrace", sample.function);
CHECK_GT(sample.frames_count, 1);
// Stack sampling will start from the caller of JSFuncDoTrace, i.e. "JSTrace"
- CheckObjectIsJSFunction("JSTrace", sample.stack[0]);
- CheckObjectIsJSFunction("OuterJSTrace", sample.stack[1]);
+ CheckJSFunctionAtAddress("JSTrace", sample.stack[0]);
+ CheckJSFunctionAtAddress("OuterJSTrace", sample.stack[1]);
}
« no previous file with comments | « src/x64/frames-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698