Lines Matching refs:script
356 Foreign* foreign = Script::cast(wrapper->value())->wrapper();
366 Handle<JSValue> GetScriptWrapper(Handle<Script> script) {
367 if (script->wrapper()->foreign_address() != NULL) {
368 // Return the script wrapper directly from the cache.
370 reinterpret_cast<JSValue**>(script->wrapper()->foreign_address()));
373 // Construct a new script wrapper.
378 result->set_value(*script);
386 script->wrapper()->set_foreign_address(
392 // Init line_ends array with code positions of line ends inside script
394 void InitScriptLineEnds(Handle<Script> script) {
395 if (!script->line_ends()->IsUndefined()) return;
397 Isolate* isolate = script->GetIsolate();
399 if (!script->source()->IsString()) {
400 ASSERT(script->source()->IsUndefined());
402 script->set_line_ends(*empty);
403 ASSERT(script->line_ends()->IsFixedArray());
407 Handle<String> src(String::cast(script->source()), isolate);
415 script->set_line_ends(*array);
416 ASSERT(script->line_ends()->IsFixedArray());
479 int GetScriptLineNumber(Handle<Script> script, int code_pos) {
480 InitScriptLineEnds(script);
482 FixedArray* line_ends_array = FixedArray::cast(script->line_ends());
488 return script->line_offset()->value();
500 return right + script->line_offset()->value();
504 int GetScriptColumnNumber(Handle<Script> script, int code_pos) {
505 int line_number = GetScriptLineNumber(script, code_pos);
509 FixedArray* line_ends_array = FixedArray::cast(script->line_ends());
510 line_number = line_number - script->line_offset()->value();
511 if (line_number == 0) return code_pos + script->column_offset()->value();
517 int GetScriptLineNumberSafe(Handle<Script> script, int code_pos) {
519 if (!script->line_ends()->IsUndefined()) {
520 return GetScriptLineNumber(script, code_pos);
523 if (!script->source()->IsString()) {
526 String* source = String::cast(script->source());