Revision: 22393
Author: [email protected]
Date: Tue Jul 15 08:13:42 2014 UTC
Log: fix the vtune support bug.
During https://code.google.com/p/v8/source/detail?r=19925 checkin context
bound scripts (Script)
and context unbound scripts (UnboundScript) are Distinguished.
And then Sven Panne helped to fix the vtune support compilation
error in https://code.google.com/p/v8/source/detail?r=20955.
The problem is that there is runtime error for vtune
support.
In our original implementation, we encapsulated and passed
v8::internal::Script
to V8 API. It will leads to type check error for current V8::Script
definition.
So I changed the Handle<Script> definition in JitCodeEvent
to Handle<UnboundScript>
and add the corresponding change in log.cc.
If you do NOT prefer to change in include/v8.h. I think I can change the
definition of
CodeEventLogger::LogRecordedBuffer(...) so that the we can pass the correct
type (JSFunction) as V8::Script to V8 API.
BUG=
[email protected], [email protected]
Review URL: https://codereview.chromium.org/334263018
Patch from Chunyang Dai <[email protected]>.
http://code.google.com/p/v8/source/detail?r=22393
Modified:
/branches/bleeding_edge/include/v8.h
/branches/bleeding_edge/src/log.cc
/branches/bleeding_edge/src/third_party/vtune/vtune-jit.cc
=======================================
--- /branches/bleeding_edge/include/v8.h Mon Jul 14 14:52:24 2014 UTC
+++ /branches/bleeding_edge/include/v8.h Tue Jul 15 08:13:42 2014 UTC
@@ -4577,7 +4577,7 @@
// Size of the instructions.
size_t code_len;
// Script info for CODE_ADDED event.
- Handle<Script> script;
+ Handle<UnboundScript> script;
// User-defined data for *_LINE_INFO_* event. It's used to hold the
source
// code line information which is returned from the
// CODE_START_LINE_INFO_RECORDING event. And it's passed to subsequent
=======================================
--- /branches/bleeding_edge/src/log.cc Mon Jul 14 10:47:40 2014 UTC
+++ /branches/bleeding_edge/src/log.cc Tue Jul 15 08:13:42 2014 UTC
@@ -508,11 +508,11 @@
event.type = JitCodeEvent::CODE_ADDED;
event.code_start = code->instruction_start();
event.code_len = code->instruction_size();
- Handle<Script> script_handle;
+ Handle<SharedFunctionInfo> shared_function_handle;
if (shared && shared->script()->IsScript()) {
- script_handle = Handle<Script>(Script::cast(shared->script()));
+ shared_function_handle = Handle<SharedFunctionInfo>(shared);
}
- event.script = ToApiHandle<v8::Script>(script_handle);
+ event.script = ToApiHandle<v8::UnboundScript>(shared_function_handle);
event.name.str = name;
event.name.len = length;
code_event_handler_(&event);
=======================================
--- /branches/bleeding_edge/src/third_party/vtune/vtune-jit.cc Fri Apr 25
06:30:15 2014 UTC
+++ /branches/bleeding_edge/src/third_party/vtune/vtune-jit.cc Tue Jul 15
08:13:42 2014 UTC
@@ -192,13 +192,12 @@
jmethod.method_size = static_cast<unsigned int>(event->code_len);
jmethod.method_name = temp_method_name;
- Handle<Script> script = event->script;
+ Handle<UnboundScript> script = event->script;
if (*script != NULL) {
// Get the source file name and set it to
jmethod.source_file_name
- if ((*script->GetUnboundScript()->GetScriptName())->IsString()) {
- Handle<String> script_name =
- script->GetUnboundScript()->GetScriptName()->ToString();
+ if ((*script->GetScriptName())->IsString()) {
+ Handle<String> script_name =
script->GetScriptName()->ToString();
temp_file_name = new char[script_name->Utf8Length() + 1];
script_name->WriteUtf8(temp_file_name);
jmethod.source_file_name = temp_file_name;
@@ -225,7 +224,7 @@
jmethod.line_number_table[index].Offset =
static_cast<unsigned int>(Iter->pc_);
jmethod.line_number_table[index++].LineNumber =
- script->GetUnboundScript()->GetLineNumber(Iter->pos_)+1;
+ script->GetLineNumber(Iter->pos_) + 1;
}
GetEntries()->erase(event->code_start);
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.