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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 result); | 395 result); |
396 } | 396 } |
397 | 397 |
398 | 398 |
399 Handle<Object> GetScriptNameOrSourceURL(Handle<Script> script) { | 399 Handle<Object> GetScriptNameOrSourceURL(Handle<Script> script) { |
400 Isolate* isolate = script->GetIsolate(); | 400 Isolate* isolate = script->GetIsolate(); |
401 Handle<String> name_or_source_url_key = | 401 Handle<String> name_or_source_url_key = |
402 isolate->factory()->InternalizeOneByteString( | 402 isolate->factory()->InternalizeOneByteString( |
403 STATIC_ASCII_VECTOR("nameOrSourceURL")); | 403 STATIC_ASCII_VECTOR("nameOrSourceURL")); |
404 Handle<JSValue> script_wrapper = GetScriptWrapper(script); | 404 Handle<JSValue> script_wrapper = GetScriptWrapper(script); |
405 Handle<Object> property = | 405 Handle<Object> property = Object::GetProperty( |
406 Object::GetProperty(script_wrapper, name_or_source_url_key); | 406 script_wrapper, name_or_source_url_key).ToHandleChecked(); |
407 ASSERT(property->IsJSFunction()); | 407 ASSERT(property->IsJSFunction()); |
408 Handle<JSFunction> method = Handle<JSFunction>::cast(property); | 408 Handle<JSFunction> method = Handle<JSFunction>::cast(property); |
409 bool caught_exception; | 409 bool caught_exception; |
410 Handle<Object> result = Execution::TryCall(method, script_wrapper, 0, | 410 Handle<Object> result = Execution::TryCall(method, script_wrapper, 0, |
411 NULL, &caught_exception); | 411 NULL, &caught_exception); |
412 if (caught_exception) { | 412 if (caught_exception) { |
413 result = isolate->factory()->undefined_value(); | 413 result = isolate->factory()->undefined_value(); |
414 } | 414 } |
415 return result; | 415 return result; |
416 } | 416 } |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 Handle<Code> code) { | 714 Handle<Code> code) { |
715 heap->EnsureWeakObjectToCodeTable(); | 715 heap->EnsureWeakObjectToCodeTable(); |
716 Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(*object)); | 716 Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(*object)); |
717 dep = DependentCode::Insert(dep, DependentCode::kWeaklyEmbeddedGroup, code); | 717 dep = DependentCode::Insert(dep, DependentCode::kWeaklyEmbeddedGroup, code); |
718 CALL_HEAP_FUNCTION_VOID(heap->isolate(), | 718 CALL_HEAP_FUNCTION_VOID(heap->isolate(), |
719 heap->AddWeakObjectToCodeDependency(*object, *dep)); | 719 heap->AddWeakObjectToCodeDependency(*object, *dep)); |
720 } | 720 } |
721 | 721 |
722 | 722 |
723 } } // namespace v8::internal | 723 } } // namespace v8::internal |
OLD | NEW |