Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/objects.cc

Issue 1423723002: Map v8::Function to JSReceiver + IsCallable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/messages.cc ('k') | test/cctest/compiler/function-tester.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/messages.cc ('k') | test/cctest/compiler/function-tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698