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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 result); | 387 result); |
388 } | 388 } |
389 | 389 |
390 | 390 |
391 Handle<Object> GetScriptNameOrSourceURL(Handle<Script> script) { | 391 Handle<Object> GetScriptNameOrSourceURL(Handle<Script> script) { |
392 Isolate* isolate = script->GetIsolate(); | 392 Isolate* isolate = script->GetIsolate(); |
393 Handle<String> name_or_source_url_key = | 393 Handle<String> name_or_source_url_key = |
394 isolate->factory()->InternalizeOneByteString( | 394 isolate->factory()->InternalizeOneByteString( |
395 STATIC_ASCII_VECTOR("nameOrSourceURL")); | 395 STATIC_ASCII_VECTOR("nameOrSourceURL")); |
396 Handle<JSValue> script_wrapper = GetScriptWrapper(script); | 396 Handle<JSValue> script_wrapper = GetScriptWrapper(script); |
397 Handle<Object> property = Object::GetProperty( | 397 Handle<Object> property = |
398 script_wrapper, name_or_source_url_key).ToHandleChecked(); | 398 Object::GetProperty(script_wrapper, name_or_source_url_key); |
399 ASSERT(property->IsJSFunction()); | 399 ASSERT(property->IsJSFunction()); |
400 Handle<JSFunction> method = Handle<JSFunction>::cast(property); | 400 Handle<JSFunction> method = Handle<JSFunction>::cast(property); |
401 Handle<Object> result; | 401 Handle<Object> result; |
402 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 402 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
403 isolate, result, | 403 isolate, result, |
404 Execution::TryCall(method, script_wrapper, 0, NULL), | 404 Execution::TryCall(method, script_wrapper, 0, NULL), |
405 isolate->factory()->undefined_value()); | 405 isolate->factory()->undefined_value()); |
406 return result; | 406 return result; |
407 } | 407 } |
408 | 408 |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 Handle<Code> code) { | 694 Handle<Code> code) { |
695 heap->EnsureWeakObjectToCodeTable(); | 695 heap->EnsureWeakObjectToCodeTable(); |
696 Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(*object)); | 696 Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(*object)); |
697 dep = DependentCode::Insert(dep, DependentCode::kWeakCodeGroup, code); | 697 dep = DependentCode::Insert(dep, DependentCode::kWeakCodeGroup, code); |
698 CALL_HEAP_FUNCTION_VOID(heap->isolate(), | 698 CALL_HEAP_FUNCTION_VOID(heap->isolate(), |
699 heap->AddWeakObjectToCodeDependency(*object, *dep)); | 699 heap->AddWeakObjectToCodeDependency(*object, *dep)); |
700 } | 700 } |
701 | 701 |
702 | 702 |
703 } } // namespace v8::internal | 703 } } // namespace v8::internal |
OLD | NEW |