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

Side by Side Diff: src/arraybuffer.js

Issue 212603014: Inline internal getters for typed arrays & friends. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix ApiObjectGroupsCycleForScavenger test Created 6 years, 8 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 | « no previous file | src/hydrogen.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 27 matching lines...) Expand all
38 } else { 38 } else {
39 throw MakeTypeError('constructor_not_function', ["ArrayBuffer"]); 39 throw MakeTypeError('constructor_not_function', ["ArrayBuffer"]);
40 } 40 }
41 } 41 }
42 42
43 function ArrayBufferGetByteLength() { 43 function ArrayBufferGetByteLength() {
44 if (!IS_ARRAYBUFFER(this)) { 44 if (!IS_ARRAYBUFFER(this)) {
45 throw MakeTypeError('incompatible_method_receiver', 45 throw MakeTypeError('incompatible_method_receiver',
46 ['ArrayBuffer.prototype.byteLength', this]); 46 ['ArrayBuffer.prototype.byteLength', this]);
47 } 47 }
48 return %ArrayBufferGetByteLength(this); 48 return %_ArrayBufferGetByteLength(this);
49 } 49 }
50 50
51 // ES6 Draft 15.13.5.5.3 51 // ES6 Draft 15.13.5.5.3
52 function ArrayBufferSlice(start, end) { 52 function ArrayBufferSlice(start, end) {
53 if (!IS_ARRAYBUFFER(this)) { 53 if (!IS_ARRAYBUFFER(this)) {
54 throw MakeTypeError('incompatible_method_receiver', 54 throw MakeTypeError('incompatible_method_receiver',
55 ['ArrayBuffer.prototype.slice', this]); 55 ['ArrayBuffer.prototype.slice', this]);
56 } 56 }
57 57
58 var relativeStart = TO_INTEGER(start); 58 var relativeStart = TO_INTEGER(start);
59 if (!IS_UNDEFINED(end)) { 59 if (!IS_UNDEFINED(end)) {
60 end = TO_INTEGER(end); 60 end = TO_INTEGER(end);
61 } 61 }
62 var first; 62 var first;
63 var byte_length = %ArrayBufferGetByteLength(this); 63 var byte_length = %_ArrayBufferGetByteLength(this);
64 if (relativeStart < 0) { 64 if (relativeStart < 0) {
65 first = MathMax(byte_length + relativeStart, 0); 65 first = MathMax(byte_length + relativeStart, 0);
66 } else { 66 } else {
67 first = MathMin(relativeStart, byte_length); 67 first = MathMin(relativeStart, byte_length);
68 } 68 }
69 var relativeEnd = IS_UNDEFINED(end) ? byte_length : end; 69 var relativeEnd = IS_UNDEFINED(end) ? byte_length : end;
70 var fin; 70 var fin;
71 if (relativeEnd < 0) { 71 if (relativeEnd < 0) {
72 fin = MathMax(byte_length + relativeEnd, 0); 72 fin = MathMax(byte_length + relativeEnd, 0);
73 } else { 73 } else {
(...skipping 30 matching lines...) Expand all
104 InstallFunctions($ArrayBuffer, DONT_ENUM, $Array( 104 InstallFunctions($ArrayBuffer, DONT_ENUM, $Array(
105 "isView", ArrayBufferIsView 105 "isView", ArrayBufferIsView
106 )); 106 ));
107 107
108 InstallFunctions($ArrayBuffer.prototype, DONT_ENUM, $Array( 108 InstallFunctions($ArrayBuffer.prototype, DONT_ENUM, $Array(
109 "slice", ArrayBufferSlice 109 "slice", ArrayBufferSlice
110 )); 110 ));
111 } 111 }
112 112
113 SetUpArrayBuffer(); 113 SetUpArrayBuffer();
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698