Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/api.h" | 5 #include "src/api.h" |
| 6 | 6 |
| 7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
| 8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
| 9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
| 10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
| (...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1236 } | 1236 } |
| 1237 | 1237 |
| 1238 | 1238 |
| 1239 void FunctionTemplate::SetClassName(Handle<String> name) { | 1239 void FunctionTemplate::SetClassName(Handle<String> name) { |
| 1240 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 1240 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 1241 ENTER_V8(isolate); | 1241 ENTER_V8(isolate); |
| 1242 Utils::OpenHandle(this)->set_class_name(*Utils::OpenHandle(*name)); | 1242 Utils::OpenHandle(this)->set_class_name(*Utils::OpenHandle(*name)); |
| 1243 } | 1243 } |
| 1244 | 1244 |
| 1245 | 1245 |
| 1246 Local<String> FunctionTemplate::GetClassName() { | |
| 1247 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | |
| 1248 ENTER_V8(isolate); | |
| 1249 EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate)); | |
|
Yang
2014/07/09 11:41:50
Not sure whether we really need the handle scope t
aandrey
2014/07/09 11:46:24
Removed.
| |
| 1250 i::Handle<i::FunctionTemplateInfo> self = Utils::OpenHandle(this); | |
| 1251 i::Handle<i::Object> name(self->class_name(), isolate); | |
| 1252 if (name->IsString()) { | |
| 1253 return scope.Escape(Utils::ToLocal(i::Handle<i::String>::cast(name))); | |
| 1254 } else { | |
| 1255 return Local<String>(); | |
| 1256 } | |
| 1257 } | |
| 1258 | |
| 1259 | |
| 1246 void FunctionTemplate::SetHiddenPrototype(bool value) { | 1260 void FunctionTemplate::SetHiddenPrototype(bool value) { |
| 1247 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 1261 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 1248 ENTER_V8(isolate); | 1262 ENTER_V8(isolate); |
| 1249 Utils::OpenHandle(this)->set_hidden_prototype(value); | 1263 Utils::OpenHandle(this)->set_hidden_prototype(value); |
| 1250 } | 1264 } |
| 1251 | 1265 |
| 1252 | 1266 |
| 1253 void FunctionTemplate::ReadOnlyPrototype() { | 1267 void FunctionTemplate::ReadOnlyPrototype() { |
| 1254 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 1268 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
| 1255 ENTER_V8(isolate); | 1269 ENTER_V8(isolate); |
| (...skipping 6431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7687 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7701 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7688 Address callback_address = | 7702 Address callback_address = |
| 7689 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7703 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7690 VMState<EXTERNAL> state(isolate); | 7704 VMState<EXTERNAL> state(isolate); |
| 7691 ExternalCallbackScope call_scope(isolate, callback_address); | 7705 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7692 callback(info); | 7706 callback(info); |
| 7693 } | 7707 } |
| 7694 | 7708 |
| 7695 | 7709 |
| 7696 } } // namespace v8::internal | 7710 } } // namespace v8::internal |
| OLD | NEW |