| 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/ast.h" | 9 #include "src/ast.h" |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| 11 #include "src/base/utils/random-number-generator.h" | 11 #include "src/base/utils/random-number-generator.h" |
| 12 #include "src/bootstrapper.h" | 12 #include "src/bootstrapper.h" |
| 13 #include "src/codegen.h" | 13 #include "src/codegen.h" |
| 14 #include "src/compilation-cache.h" | 14 #include "src/compilation-cache.h" |
| 15 #include "src/cpu-profiler.h" | 15 #include "src/cpu-profiler.h" |
| 16 #include "src/debug.h" | 16 #include "src/debug.h" |
| 17 #include "src/deoptimizer.h" | 17 #include "src/deoptimizer.h" |
| 18 #include "src/heap-profiler.h" | 18 #include "src/heap-profiler.h" |
| 19 #include "src/hydrogen.h" | 19 #include "src/hydrogen.h" |
| 20 #include "src/isolate-inl.h" | 20 #include "src/isolate-inl.h" |
| 21 #include "src/lithium-allocator.h" | 21 #include "src/lithium-allocator.h" |
| 22 #include "src/log.h" | 22 #include "src/log.h" |
| 23 #include "src/messages.h" | 23 #include "src/messages.h" |
| 24 #include "src/prototype.h" |
| 24 #include "src/regexp-stack.h" | 25 #include "src/regexp-stack.h" |
| 25 #include "src/runtime-profiler.h" | 26 #include "src/runtime-profiler.h" |
| 26 #include "src/sampler.h" | 27 #include "src/sampler.h" |
| 27 #include "src/scopeinfo.h" | 28 #include "src/scopeinfo.h" |
| 28 #include "src/serialize.h" | 29 #include "src/serialize.h" |
| 29 #include "src/simulator.h" | 30 #include "src/simulator.h" |
| 30 #include "src/spaces.h" | 31 #include "src/spaces.h" |
| 31 #include "src/stub-cache.h" | 32 #include "src/stub-cache.h" |
| 32 #include "src/sweeper-thread.h" | 33 #include "src/sweeper-thread.h" |
| 33 #include "src/version.h" | 34 #include "src/version.h" |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 | 976 |
| 976 bool Isolate::IsErrorObject(Handle<Object> obj) { | 977 bool Isolate::IsErrorObject(Handle<Object> obj) { |
| 977 if (!obj->IsJSObject()) return false; | 978 if (!obj->IsJSObject()) return false; |
| 978 | 979 |
| 979 Handle<String> error_key = | 980 Handle<String> error_key = |
| 980 factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("$Error")); | 981 factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("$Error")); |
| 981 Handle<Object> error_constructor = Object::GetProperty( | 982 Handle<Object> error_constructor = Object::GetProperty( |
| 982 js_builtins_object(), error_key).ToHandleChecked(); | 983 js_builtins_object(), error_key).ToHandleChecked(); |
| 983 | 984 |
| 984 DisallowHeapAllocation no_gc; | 985 DisallowHeapAllocation no_gc; |
| 985 for (Object* prototype = *obj; !prototype->IsNull(); | 986 for (PrototypeIterator iter(this, *obj, PrototypeIterator::START_AT_RECEIVER); |
| 986 prototype = prototype->GetPrototype(this)) { | 987 !iter.IsAtEnd(); iter.Advance()) { |
| 987 if (!prototype->IsJSObject()) return false; | 988 if (iter.GetCurrent()->IsJSProxy()) return false; |
| 988 if (JSObject::cast(prototype)->map()->constructor() == | 989 if (JSObject::cast(iter.GetCurrent())->map()->constructor() == |
| 989 *error_constructor) { | 990 *error_constructor) { |
| 990 return true; | 991 return true; |
| 991 } | 992 } |
| 992 } | 993 } |
| 993 return false; | 994 return false; |
| 994 } | 995 } |
| 995 | 996 |
| 996 static int fatal_exception_depth = 0; | 997 static int fatal_exception_depth = 0; |
| 997 | 998 |
| 998 void Isolate::DoThrow(Object* exception, MessageLocation* location) { | 999 void Isolate::DoThrow(Object* exception, MessageLocation* location) { |
| (...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2348 if (prev_ && prev_->Intercept(flag)) return true; | 2349 if (prev_ && prev_->Intercept(flag)) return true; |
| 2349 // Then check whether this scope intercepts. | 2350 // Then check whether this scope intercepts. |
| 2350 if ((flag & intercept_mask_)) { | 2351 if ((flag & intercept_mask_)) { |
| 2351 intercepted_flags_ |= flag; | 2352 intercepted_flags_ |= flag; |
| 2352 return true; | 2353 return true; |
| 2353 } | 2354 } |
| 2354 return false; | 2355 return false; |
| 2355 } | 2356 } |
| 2356 | 2357 |
| 2357 } } // namespace v8::internal | 2358 } } // namespace v8::internal |
| OLD | NEW |