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 18 matching lines...) Expand all Loading... |
29 #include "src/heap-profiler.h" | 29 #include "src/heap-profiler.h" |
30 #include "src/heap-snapshot-generator-inl.h" | 30 #include "src/heap-snapshot-generator-inl.h" |
31 #include "src/icu_util.h" | 31 #include "src/icu_util.h" |
32 #include "src/json-parser.h" | 32 #include "src/json-parser.h" |
33 #include "src/messages.h" | 33 #include "src/messages.h" |
34 #include "src/natives.h" | 34 #include "src/natives.h" |
35 #include "src/parser.h" | 35 #include "src/parser.h" |
36 #include "src/profile-generator-inl.h" | 36 #include "src/profile-generator-inl.h" |
37 #include "src/property.h" | 37 #include "src/property.h" |
38 #include "src/property-details.h" | 38 #include "src/property-details.h" |
| 39 #include "src/prototype.h" |
39 #include "src/runtime.h" | 40 #include "src/runtime.h" |
40 #include "src/runtime-profiler.h" | 41 #include "src/runtime-profiler.h" |
41 #include "src/scanner-character-streams.h" | 42 #include "src/scanner-character-streams.h" |
42 #include "src/simulator.h" | 43 #include "src/simulator.h" |
43 #include "src/snapshot.h" | 44 #include "src/snapshot.h" |
44 #include "src/unicode-inl.h" | 45 #include "src/unicode-inl.h" |
45 #include "src/v8threads.h" | 46 #include "src/v8threads.h" |
46 #include "src/version.h" | 47 #include "src/version.h" |
47 #include "src/vm-state-inl.h" | 48 #include "src/vm-state-inl.h" |
48 | 49 |
(...skipping 3167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3216 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>()); | 3217 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>()); |
3217 return Utils::ToLocal(result); | 3218 return Utils::ToLocal(result); |
3218 } | 3219 } |
3219 | 3220 |
3220 | 3221 |
3221 Local<Value> v8::Object::GetPrototype() { | 3222 Local<Value> v8::Object::GetPrototype() { |
3222 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3223 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3223 ON_BAILOUT(isolate, "v8::Object::GetPrototype()", return Local<v8::Value>()); | 3224 ON_BAILOUT(isolate, "v8::Object::GetPrototype()", return Local<v8::Value>()); |
3224 ENTER_V8(isolate); | 3225 ENTER_V8(isolate); |
3225 i::Handle<i::Object> self = Utils::OpenHandle(this); | 3226 i::Handle<i::Object> self = Utils::OpenHandle(this); |
3226 i::Handle<i::Object> result(self->GetPrototype(isolate), isolate); | 3227 i::PrototypeIterator iter(isolate, self); |
3227 return Utils::ToLocal(result); | 3228 return Utils::ToLocal(i::PrototypeIterator::GetCurrent(iter)); |
3228 } | 3229 } |
3229 | 3230 |
3230 | 3231 |
3231 bool v8::Object::SetPrototype(Handle<Value> value) { | 3232 bool v8::Object::SetPrototype(Handle<Value> value) { |
3232 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3233 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3233 ON_BAILOUT(isolate, "v8::Object::SetPrototype()", return false); | 3234 ON_BAILOUT(isolate, "v8::Object::SetPrototype()", return false); |
3234 ENTER_V8(isolate); | 3235 ENTER_V8(isolate); |
3235 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3236 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
3236 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); | 3237 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); |
3237 // We do not allow exceptions thrown while setting the prototype | 3238 // We do not allow exceptions thrown while setting the prototype |
(...skipping 4423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7661 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7662 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7662 Address callback_address = | 7663 Address callback_address = |
7663 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7664 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7664 VMState<EXTERNAL> state(isolate); | 7665 VMState<EXTERNAL> state(isolate); |
7665 ExternalCallbackScope call_scope(isolate, callback_address); | 7666 ExternalCallbackScope call_scope(isolate, callback_address); |
7666 callback(info); | 7667 callback(info); |
7667 } | 7668 } |
7668 | 7669 |
7669 | 7670 |
7670 } } // namespace v8::internal | 7671 } } // namespace v8::internal |
OLD | NEW |