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

Side by Side Diff: src/mips/macro-assembler-mips.cc

Issue 10832365: Rename Context::global to Context::global_object, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Michael's comments. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/mips/stub-cache-mips.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 355
356 // Load current lexical context from the stack frame. 356 // Load current lexical context from the stack frame.
357 lw(scratch, MemOperand(fp, StandardFrameConstants::kContextOffset)); 357 lw(scratch, MemOperand(fp, StandardFrameConstants::kContextOffset));
358 // In debug mode, make sure the lexical context is set. 358 // In debug mode, make sure the lexical context is set.
359 #ifdef DEBUG 359 #ifdef DEBUG
360 Check(ne, "we should not have an empty lexical context", 360 Check(ne, "we should not have an empty lexical context",
361 scratch, Operand(zero_reg)); 361 scratch, Operand(zero_reg));
362 #endif 362 #endif
363 363
364 // Load the native context of the current context. 364 // Load the native context of the current context.
365 int offset = Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; 365 int offset =
366 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize;
366 lw(scratch, FieldMemOperand(scratch, offset)); 367 lw(scratch, FieldMemOperand(scratch, offset));
367 lw(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); 368 lw(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset));
368 369
369 // Check the context is a native context. 370 // Check the context is a native context.
370 if (emit_debug_code()) { 371 if (emit_debug_code()) {
371 // TODO(119): Avoid push(holder_reg)/pop(holder_reg). 372 // TODO(119): Avoid push(holder_reg)/pop(holder_reg).
372 push(holder_reg); // Temporarily save holder on the stack. 373 push(holder_reg); // Temporarily save holder on the stack.
373 // Read the first word and compare to the native_context_map. 374 // Read the first word and compare to the native_context_map.
374 lw(holder_reg, FieldMemOperand(scratch, HeapObject::kMapOffset)); 375 lw(holder_reg, FieldMemOperand(scratch, HeapObject::kMapOffset));
375 LoadRoot(at, Heap::kNativeContextMapRootIndex); 376 LoadRoot(at, Heap::kNativeContextMapRootIndex);
(...skipping 3899 matching lines...) Expand 10 before | Expand all | Expand 10 after
4275 ASSERT(flag == JUMP_FUNCTION); 4276 ASSERT(flag == JUMP_FUNCTION);
4276 SetCallKind(t1, CALL_AS_METHOD); 4277 SetCallKind(t1, CALL_AS_METHOD);
4277 Jump(t9); 4278 Jump(t9);
4278 } 4279 }
4279 } 4280 }
4280 4281
4281 4282
4282 void MacroAssembler::GetBuiltinFunction(Register target, 4283 void MacroAssembler::GetBuiltinFunction(Register target,
4283 Builtins::JavaScript id) { 4284 Builtins::JavaScript id) {
4284 // Load the builtins object into target register. 4285 // Load the builtins object into target register.
4285 lw(target, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 4286 lw(target, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
4286 lw(target, FieldMemOperand(target, GlobalObject::kBuiltinsOffset)); 4287 lw(target, FieldMemOperand(target, GlobalObject::kBuiltinsOffset));
4287 // Load the JavaScript builtin function from the builtins object. 4288 // Load the JavaScript builtin function from the builtins object.
4288 lw(target, FieldMemOperand(target, 4289 lw(target, FieldMemOperand(target,
4289 JSBuiltinsObject::OffsetOfFunctionWithId(id))); 4290 JSBuiltinsObject::OffsetOfFunctionWithId(id)));
4290 } 4291 }
4291 4292
4292 4293
4293 void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { 4294 void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) {
4294 ASSERT(!target.is(a1)); 4295 ASSERT(!target.is(a1));
4295 GetBuiltinFunction(a1, id); 4296 GetBuiltinFunction(a1, id);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
4444 } 4445 }
4445 4446
4446 4447
4447 void MacroAssembler::LoadTransitionedArrayMapConditional( 4448 void MacroAssembler::LoadTransitionedArrayMapConditional(
4448 ElementsKind expected_kind, 4449 ElementsKind expected_kind,
4449 ElementsKind transitioned_kind, 4450 ElementsKind transitioned_kind,
4450 Register map_in_out, 4451 Register map_in_out,
4451 Register scratch, 4452 Register scratch,
4452 Label* no_map_match) { 4453 Label* no_map_match) {
4453 // Load the global or builtins object from the current context. 4454 // Load the global or builtins object from the current context.
4454 lw(scratch, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 4455 lw(scratch,
4456 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
4455 lw(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); 4457 lw(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset));
4456 4458
4457 // Check that the function's map is the same as the expected cached map. 4459 // Check that the function's map is the same as the expected cached map.
4458 lw(scratch, 4460 lw(scratch,
4459 MemOperand(scratch, 4461 MemOperand(scratch,
4460 Context::SlotOffset(Context::JS_ARRAY_MAPS_INDEX))); 4462 Context::SlotOffset(Context::JS_ARRAY_MAPS_INDEX)));
4461 size_t offset = expected_kind * kPointerSize + 4463 size_t offset = expected_kind * kPointerSize +
4462 FixedArrayBase::kHeaderSize; 4464 FixedArrayBase::kHeaderSize;
4463 lw(at, FieldMemOperand(scratch, offset)); 4465 lw(at, FieldMemOperand(scratch, offset));
4464 Branch(no_map_match, ne, map_in_out, Operand(at)); 4466 Branch(no_map_match, ne, map_in_out, Operand(at));
(...skipping 25 matching lines...) Expand all
4490 map_out, 4492 map_out,
4491 scratch, 4493 scratch,
4492 &done); 4494 &done);
4493 } 4495 }
4494 bind(&done); 4496 bind(&done);
4495 } 4497 }
4496 4498
4497 4499
4498 void MacroAssembler::LoadGlobalFunction(int index, Register function) { 4500 void MacroAssembler::LoadGlobalFunction(int index, Register function) {
4499 // Load the global or builtins object from the current context. 4501 // Load the global or builtins object from the current context.
4500 lw(function, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 4502 lw(function,
4503 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
4501 // Load the native context from the global or builtins object. 4504 // Load the native context from the global or builtins object.
4502 lw(function, FieldMemOperand(function, 4505 lw(function, FieldMemOperand(function,
4503 GlobalObject::kNativeContextOffset)); 4506 GlobalObject::kNativeContextOffset));
4504 // Load the function from the native context. 4507 // Load the function from the native context.
4505 lw(function, MemOperand(function, Context::SlotOffset(index))); 4508 lw(function, MemOperand(function, Context::SlotOffset(index)));
4506 } 4509 }
4507 4510
4508 4511
4509 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, 4512 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
4510 Register map, 4513 Register map,
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
5462 opcode == BGTZL); 5465 opcode == BGTZL);
5463 opcode = (cond == eq) ? BEQ : BNE; 5466 opcode = (cond == eq) ? BEQ : BNE;
5464 instr = (instr & ~kOpcodeMask) | opcode; 5467 instr = (instr & ~kOpcodeMask) | opcode;
5465 masm_.emit(instr); 5468 masm_.emit(instr);
5466 } 5469 }
5467 5470
5468 5471
5469 } } // namespace v8::internal 5472 } } // namespace v8::internal
5470 5473
5471 #endif // V8_TARGET_ARCH_MIPS 5474 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/mips/stub-cache-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698