OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 | 107 |
108 const char* TraceExtension::kSource = | 108 const char* TraceExtension::kSource = |
109 "native function trace();" | 109 "native function trace();" |
110 "native function js_trace();" | 110 "native function js_trace();" |
111 "native function js_entry_sp();" | 111 "native function js_entry_sp();" |
112 "native function js_entry_sp_level2();"; | 112 "native function js_entry_sp_level2();"; |
113 | 113 |
114 v8::Handle<v8::FunctionTemplate> TraceExtension::GetNativeFunction( | 114 v8::Handle<v8::FunctionTemplate> TraceExtension::GetNativeFunction( |
115 v8::Handle<String> name) { | 115 v8::Handle<String> name) { |
116 if (name->Equals(String::New("trace"))) { | 116 if (name->Equals(String::NewFromUtf8(v8::Isolate::GetCurrent(), "trace"))) { |
117 return v8::FunctionTemplate::New(TraceExtension::Trace); | 117 return v8::FunctionTemplate::New(TraceExtension::Trace); |
118 } else if (name->Equals(String::New("js_trace"))) { | 118 } else if (name->Equals( |
| 119 String::NewFromUtf8(v8::Isolate::GetCurrent(), "js_trace"))) { |
119 return v8::FunctionTemplate::New(TraceExtension::JSTrace); | 120 return v8::FunctionTemplate::New(TraceExtension::JSTrace); |
120 } else if (name->Equals(String::New("js_entry_sp"))) { | 121 } else if (name->Equals(String::NewFromUtf8(v8::Isolate::GetCurrent(), |
| 122 "js_entry_sp"))) { |
121 return v8::FunctionTemplate::New(TraceExtension::JSEntrySP); | 123 return v8::FunctionTemplate::New(TraceExtension::JSEntrySP); |
122 } else if (name->Equals(String::New("js_entry_sp_level2"))) { | 124 } else if (name->Equals(String::NewFromUtf8(v8::Isolate::GetCurrent(), |
| 125 "js_entry_sp_level2"))) { |
123 return v8::FunctionTemplate::New(TraceExtension::JSEntrySPLevel2); | 126 return v8::FunctionTemplate::New(TraceExtension::JSEntrySPLevel2); |
124 } else { | 127 } else { |
125 CHECK(false); | 128 CHECK(false); |
126 return v8::Handle<v8::FunctionTemplate>(); | 129 return v8::Handle<v8::FunctionTemplate>(); |
127 } | 130 } |
128 } | 131 } |
129 | 132 |
130 | 133 |
131 Address TraceExtension::GetFP(const v8::FunctionCallbackInfo<v8::Value>& args) { | 134 Address TraceExtension::GetFP(const v8::FunctionCallbackInfo<v8::Value>& args) { |
132 // Convert frame pointer from encoding as smis in the arguments to a pointer. | 135 // Convert frame pointer from encoding as smis in the arguments to a pointer. |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 v8::Local<v8::Context> context = CcTest::NewContext(TRACE_EXTENSION); | 405 v8::Local<v8::Context> context = CcTest::NewContext(TRACE_EXTENSION); |
403 v8::Context::Scope context_scope(context); | 406 v8::Context::Scope context_scope(context); |
404 CHECK_EQ(0, GetJsEntrySp()); | 407 CHECK_EQ(0, GetJsEntrySp()); |
405 CompileRun("a = 1; b = a + 1;"); | 408 CompileRun("a = 1; b = a + 1;"); |
406 CHECK_EQ(0, GetJsEntrySp()); | 409 CHECK_EQ(0, GetJsEntrySp()); |
407 CompileRun("js_entry_sp();"); | 410 CompileRun("js_entry_sp();"); |
408 CHECK_EQ(0, GetJsEntrySp()); | 411 CHECK_EQ(0, GetJsEntrySp()); |
409 CompileRun("js_entry_sp_level2();"); | 412 CompileRun("js_entry_sp_level2();"); |
410 CHECK_EQ(0, GetJsEntrySp()); | 413 CHECK_EQ(0, GetJsEntrySp()); |
411 } | 414 } |
OLD | NEW |