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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = Object::GetProperty( |
398 script_wrapper, name_or_source_url_key).ToHandleChecked(); | 398 script_wrapper, name_or_source_url_key).ToHandleChecked(); |
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 // Do not check against pending exception, since this function may be called |
403 isolate, result, | 403 // when an exception has already been pending. |
404 Execution::TryCall(method, script_wrapper, 0, NULL), | 404 if (!Execution::TryCall(method, script_wrapper, 0, NULL).ToHandle(&result)) { |
405 isolate->factory()->undefined_value()); | 405 return isolate->factory()->undefined_value(); |
| 406 } |
406 return result; | 407 return result; |
407 } | 408 } |
408 | 409 |
409 | 410 |
410 static bool ContainsOnlyValidKeys(Handle<FixedArray> array) { | 411 static bool ContainsOnlyValidKeys(Handle<FixedArray> array) { |
411 int len = array->length(); | 412 int len = array->length(); |
412 for (int i = 0; i < len; i++) { | 413 for (int i = 0; i < len; i++) { |
413 Object* e = array->get(i); | 414 Object* e = array->get(i); |
414 if (!(e->IsString() || e->IsNumber())) return false; | 415 if (!(e->IsString() || e->IsNumber())) return false; |
415 } | 416 } |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 Handle<Code> code) { | 695 Handle<Code> code) { |
695 heap->EnsureWeakObjectToCodeTable(); | 696 heap->EnsureWeakObjectToCodeTable(); |
696 Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(*object)); | 697 Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(*object)); |
697 dep = DependentCode::Insert(dep, DependentCode::kWeakCodeGroup, code); | 698 dep = DependentCode::Insert(dep, DependentCode::kWeakCodeGroup, code); |
698 CALL_HEAP_FUNCTION_VOID(heap->isolate(), | 699 CALL_HEAP_FUNCTION_VOID(heap->isolate(), |
699 heap->AddWeakObjectToCodeDependency(*object, *dep)); | 700 heap->AddWeakObjectToCodeDependency(*object, *dep)); |
700 } | 701 } |
701 | 702 |
702 | 703 |
703 } } // namespace v8::internal | 704 } } // namespace v8::internal |
OLD | NEW |