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 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1074 ASSERT(object->IsInstanceOf(type)); | 1074 ASSERT(object->IsInstanceOf(type)); |
1075 } | 1075 } |
1076 | 1076 |
1077 #endif | 1077 #endif |
1078 | 1078 |
1079 | 1079 |
1080 BUILTIN(FastHandleApiCall) { | 1080 BUILTIN(FastHandleApiCall) { |
1081 ASSERT(!CalledAsConstructor()); | 1081 ASSERT(!CalledAsConstructor()); |
1082 const bool is_construct = false; | 1082 const bool is_construct = false; |
1083 | 1083 |
1084 // We expect four more arguments: function, callback, call data, and holder. | 1084 // We expect four more arguments: callback, function, call data, and holder. |
1085 const int args_length = args.length() - 4; | 1085 const int args_length = args.length() - 4; |
1086 ASSERT(args_length >= 0); | 1086 ASSERT(args_length >= 0); |
1087 | 1087 |
1088 Handle<JSFunction> function = args.at<JSFunction>(args_length); | 1088 Object* callback_obj = args[args_length]; |
1089 Object* callback_obj = args[args_length + 1]; | |
1090 Handle<Object> data = args.at<Object>(args_length + 2); | |
1091 Handle<JSObject> checked_holder = args.at<JSObject>(args_length + 3); | |
1092 | |
1093 #ifdef DEBUG | |
1094 VerifyTypeCheck(checked_holder, function); | |
1095 #endif | |
1096 | |
1097 CustomArguments custom; | |
1098 v8::ImplementationUtilities::PrepareArgumentsData(custom.end(), | |
1099 *data, *function, *checked_holder); | |
1100 | 1089 |
1101 v8::Arguments new_args = v8::ImplementationUtilities::NewArguments( | 1090 v8::Arguments new_args = v8::ImplementationUtilities::NewArguments( |
1102 custom.end(), | 1091 &args[args_length + 1], |
1103 &args[0] - 1, | 1092 &args[0] - 1, |
1104 args_length - 1, | 1093 args_length - 1, |
1105 is_construct); | 1094 is_construct); |
1106 | 1095 |
1096 #ifdef DEBUG | |
1097 VerifyTypeCheck(Utils::OpenHandle(*new_args.Holder()), | |
1098 Utils::OpenHandle(*new_args.Callee())); | |
1099 #endif | |
SeRya
2010/11/18 15:36:32
Done. Actually it was a bug here (|function| was a
| |
1107 HandleScope scope; | 1100 HandleScope scope; |
1108 Object* result; | 1101 Object* result; |
1109 v8::Handle<v8::Value> value; | 1102 v8::Handle<v8::Value> value; |
1110 { | 1103 { |
1111 // Leaving JavaScript. | 1104 // Leaving JavaScript. |
1112 VMState state(EXTERNAL); | 1105 VMState state(EXTERNAL); |
1113 #ifdef ENABLE_LOGGING_AND_PROFILING | 1106 #ifdef ENABLE_LOGGING_AND_PROFILING |
1114 state.set_external_callback(v8::ToCData<Address>(callback_obj)); | 1107 state.set_external_callback(v8::ToCData<Address>(callback_obj)); |
1115 #endif | 1108 #endif |
1116 v8::InvocationCallback callback = | 1109 v8::InvocationCallback callback = |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1582 Code* entry = Code::cast(builtins_[i]); | 1575 Code* entry = Code::cast(builtins_[i]); |
1583 if (entry->contains(pc)) { | 1576 if (entry->contains(pc)) { |
1584 return names_[i]; | 1577 return names_[i]; |
1585 } | 1578 } |
1586 } | 1579 } |
1587 } | 1580 } |
1588 return NULL; | 1581 return NULL; |
1589 } | 1582 } |
1590 | 1583 |
1591 } } // namespace v8::internal | 1584 } } // namespace v8::internal |
OLD | NEW |