OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3186 "v8::GetIndexedPropertiesExternalArrayDataLength()", | 3186 "v8::GetIndexedPropertiesExternalArrayDataLength()", |
3187 return 0); | 3187 return 0); |
3188 if (self->HasExternalArrayElements()) { | 3188 if (self->HasExternalArrayElements()) { |
3189 return i::ExternalArray::cast(self->elements())->length(); | 3189 return i::ExternalArray::cast(self->elements())->length(); |
3190 } else { | 3190 } else { |
3191 return -1; | 3191 return -1; |
3192 } | 3192 } |
3193 } | 3193 } |
3194 | 3194 |
3195 | 3195 |
3196 Local<v8::Object> Object::NewInstance(int argc, | |
3197 v8::Handle<v8::Value> argv[]) const { | |
3198 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | |
3199 ON_BAILOUT(isolate, "v8::Object::NewInstance()", | |
3200 return Local<v8::Object>()); | |
3201 LOG_API(isolate, "Object::NewInstance"); | |
3202 ENTER_V8(isolate); | |
3203 HandleScope scope; | |
3204 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); | |
3205 STATIC_ASSERT(sizeof(v8::Handle<v8::Value>) == sizeof(i::Object**)); | |
3206 i::Object*** args = reinterpret_cast<i::Object***>(argv); | |
3207 EXCEPTION_PREAMBLE(isolate); | |
3208 i::Handle<i::Object> returned; | |
3209 if (obj->IsJSFunction()) { | |
3210 i::Handle<i::JSFunction> function = i::Handle<i::JSFunction>::cast(obj); | |
3211 returned = i::Execution::New(function, argc, args, &has_pending_exception); | |
3212 } else { | |
3213 i::Handle<i::JSFunction> delegate = | |
3214 i::Handle<i::JSFunction>::cast(i::Execution::GetConstructorDelegate(obj)); | |
Mads Ager (chromium)
2011/04/28 12:14:42
Use four space indent here.
| |
3215 returned = | |
3216 i::Execution::Call(delegate, obj, argc, args, &has_pending_exception); | |
Mads Ager (chromium)
2011/04/28 12:14:42
four space indent instead of two
| |
3217 } | |
3218 EXCEPTION_BAILOUT_CHECK(isolate, Local<v8::Object>()); | |
3219 return scope.Close(Utils::ToLocal(i::Handle<i::JSObject>::cast(returned))); | |
3220 } | |
3221 | |
3222 | |
3196 Local<v8::Object> Function::NewInstance() const { | 3223 Local<v8::Object> Function::NewInstance() const { |
3197 return NewInstance(0, NULL); | 3224 return NewInstance(0, NULL); |
3198 } | 3225 } |
3199 | 3226 |
3200 | 3227 |
3201 Local<v8::Object> Function::NewInstance(int argc, | 3228 Local<v8::Object> Function::NewInstance(int argc, |
3202 v8::Handle<v8::Value> argv[]) const { | 3229 v8::Handle<v8::Value> argv[]) const { |
3203 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3230 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3204 ON_BAILOUT(isolate, "v8::Function::NewInstance()", | 3231 ON_BAILOUT(isolate, "v8::Function::NewInstance()", |
3205 return Local<v8::Object>()); | 3232 return Local<v8::Object>()); |
(...skipping 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5685 | 5712 |
5686 | 5713 |
5687 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 5714 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
5688 HandleScopeImplementer* scope_implementer = | 5715 HandleScopeImplementer* scope_implementer = |
5689 reinterpret_cast<HandleScopeImplementer*>(storage); | 5716 reinterpret_cast<HandleScopeImplementer*>(storage); |
5690 scope_implementer->IterateThis(v); | 5717 scope_implementer->IterateThis(v); |
5691 return storage + ArchiveSpacePerThread(); | 5718 return storage + ArchiveSpacePerThread(); |
5692 } | 5719 } |
5693 | 5720 |
5694 } } // namespace v8::internal | 5721 } } // namespace v8::internal |
OLD | NEW |