OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 { | 67 { |
68 v8::HandleScope handleScope(m_isolate); | 68 v8::HandleScope handleScope(m_isolate); |
69 v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate); | 69 v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate); |
70 v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(callFrame->Ge
t(v8AtomicString(m_isolate, name))); | 70 v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(callFrame->Ge
t(v8AtomicString(m_isolate, name))); |
71 v8::Handle<v8::Value> result = func->Call(callFrame, 0, 0); | 71 v8::Handle<v8::Value> result = func->Call(callFrame, 0, 0); |
72 if (result->IsInt32()) | 72 if (result->IsInt32()) |
73 return result->Int32Value(); | 73 return result->Int32Value(); |
74 return 0; | 74 return 0; |
75 } | 75 } |
76 | 76 |
| 77 uint32_t JavaScriptCallFrame::callV8FunctionReturnUint32(const char* name) const |
| 78 { |
| 79 v8::HandleScope handleScope(m_isolate); |
| 80 v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate); |
| 81 v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(callFrame->Ge
t(v8AtomicString(m_isolate, name))); |
| 82 v8::Handle<v8::Value> result = func->Call(callFrame, 0, 0); |
| 83 if (result->IsUint32()) |
| 84 return result->Uint32Value(); |
| 85 return 0; |
| 86 } |
| 87 |
77 String JavaScriptCallFrame::callV8FunctionReturnString(const char* name) const | 88 String JavaScriptCallFrame::callV8FunctionReturnString(const char* name) const |
78 { | 89 { |
79 v8::HandleScope handleScope(m_isolate); | 90 v8::HandleScope handleScope(m_isolate); |
80 v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate); | 91 v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate); |
81 v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(callFrame->Ge
t(v8AtomicString(m_isolate, name))); | 92 v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(callFrame->Ge
t(v8AtomicString(m_isolate, name))); |
82 v8::Handle<v8::Value> result = func->Call(callFrame, 0, 0); | 93 v8::Handle<v8::Value> result = func->Call(callFrame, 0, 0); |
83 return toCoreStringWithUndefinedOrNullCheck(result); | 94 return toCoreStringWithUndefinedOrNullCheck(result); |
84 } | 95 } |
85 | 96 |
86 int JavaScriptCallFrame::sourceID() const | 97 int JavaScriptCallFrame::sourceID() const |
87 { | 98 { |
88 return callV8FunctionReturnInt("sourceID"); | 99 return callV8FunctionReturnInt("sourceID"); |
89 } | 100 } |
90 | 101 |
91 int JavaScriptCallFrame::line() const | 102 int JavaScriptCallFrame::line() const |
92 { | 103 { |
93 return callV8FunctionReturnInt("line"); | 104 return callV8FunctionReturnInt("line"); |
94 } | 105 } |
95 | 106 |
96 int JavaScriptCallFrame::column() const | 107 int JavaScriptCallFrame::column() const |
97 { | 108 { |
98 return callV8FunctionReturnInt("column"); | 109 return callV8FunctionReturnInt("column"); |
99 } | 110 } |
100 | 111 |
| 112 double JavaScriptCallFrame::framePointerHigh() const |
| 113 { |
| 114 return callV8FunctionReturnUint32("framePointerHigh"); |
| 115 } |
| 116 |
| 117 double JavaScriptCallFrame::framePointerLow() const |
| 118 { |
| 119 return callV8FunctionReturnUint32("framePointerLow"); |
| 120 } |
| 121 |
101 String JavaScriptCallFrame::functionName() const | 122 String JavaScriptCallFrame::functionName() const |
102 { | 123 { |
103 return callV8FunctionReturnString("functionName"); | 124 return callV8FunctionReturnString("functionName"); |
104 } | 125 } |
105 | 126 |
106 v8::Handle<v8::Value> JavaScriptCallFrame::scopeChain() const | 127 v8::Handle<v8::Value> JavaScriptCallFrame::scopeChain() const |
107 { | 128 { |
108 v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate); | 129 v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate); |
109 v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(callFrame->Ge
t(v8AtomicString(m_isolate, "scopeChain"))); | 130 v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(callFrame->Ge
t(v8AtomicString(m_isolate, "scopeChain"))); |
110 v8::Handle<v8::Array> scopeChain = v8::Handle<v8::Array>::Cast(func->Call(ca
llFrame, 0, 0)); | 131 v8::Handle<v8::Array> scopeChain = v8::Handle<v8::Array>::Cast(func->Call(ca
llFrame, 0, 0)); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 }; | 197 }; |
177 return ScriptValue(v8ScriptState, setVariableValueFunction->Call(callFrame,
WTF_ARRAY_LENGTH(argv), argv)); | 198 return ScriptValue(v8ScriptState, setVariableValueFunction->Call(callFrame,
WTF_ARRAY_LENGTH(argv), argv)); |
178 } | 199 } |
179 | 200 |
180 void JavaScriptCallFrame::trace(Visitor* visitor) | 201 void JavaScriptCallFrame::trace(Visitor* visitor) |
181 { | 202 { |
182 visitor->trace(m_caller); | 203 visitor->trace(m_caller); |
183 } | 204 } |
184 | 205 |
185 } // namespace WebCore | 206 } // namespace WebCore |
OLD | NEW |