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

Side by Side Diff: src/api.cc

Issue 11574031: Intel VTune integration for V8/D8 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 8 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
1843 { 1843 {
1844 i::HandleScope scope(isolate); 1844 i::HandleScope scope(isolate);
1845 i::Handle<i::SharedFunctionInfo> function_info = OpenScript(this); 1845 i::Handle<i::SharedFunctionInfo> function_info = OpenScript(this);
1846 i::Handle<i::Script> script(i::Script::cast(function_info->script())); 1846 i::Handle<i::Script> script(i::Script::cast(function_info->script()));
1847 i::Handle<i::Object> id(script->id(), isolate); 1847 i::Handle<i::Object> id(script->id(), isolate);
1848 raw_id = *id; 1848 raw_id = *id;
1849 } 1849 }
1850 i::Handle<i::Object> id(raw_id, isolate); 1850 i::Handle<i::Object> id(raw_id, isolate);
1851 return Utils::ToLocal(id); 1851 return Utils::ToLocal(id);
1852 } 1852 }
1853 1853
danno 2013/04/11 13:33:46 nit: two empty lines here
1854 int Script::GetLineNumber(int code_pos) {
1855 i::Isolate* isolate = i::Isolate::Current();
1856 ON_BAILOUT(isolate, "v8::Script::GetLineNumber()", return -1);
1857 LOG_API(isolate, "Script::GetLineNumber");
1858 i::Handle<i::Object> obj = Utils::OpenHandle(this);
1859 if (obj->IsScript()) {
1860 i::Handle<i::Script> script = i::Handle<i::Script>(i::Script::cast(*obj));
1861 return i::GetScriptLineNumber(script, code_pos);
1862 } else {
1863 return -1;
1864 }
1865 }
1866
danno 2013/04/11 13:33:46 nit: two empty lines here
1867 Handle<Value> Script::GetScriptName() {
1868 i::Isolate* isolate = i::Isolate::Current();
1869 ON_BAILOUT(isolate, "v8::Script::GetName()", return Handle<String>());
1870 LOG_API(isolate, "Script::GetName");
1871 i::Handle<i::Object> obj = Utils::OpenHandle(this);
1872 if (obj->IsScript()) {
1873 i::Object* name = i::Script::cast(*obj)->name();
1874 return Utils::ToLocal(i::Handle<i::Object>(name, isolate));
1875 } else {
1876 return Handle<String>();
1877 }
1878 }
1854 1879
danno 2013/04/11 13:33:46 nit: two empty lines here
1855 void Script::SetData(v8::Handle<String> data) { 1880 void Script::SetData(v8::Handle<String> data) {
1856 i::Isolate* isolate = i::Isolate::Current(); 1881 i::Isolate* isolate = i::Isolate::Current();
1857 ON_BAILOUT(isolate, "v8::Script::SetData()", return); 1882 ON_BAILOUT(isolate, "v8::Script::SetData()", return);
1858 LOG_API(isolate, "Script::SetData"); 1883 LOG_API(isolate, "Script::SetData");
1859 { 1884 {
1860 i::HandleScope scope(isolate); 1885 i::HandleScope scope(isolate);
1861 i::Handle<i::SharedFunctionInfo> function_info = OpenScript(this); 1886 i::Handle<i::SharedFunctionInfo> function_info = OpenScript(this);
1862 i::Handle<i::Object> raw_data = Utils::OpenHandle(*data); 1887 i::Handle<i::Object> raw_data = Utils::OpenHandle(*data);
1863 i::Handle<i::Script> script(i::Script::cast(function_info->script())); 1888 i::Handle<i::Script> script(i::Script::cast(function_info->script()));
1864 script->set_data(*raw_data); 1889 script->set_data(*raw_data);
(...skipping 5385 matching lines...) Expand 10 before | Expand all | Expand 10 after
7250 7275
7251 v->VisitPointers(blocks_.first(), first_block_limit_); 7276 v->VisitPointers(blocks_.first(), first_block_limit_);
7252 7277
7253 for (int i = 1; i < blocks_.length(); i++) { 7278 for (int i = 1; i < blocks_.length(); i++) {
7254 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); 7279 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
7255 } 7280 }
7256 } 7281 }
7257 7282
7258 7283
7259 } } // namespace v8::internal 7284 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/d8.cc » ('j') | src/third_party/vtune/v8vtune.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698