OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 11965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11976 | 11976 |
11977 Handle<Object> Script::GetNameOrSourceURL(Handle<Script> script) { | 11977 Handle<Object> Script::GetNameOrSourceURL(Handle<Script> script) { |
11978 Isolate* isolate = script->GetIsolate(); | 11978 Isolate* isolate = script->GetIsolate(); |
11979 Handle<String> name_or_source_url_key = | 11979 Handle<String> name_or_source_url_key = |
11980 isolate->factory()->InternalizeOneByteString( | 11980 isolate->factory()->InternalizeOneByteString( |
11981 STATIC_CHAR_VECTOR("nameOrSourceURL")); | 11981 STATIC_CHAR_VECTOR("nameOrSourceURL")); |
11982 Handle<JSObject> script_wrapper = Script::GetWrapper(script); | 11982 Handle<JSObject> script_wrapper = Script::GetWrapper(script); |
11983 Handle<Object> property = Object::GetProperty( | 11983 Handle<Object> property = Object::GetProperty( |
11984 script_wrapper, name_or_source_url_key).ToHandleChecked(); | 11984 script_wrapper, name_or_source_url_key).ToHandleChecked(); |
11985 DCHECK(property->IsJSFunction()); | 11985 DCHECK(property->IsJSFunction()); |
11986 Handle<JSFunction> method = Handle<JSFunction>::cast(property); | |
11987 Handle<Object> result; | 11986 Handle<Object> result; |
11988 // Do not check against pending exception, since this function may be called | 11987 // Do not check against pending exception, since this function may be called |
11989 // when an exception has already been pending. | 11988 // when an exception has already been pending. |
11990 if (!Execution::TryCall(method, script_wrapper, 0, NULL).ToHandle(&result)) { | 11989 if (!Execution::TryCall(isolate, property, script_wrapper, 0, NULL) |
| 11990 .ToHandle(&result)) { |
11991 return isolate->factory()->undefined_value(); | 11991 return isolate->factory()->undefined_value(); |
11992 } | 11992 } |
11993 return result; | 11993 return result; |
11994 } | 11994 } |
11995 | 11995 |
11996 | 11996 |
11997 Handle<JSObject> Script::GetWrapper(Handle<Script> script) { | 11997 Handle<JSObject> Script::GetWrapper(Handle<Script> script) { |
11998 Isolate* isolate = script->GetIsolate(); | 11998 Isolate* isolate = script->GetIsolate(); |
11999 if (!script->wrapper()->IsUndefined()) { | 11999 if (!script->wrapper()->IsUndefined()) { |
12000 DCHECK(script->wrapper()->IsWeakCell()); | 12000 DCHECK(script->wrapper()->IsWeakCell()); |
(...skipping 5831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17832 if (cell->value() != *new_value) { | 17832 if (cell->value() != *new_value) { |
17833 cell->set_value(*new_value); | 17833 cell->set_value(*new_value); |
17834 Isolate* isolate = cell->GetIsolate(); | 17834 Isolate* isolate = cell->GetIsolate(); |
17835 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 17835 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
17836 isolate, DependentCode::kPropertyCellChangedGroup); | 17836 isolate, DependentCode::kPropertyCellChangedGroup); |
17837 } | 17837 } |
17838 } | 17838 } |
17839 | 17839 |
17840 } // namespace internal | 17840 } // namespace internal |
17841 } // namespace v8 | 17841 } // namespace v8 |
OLD | NEW |