OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 370 |
371 static Object* CallJsBuiltin(const char* name, | 371 static Object* CallJsBuiltin(const char* name, |
372 BuiltinArguments<NO_EXTRA_ARGUMENTS> args) { | 372 BuiltinArguments<NO_EXTRA_ARGUMENTS> args) { |
373 HandleScope handleScope; | 373 HandleScope handleScope; |
374 | 374 |
375 Handle<Object> js_builtin = | 375 Handle<Object> js_builtin = |
376 GetProperty(Handle<JSObject>(Top::global_context()->builtins()), | 376 GetProperty(Handle<JSObject>(Top::global_context()->builtins()), |
377 name); | 377 name); |
378 ASSERT(js_builtin->IsJSFunction()); | 378 ASSERT(js_builtin->IsJSFunction()); |
379 Handle<JSFunction> function(Handle<JSFunction>::cast(js_builtin)); | 379 Handle<JSFunction> function(Handle<JSFunction>::cast(js_builtin)); |
380 Vector<Object**> argv(Vector<Object**>::New(args.length() - 1)); | 380 ScopedVector<Object**> argv(args.length() - 1); |
381 int n_args = args.length() - 1; | 381 int n_args = args.length() - 1; |
382 for (int i = 0; i < n_args; i++) { | 382 for (int i = 0; i < n_args; i++) { |
383 argv[i] = args.at<Object>(i + 1).location(); | 383 argv[i] = args.at<Object>(i + 1).location(); |
384 } | 384 } |
385 bool pending_exception = false; | 385 bool pending_exception = false; |
386 Handle<Object> result = Execution::Call(function, | 386 Handle<Object> result = Execution::Call(function, |
387 args.receiver(), | 387 args.receiver(), |
388 n_args, | 388 n_args, |
389 argv.start(), | 389 argv.start(), |
390 &pending_exception); | 390 &pending_exception); |
391 argv.Dispose(); | |
392 if (pending_exception) return Failure::Exception(); | 391 if (pending_exception) return Failure::Exception(); |
393 return *result; | 392 return *result; |
394 } | 393 } |
395 | 394 |
396 | 395 |
397 BUILTIN(ArrayPush) { | 396 BUILTIN(ArrayPush) { |
398 Object* receiver = *args.receiver(); | 397 Object* receiver = *args.receiver(); |
399 FixedArray* elms = NULL; | 398 FixedArray* elms = NULL; |
400 if (!IsJSArrayWithFastElements(receiver, &elms)) { | 399 if (!IsJSArrayWithFastElements(receiver, &elms)) { |
401 return CallJsBuiltin("ArrayPush", args); | 400 return CallJsBuiltin("ArrayPush", args); |
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1503 if (entry->contains(pc)) { | 1502 if (entry->contains(pc)) { |
1504 return names_[i]; | 1503 return names_[i]; |
1505 } | 1504 } |
1506 } | 1505 } |
1507 } | 1506 } |
1508 return NULL; | 1507 return NULL; |
1509 } | 1508 } |
1510 | 1509 |
1511 | 1510 |
1512 } } // namespace v8::internal | 1511 } } // namespace v8::internal |
OLD | NEW |