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

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

Issue 10861007: Rename JSGlobalProxy::context to native_context, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/mark-compact.cc ('k') | src/objects.h » ('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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 push(holder_reg); // Temporarily save holder on the stack. 373 push(holder_reg); // Temporarily save holder on the stack.
374 // Read the first word and compare to the native_context_map. 374 // Read the first word and compare to the native_context_map.
375 lw(holder_reg, FieldMemOperand(scratch, HeapObject::kMapOffset)); 375 lw(holder_reg, FieldMemOperand(scratch, HeapObject::kMapOffset));
376 LoadRoot(at, Heap::kNativeContextMapRootIndex); 376 LoadRoot(at, Heap::kNativeContextMapRootIndex);
377 Check(eq, "JSGlobalObject::native_context should be a native context.", 377 Check(eq, "JSGlobalObject::native_context should be a native context.",
378 holder_reg, Operand(at)); 378 holder_reg, Operand(at));
379 pop(holder_reg); // Restore holder. 379 pop(holder_reg); // Restore holder.
380 } 380 }
381 381
382 // Check if both contexts are the same. 382 // Check if both contexts are the same.
383 lw(at, FieldMemOperand(holder_reg, JSGlobalProxy::kContextOffset)); 383 lw(at, FieldMemOperand(holder_reg, JSGlobalProxy::kNativeContextOffset));
384 Branch(&same_contexts, eq, scratch, Operand(at)); 384 Branch(&same_contexts, eq, scratch, Operand(at));
385 385
386 // Check the context is a native context. 386 // Check the context is a native context.
387 if (emit_debug_code()) { 387 if (emit_debug_code()) {
388 // TODO(119): Avoid push(holder_reg)/pop(holder_reg). 388 // TODO(119): Avoid push(holder_reg)/pop(holder_reg).
389 push(holder_reg); // Temporarily save holder on the stack. 389 push(holder_reg); // Temporarily save holder on the stack.
390 mov(holder_reg, at); // Move at to its holding place. 390 mov(holder_reg, at); // Move at to its holding place.
391 LoadRoot(at, Heap::kNullValueRootIndex); 391 LoadRoot(at, Heap::kNullValueRootIndex);
392 Check(ne, "JSGlobalProxy::context() should not be null.", 392 Check(ne, "JSGlobalProxy::context() should not be null.",
393 holder_reg, Operand(at)); 393 holder_reg, Operand(at));
394 394
395 lw(holder_reg, FieldMemOperand(holder_reg, HeapObject::kMapOffset)); 395 lw(holder_reg, FieldMemOperand(holder_reg, HeapObject::kMapOffset));
396 LoadRoot(at, Heap::kNativeContextMapRootIndex); 396 LoadRoot(at, Heap::kNativeContextMapRootIndex);
397 Check(eq, "JSGlobalObject::native_context should be a native context.", 397 Check(eq, "JSGlobalObject::native_context should be a native context.",
398 holder_reg, Operand(at)); 398 holder_reg, Operand(at));
399 // Restore at is not needed. at is reloaded below. 399 // Restore at is not needed. at is reloaded below.
400 pop(holder_reg); // Restore holder. 400 pop(holder_reg); // Restore holder.
401 // Restore at to holder's context. 401 // Restore at to holder's context.
402 lw(at, FieldMemOperand(holder_reg, JSGlobalProxy::kContextOffset)); 402 lw(at, FieldMemOperand(holder_reg, JSGlobalProxy::kNativeContextOffset));
403 } 403 }
404 404
405 // Check that the security token in the calling global object is 405 // Check that the security token in the calling global object is
406 // compatible with the security token in the receiving global 406 // compatible with the security token in the receiving global
407 // object. 407 // object.
408 int token_offset = Context::kHeaderSize + 408 int token_offset = Context::kHeaderSize +
409 Context::SECURITY_TOKEN_INDEX * kPointerSize; 409 Context::SECURITY_TOKEN_INDEX * kPointerSize;
410 410
411 lw(scratch, FieldMemOperand(scratch, token_offset)); 411 lw(scratch, FieldMemOperand(scratch, token_offset));
412 lw(at, FieldMemOperand(at, token_offset)); 412 lw(at, FieldMemOperand(at, token_offset));
(...skipping 5052 matching lines...) Expand 10 before | Expand all | Expand 10 after
5465 opcode == BGTZL); 5465 opcode == BGTZL);
5466 opcode = (cond == eq) ? BEQ : BNE; 5466 opcode = (cond == eq) ? BEQ : BNE;
5467 instr = (instr & ~kOpcodeMask) | opcode; 5467 instr = (instr & ~kOpcodeMask) | opcode;
5468 masm_.emit(instr); 5468 masm_.emit(instr);
5469 } 5469 }
5470 5470
5471 5471
5472 } } // namespace v8::internal 5472 } } // namespace v8::internal
5473 5473
5474 #endif // V8_TARGET_ARCH_MIPS 5474 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698