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

Side by Side Diff: src/x64/codegen-x64.cc

Issue 4654002: Move common static helpers from codegen to the macro-assembler files. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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 | Annotate | Revision Log
« no previous file with comments | « src/x64/codegen-x64.h ('k') | src/x64/full-codegen-x64.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 } 561 }
562 } 562 }
563 563
564 ASSERT(has_valid_frame()); 564 ASSERT(has_valid_frame());
565 ASSERT(frame_->height() == original_height + 1); 565 ASSERT(frame_->height() == original_height + 1);
566 } 566 }
567 567
568 568
569 void CodeGenerator::LoadGlobal() { 569 void CodeGenerator::LoadGlobal() {
570 if (in_spilled_code()) { 570 if (in_spilled_code()) {
571 frame_->EmitPush(GlobalObject()); 571 frame_->EmitPush(GlobalObjectOperand());
572 } else { 572 } else {
573 Result temp = allocator_->Allocate(); 573 Result temp = allocator_->Allocate();
574 __ movq(temp.reg(), GlobalObject()); 574 __ movq(temp.reg(), GlobalObjectOperand());
575 frame_->Push(&temp); 575 frame_->Push(&temp);
576 } 576 }
577 } 577 }
578 578
579 579
580 void CodeGenerator::LoadGlobalReceiver() { 580 void CodeGenerator::LoadGlobalReceiver() {
581 Result temp = allocator_->Allocate(); 581 Result temp = allocator_->Allocate();
582 Register reg = temp.reg(); 582 Register reg = temp.reg();
583 __ movq(reg, GlobalObject()); 583 __ movq(reg, GlobalObjectOperand());
584 __ movq(reg, FieldOperand(reg, GlobalObject::kGlobalReceiverOffset)); 584 __ movq(reg, FieldOperand(reg, GlobalObject::kGlobalReceiverOffset));
585 frame_->Push(&temp); 585 frame_->Push(&temp);
586 } 586 }
587 587
588 588
589 void CodeGenerator::LoadTypeofExpression(Expression* expr) { 589 void CodeGenerator::LoadTypeofExpression(Expression* expr) {
590 // Special handling of identifiers as subexpressions of typeof. 590 // Special handling of identifiers as subexpressions of typeof.
591 Variable* variable = expr->AsVariableProxy()->AsVariable(); 591 Variable* variable = expr->AsVariableProxy()->AsVariable();
592 if (variable != NULL && !variable->is_this() && variable->is_global()) { 592 if (variable != NULL && !variable->is_this() && variable->is_global()) {
593 // For a global variable we build the property reference 593 // For a global variable we build the property reference
(...skipping 5461 matching lines...) Expand 10 before | Expand all | Expand 10 after
6055 // prototype is the un-modified String prototype. If not result is false. 6055 // prototype is the un-modified String prototype. If not result is false.
6056 __ movq(scratch1_, FieldOperand(map_result_, Map::kPrototypeOffset)); 6056 __ movq(scratch1_, FieldOperand(map_result_, Map::kPrototypeOffset));
6057 __ testq(scratch1_, Immediate(kSmiTagMask)); 6057 __ testq(scratch1_, Immediate(kSmiTagMask));
6058 __ j(zero, &false_result); 6058 __ j(zero, &false_result);
6059 __ movq(scratch1_, FieldOperand(scratch1_, HeapObject::kMapOffset)); 6059 __ movq(scratch1_, FieldOperand(scratch1_, HeapObject::kMapOffset));
6060 __ movq(scratch2_, 6060 __ movq(scratch2_,
6061 Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX))); 6061 Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
6062 __ movq(scratch2_, 6062 __ movq(scratch2_,
6063 FieldOperand(scratch2_, GlobalObject::kGlobalContextOffset)); 6063 FieldOperand(scratch2_, GlobalObject::kGlobalContextOffset));
6064 __ cmpq(scratch1_, 6064 __ cmpq(scratch1_,
6065 CodeGenerator::ContextOperand( 6065 ContextOperand(
6066 scratch2_, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); 6066 scratch2_, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX));
6067 __ j(not_equal, &false_result); 6067 __ j(not_equal, &false_result);
6068 // Set the bit in the map to indicate that it has been checked safe for 6068 // Set the bit in the map to indicate that it has been checked safe for
6069 // default valueOf and set true result. 6069 // default valueOf and set true result.
6070 __ or_(FieldOperand(map_result_, Map::kBitField2Offset), 6070 __ or_(FieldOperand(map_result_, Map::kBitField2Offset),
6071 Immediate(1 << Map::kStringWrapperSafeForDefaultValueOf)); 6071 Immediate(1 << Map::kStringWrapperSafeForDefaultValueOf));
6072 __ Set(map_result_, 1); 6072 __ Set(map_result_, 1);
6073 __ jmp(exit_label()); 6073 __ jmp(exit_label());
6074 __ bind(&false_result); 6074 __ bind(&false_result);
6075 // Set false result. 6075 // Set false result.
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
7212 } 7212 }
7213 7213
7214 ZoneList<Expression*>* args = node->arguments(); 7214 ZoneList<Expression*>* args = node->arguments();
7215 Comment cmnt(masm_, "[ CallRuntime"); 7215 Comment cmnt(masm_, "[ CallRuntime");
7216 Runtime::Function* function = node->function(); 7216 Runtime::Function* function = node->function();
7217 7217
7218 if (function == NULL) { 7218 if (function == NULL) {
7219 // Push the builtins object found in the current global object. 7219 // Push the builtins object found in the current global object.
7220 Result temp = allocator()->Allocate(); 7220 Result temp = allocator()->Allocate();
7221 ASSERT(temp.is_valid()); 7221 ASSERT(temp.is_valid());
7222 __ movq(temp.reg(), GlobalObject()); 7222 __ movq(temp.reg(), GlobalObjectOperand());
7223 __ movq(temp.reg(), 7223 __ movq(temp.reg(),
7224 FieldOperand(temp.reg(), GlobalObject::kBuiltinsOffset)); 7224 FieldOperand(temp.reg(), GlobalObject::kBuiltinsOffset));
7225 frame_->Push(&temp); 7225 frame_->Push(&temp);
7226 } 7226 }
7227 7227
7228 // Push the arguments ("left-to-right"). 7228 // Push the arguments ("left-to-right").
7229 int arg_count = args->length(); 7229 int arg_count = args->length();
7230 for (int i = 0; i < arg_count; i++) { 7230 for (int i = 0; i < arg_count; i++) {
7231 Load(args->at(i)); 7231 Load(args->at(i));
7232 } 7232 }
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after
8856 #undef __ 8856 #undef __
8857 8857
8858 void RecordWriteStub::Generate(MacroAssembler* masm) { 8858 void RecordWriteStub::Generate(MacroAssembler* masm) {
8859 masm->RecordWriteHelper(object_, addr_, scratch_); 8859 masm->RecordWriteHelper(object_, addr_, scratch_);
8860 masm->ret(0); 8860 masm->ret(0);
8861 } 8861 }
8862 8862
8863 } } // namespace v8::internal 8863 } } // namespace v8::internal
8864 8864
8865 #endif // V8_TARGET_ARCH_X64 8865 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698