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

Side by Side Diff: src/frames.cc

Issue 3135026: Merge flush code phase into marking phase. (Closed)
Patch Set: returned checked casts Created 10 years, 4 months 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 | « src/frames.h ('k') | src/handles.cc » ('j') | no next file with comments »
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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 ASSERT(code->contains(pc())); 365 ASSERT(code->contains(pc()));
366 } 366 }
367 367
368 368
369 StackFrame::Type StackFrame::GetCallerState(State* state) const { 369 StackFrame::Type StackFrame::GetCallerState(State* state) const {
370 ComputeCallerState(state); 370 ComputeCallerState(state);
371 return ComputeType(state); 371 return ComputeType(state);
372 } 372 }
373 373
374 374
375 Code* EntryFrame::code() const { 375 Code* EntryFrame::unchecked_code() const {
376 return Heap::js_entry_code(); 376 return Heap::raw_unchecked_js_entry_code();
377 } 377 }
378 378
379 379
380 void EntryFrame::ComputeCallerState(State* state) const { 380 void EntryFrame::ComputeCallerState(State* state) const {
381 GetCallerState(state); 381 GetCallerState(state);
382 } 382 }
383 383
384 384
385 void EntryFrame::SetCallerFp(Address caller_fp) { 385 void EntryFrame::SetCallerFp(Address caller_fp) {
386 const int offset = EntryFrameConstants::kCallerFPOffset; 386 const int offset = EntryFrameConstants::kCallerFPOffset;
387 Memory::Address_at(this->fp() + offset) = caller_fp; 387 Memory::Address_at(this->fp() + offset) = caller_fp;
388 } 388 }
389 389
390 390
391 StackFrame::Type EntryFrame::GetCallerState(State* state) const { 391 StackFrame::Type EntryFrame::GetCallerState(State* state) const {
392 const int offset = EntryFrameConstants::kCallerFPOffset; 392 const int offset = EntryFrameConstants::kCallerFPOffset;
393 Address fp = Memory::Address_at(this->fp() + offset); 393 Address fp = Memory::Address_at(this->fp() + offset);
394 return ExitFrame::GetStateForFramePointer(fp, state); 394 return ExitFrame::GetStateForFramePointer(fp, state);
395 } 395 }
396 396
397 397
398 Code* EntryConstructFrame::code() const { 398 Code* EntryConstructFrame::unchecked_code() const {
399 return Heap::js_construct_entry_code(); 399 return Heap::raw_unchecked_js_construct_entry_code();
400 } 400 }
401 401
402 402
403 Object*& ExitFrame::code_slot() const { 403 Object*& ExitFrame::code_slot() const {
404 const int offset = ExitFrameConstants::kCodeOffset; 404 const int offset = ExitFrameConstants::kCodeOffset;
405 return Memory::Object_at(fp() + offset); 405 return Memory::Object_at(fp() + offset);
406 } 406 }
407 407
408 408
409 Code* ExitFrame::code() const { 409 Code* ExitFrame::unchecked_code() const {
410 return Code::cast(code_slot()); 410 return reinterpret_cast<Code*>(code_slot());
411 } 411 }
412 412
413 413
414 void ExitFrame::ComputeCallerState(State* state) const { 414 void ExitFrame::ComputeCallerState(State* state) const {
415 // Setup the caller state. 415 // Setup the caller state.
416 state->sp = caller_sp(); 416 state->sp = caller_sp();
417 state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset); 417 state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset);
418 state->pc_address 418 state->pc_address
419 = reinterpret_cast<Address*>(fp() + ExitFrameConstants::kCallerPCOffset); 419 = reinterpret_cast<Address*>(fp() + ExitFrameConstants::kCallerPCOffset);
420 } 420 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 bool JavaScriptFrame::IsConstructor() const { 486 bool JavaScriptFrame::IsConstructor() const {
487 Address fp = caller_fp(); 487 Address fp = caller_fp();
488 if (has_adapted_arguments()) { 488 if (has_adapted_arguments()) {
489 // Skip the arguments adaptor frame and look at the real caller. 489 // Skip the arguments adaptor frame and look at the real caller.
490 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); 490 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset);
491 } 491 }
492 return IsConstructFrame(fp); 492 return IsConstructFrame(fp);
493 } 493 }
494 494
495 495
496 Code* JavaScriptFrame::code() const { 496 Code* JavaScriptFrame::unchecked_code() const {
497 JSFunction* function = JSFunction::cast(this->function()); 497 JSFunction* function = JSFunction::cast(this->function());
498 return function->shared()->code(); 498 return function->unchecked_code();
499 } 499 }
500 500
501 501
502 Code* ArgumentsAdaptorFrame::code() const { 502 Code* ArgumentsAdaptorFrame::unchecked_code() const {
503 return Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline); 503 return Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline);
504 } 504 }
505 505
506 506
507 Code* InternalFrame::code() const { 507 Code* InternalFrame::unchecked_code() const {
508 const int offset = InternalFrameConstants::kCodeOffset; 508 const int offset = InternalFrameConstants::kCodeOffset;
509 Object* code = Memory::Object_at(fp() + offset); 509 Object* code = Memory::Object_at(fp() + offset);
510 ASSERT(code != NULL); 510 ASSERT(code != NULL);
511 return Code::cast(code); 511 return reinterpret_cast<Code*>(code);
512 } 512 }
513 513
514 514
515 void StackFrame::PrintIndex(StringStream* accumulator, 515 void StackFrame::PrintIndex(StringStream* accumulator,
516 PrintMode mode, 516 PrintMode mode,
517 int index) { 517 int index) {
518 accumulator->Add((mode == OVERVIEW) ? "%5d: " : "[%d]: ", index); 518 accumulator->Add((mode == OVERVIEW) ? "%5d: " : "[%d]: ", index);
519 } 519 }
520 520
521 521
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 ZoneList<StackFrame*> list(10); 817 ZoneList<StackFrame*> list(10);
818 for (StackFrameIterator it; !it.done(); it.Advance()) { 818 for (StackFrameIterator it; !it.done(); it.Advance()) {
819 StackFrame* frame = AllocateFrameCopy(it.frame()); 819 StackFrame* frame = AllocateFrameCopy(it.frame());
820 list.Add(frame); 820 list.Add(frame);
821 } 821 }
822 return list.ToVector(); 822 return list.ToVector();
823 } 823 }
824 824
825 825
826 } } // namespace v8::internal 826 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/frames.h ('k') | src/handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698