Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: src/builtins.cc

Issue 437004: Store API callback entry address prior to entering a callback. (Closed)
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/log.h » ('j') | src/log.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 holder, 373 holder,
374 callee, 374 callee,
375 is_construct, 375 is_construct,
376 reinterpret_cast<void**>(&args[0] - 1), 376 reinterpret_cast<void**>(&args[0] - 1),
377 args.length() - 1); 377 args.length() - 1);
378 378
379 v8::Handle<v8::Value> value; 379 v8::Handle<v8::Value> value;
380 { 380 {
381 // Leaving JavaScript. 381 // Leaving JavaScript.
382 VMState state(EXTERNAL); 382 VMState state(EXTERNAL);
383 #ifdef ENABLE_LOGGING_AND_PROFILING
384 state.set_external_callback(v8::ToCData<Address>(callback_obj));
385 #endif
383 value = callback(new_args); 386 value = callback(new_args);
384 } 387 }
385 if (value.IsEmpty()) { 388 if (value.IsEmpty()) {
386 result = Heap::undefined_value(); 389 result = Heap::undefined_value();
387 } else { 390 } else {
388 result = *reinterpret_cast<Object**>(*value); 391 result = *reinterpret_cast<Object**>(*value);
389 } 392 }
390 393
391 RETURN_IF_SCHEDULED_EXCEPTION(); 394 RETURN_IF_SCHEDULED_EXCEPTION();
392 if (!is_construct || result->IsJSObject()) return result; 395 if (!is_construct || result->IsJSObject()) return result;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 data, 442 data,
440 self, 443 self,
441 callee, 444 callee,
442 is_construct_call, 445 is_construct_call,
443 reinterpret_cast<void**>(&args[0] - 1), 446 reinterpret_cast<void**>(&args[0] - 1),
444 args.length() - 1); 447 args.length() - 1);
445 v8::Handle<v8::Value> value; 448 v8::Handle<v8::Value> value;
446 { 449 {
447 // Leaving JavaScript. 450 // Leaving JavaScript.
448 VMState state(EXTERNAL); 451 VMState state(EXTERNAL);
452 #ifdef ENABLE_LOGGING_AND_PROFILING
453 state.set_external_callback(v8::ToCData<Address>(callback_obj));
454 #endif
449 value = callback(new_args); 455 value = callback(new_args);
450 } 456 }
451 if (value.IsEmpty()) { 457 if (value.IsEmpty()) {
452 result = Heap::undefined_value(); 458 result = Heap::undefined_value();
453 } else { 459 } else {
454 result = *reinterpret_cast<Object**>(*value); 460 result = *reinterpret_cast<Object**>(*value);
455 } 461 }
456 } 462 }
457 // Check for exceptions and return result. 463 // Check for exceptions and return result.
458 RETURN_IF_SCHEDULED_EXCEPTION(); 464 RETURN_IF_SCHEDULED_EXCEPTION();
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 if (entry->contains(pc)) { 837 if (entry->contains(pc)) {
832 return names_[i]; 838 return names_[i];
833 } 839 }
834 } 840 }
835 } 841 }
836 return NULL; 842 return NULL;
837 } 843 }
838 844
839 845
840 } } // namespace v8::internal 846 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/log.h » ('j') | src/log.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698