OLD | NEW |
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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 // Accessors::ScriptGetLineEnds | 517 // Accessors::ScriptGetLineEnds |
518 // | 518 // |
519 | 519 |
520 | 520 |
521 MaybeObject* Accessors::ScriptGetLineEnds(Isolate* isolate, | 521 MaybeObject* Accessors::ScriptGetLineEnds(Isolate* isolate, |
522 Object* object, | 522 Object* object, |
523 void*) { | 523 void*) { |
524 JSValue* wrapper = JSValue::cast(object); | 524 JSValue* wrapper = JSValue::cast(object); |
525 HandleScope scope(isolate); | 525 HandleScope scope(isolate); |
526 Handle<Script> script(Script::cast(wrapper->value()), isolate); | 526 Handle<Script> script(Script::cast(wrapper->value()), isolate); |
527 Script::InitLineEnds(script); | 527 InitScriptLineEnds(script); |
528 ASSERT(script->line_ends()->IsFixedArray()); | 528 ASSERT(script->line_ends()->IsFixedArray()); |
529 Handle<FixedArray> line_ends(FixedArray::cast(script->line_ends())); | 529 Handle<FixedArray> line_ends(FixedArray::cast(script->line_ends())); |
530 // We do not want anyone to modify this array from JS. | 530 // We do not want anyone to modify this array from JS. |
531 ASSERT(*line_ends == isolate->heap()->empty_fixed_array() || | 531 ASSERT(*line_ends == isolate->heap()->empty_fixed_array() || |
532 line_ends->map() == isolate->heap()->fixed_cow_array_map()); | 532 line_ends->map() == isolate->heap()->fixed_cow_array_map()); |
533 Handle<JSArray> js_array = | 533 Handle<JSArray> js_array = |
534 isolate->factory()->NewJSArrayWithElements(line_ends); | 534 isolate->factory()->NewJSArrayWithElements(line_ends); |
535 return *js_array; | 535 return *js_array; |
536 } | 536 } |
537 | 537 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 MaybeObject* Accessors::ScriptGetEvalFromScript(Isolate* isolate, | 571 MaybeObject* Accessors::ScriptGetEvalFromScript(Isolate* isolate, |
572 Object* object, | 572 Object* object, |
573 void*) { | 573 void*) { |
574 Object* script = JSValue::cast(object)->value(); | 574 Object* script = JSValue::cast(object)->value(); |
575 if (!Script::cast(script)->eval_from_shared()->IsUndefined()) { | 575 if (!Script::cast(script)->eval_from_shared()->IsUndefined()) { |
576 Handle<SharedFunctionInfo> eval_from_shared( | 576 Handle<SharedFunctionInfo> eval_from_shared( |
577 SharedFunctionInfo::cast(Script::cast(script)->eval_from_shared())); | 577 SharedFunctionInfo::cast(Script::cast(script)->eval_from_shared())); |
578 | 578 |
579 if (eval_from_shared->script()->IsScript()) { | 579 if (eval_from_shared->script()->IsScript()) { |
580 Handle<Script> eval_from_script(Script::cast(eval_from_shared->script())); | 580 Handle<Script> eval_from_script(Script::cast(eval_from_shared->script())); |
581 return *Script::GetWrapper(eval_from_script); | 581 return *GetScriptWrapper(eval_from_script); |
582 } | 582 } |
583 } | 583 } |
584 return isolate->heap()->undefined_value(); | 584 return isolate->heap()->undefined_value(); |
585 } | 585 } |
586 | 586 |
587 | 587 |
588 const AccessorDescriptor Accessors::ScriptEvalFromScript = { | 588 const AccessorDescriptor Accessors::ScriptEvalFromScript = { |
589 ScriptGetEvalFromScript, | 589 ScriptGetEvalFromScript, |
590 IllegalSetter, | 590 IllegalSetter, |
591 0 | 591 0 |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 info->set_data(Smi::FromInt(index)); | 1090 info->set_data(Smi::FromInt(index)); |
1091 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1091 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
1092 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1092 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
1093 info->set_getter(*getter); | 1093 info->set_getter(*getter); |
1094 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1094 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
1095 return info; | 1095 return info; |
1096 } | 1096 } |
1097 | 1097 |
1098 | 1098 |
1099 } } // namespace v8::internal | 1099 } } // namespace v8::internal |
OLD | NEW |