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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "accessors.h" | 7 #include "accessors.h" |
8 #include "allocation-site-scopes.h" | 8 #include "allocation-site-scopes.h" |
9 #include "api.h" | 9 #include "api.h" |
10 #include "arguments.h" | 10 #include "arguments.h" |
(...skipping 1951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1962 if (object->map()->is_observed() && | 1962 if (object->map()->is_observed() && |
1963 *name != isolate->heap()->hidden_string()) { | 1963 *name != isolate->heap()->hidden_string()) { |
1964 Handle<Object> old_value = isolate->factory()->the_hole_value(); | 1964 Handle<Object> old_value = isolate->factory()->the_hole_value(); |
1965 EnqueueChangeRecord(object, "add", name, old_value); | 1965 EnqueueChangeRecord(object, "add", name, old_value); |
1966 } | 1966 } |
1967 | 1967 |
1968 return value; | 1968 return value; |
1969 } | 1969 } |
1970 | 1970 |
1971 | 1971 |
| 1972 Context* JSObject::GetCreationContext() { |
| 1973 Object* constructor = this->map()->constructor(); |
| 1974 JSFunction* function; |
| 1975 if (!constructor->IsJSFunction()) { |
| 1976 // Functions have null as a constructor, |
| 1977 // but any JSFunction knows its context immediately. |
| 1978 ASSERT(this->IsJSFunction()); |
| 1979 function = JSFunction::cast(this); |
| 1980 } else { |
| 1981 function = JSFunction::cast(constructor); |
| 1982 } |
| 1983 |
| 1984 return function->context()->native_context(); |
| 1985 } |
| 1986 |
| 1987 |
1972 void JSObject::EnqueueChangeRecord(Handle<JSObject> object, | 1988 void JSObject::EnqueueChangeRecord(Handle<JSObject> object, |
1973 const char* type_str, | 1989 const char* type_str, |
1974 Handle<Name> name, | 1990 Handle<Name> name, |
1975 Handle<Object> old_value) { | 1991 Handle<Object> old_value) { |
1976 Isolate* isolate = object->GetIsolate(); | 1992 Isolate* isolate = object->GetIsolate(); |
1977 HandleScope scope(isolate); | 1993 HandleScope scope(isolate); |
1978 Handle<String> type = isolate->factory()->InternalizeUtf8String(type_str); | 1994 Handle<String> type = isolate->factory()->InternalizeUtf8String(type_str); |
1979 if (object->IsJSGlobalObject()) { | 1995 if (object->IsJSGlobalObject()) { |
1980 object = handle(JSGlobalObject::cast(*object)->global_receiver(), isolate); | 1996 object = handle(JSGlobalObject::cast(*object)->global_receiver(), isolate); |
1981 } | 1997 } |
(...skipping 15238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17220 #define ERROR_MESSAGES_TEXTS(C, T) T, | 17236 #define ERROR_MESSAGES_TEXTS(C, T) T, |
17221 static const char* error_messages_[] = { | 17237 static const char* error_messages_[] = { |
17222 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 17238 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
17223 }; | 17239 }; |
17224 #undef ERROR_MESSAGES_TEXTS | 17240 #undef ERROR_MESSAGES_TEXTS |
17225 return error_messages_[reason]; | 17241 return error_messages_[reason]; |
17226 } | 17242 } |
17227 | 17243 |
17228 | 17244 |
17229 } } // namespace v8::internal | 17245 } } // namespace v8::internal |
OLD | NEW |