Lines Matching refs:Script
233 Foreign* foreign = Script::cast(wrapper->value())->wrapper();
243 Handle<JSValue> GetScriptWrapper(Handle<Script> script) {
244 if (script->wrapper()->foreign_address() != NULL) {
245 // Return a handle for the existing script wrapper from the cache.
247 *reinterpret_cast<JSValue**>(script->wrapper()->foreign_address()));
249 Isolate* isolate = script->GetIsolate();
250 // Construct a new script wrapper.
259 if (script->wrapper()->foreign_address() != NULL) {
261 *reinterpret_cast<JSValue**>(script->wrapper()->foreign_address()));
264 result->set_value(*script);
273 script->wrapper()->set_foreign_address(
279 // Init line_ends array with code positions of line ends inside script
281 void InitScriptLineEnds(Handle<Script> script) {
282 if (!script->line_ends()->IsUndefined()) return;
284 Isolate* isolate = script->GetIsolate();
286 if (!script->source()->IsString()) {
287 ASSERT(script->source()->IsUndefined());
289 script->set_line_ends(*empty);
290 ASSERT(script->line_ends()->IsFixedArray());
294 Handle<String> src(String::cast(script->source()), isolate);
302 script->set_line_ends(*array);
303 ASSERT(script->line_ends()->IsFixedArray());
366 int GetScriptLineNumber(Handle<Script> script, int code_pos) {
367 InitScriptLineEnds(script);
369 FixedArray* line_ends_array = FixedArray::cast(script->line_ends());
375 return script->line_offset()->value();
387 return right + script->line_offset()->value();
392 int GetScriptColumnNumber(Handle<Script> script, int code_pos) {
393 int line_number = GetScriptLineNumber(script, code_pos);
397 FixedArray* line_ends_array = FixedArray::cast(script->line_ends());
398 line_number = line_number - script->line_offset()->value();
399 if (line_number == 0) return code_pos + script->column_offset()->value();
406 int GetScriptLineNumberSafe(Handle<Script> script, int code_pos) {
408 if (!script->line_ends()->IsUndefined()) {
409 return GetScriptLineNumber(script, code_pos);
412 if (!script->source()->IsString()) {
415 String* source = String::cast(script->source());
477 Handle<Object> GetScriptNameOrSourceURL(Handle<Script> script) {
478 Isolate* isolate = script->GetIsolate();
482 Handle<JSValue> script_wrapper = GetScriptWrapper(script);