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

Side by Side Diff: Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.cpp

Issue 9186030: Merge 104736 - [v8] Int16Array.set(array, offset) fails on first execution (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 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 | « Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 v8::Handle<v8::String> key = v8::String::New(fastSetFlagName); 51 v8::Handle<v8::String> key = v8::String::New(fastSetFlagName);
52 global->SetHiddenValue(key, v8::Boolean::New(true)); 52 global->SetHiddenValue(key, v8::Boolean::New(true));
53 53
54 String source(reinterpret_cast<const char*>(V8ArrayBufferViewCustomScript_js ), 54 String source(reinterpret_cast<const char*>(V8ArrayBufferViewCustomScript_js ),
55 sizeof(V8ArrayBufferViewCustomScript_js)); 55 sizeof(V8ArrayBufferViewCustomScript_js));
56 v8::Handle<v8::Script> script = v8::Script::Compile(v8String(source)); 56 v8::Handle<v8::Script> script = v8::Script::Compile(v8String(source));
57 script->Run(); 57 script->Run();
58 } 58 }
59 59
60 60
61 void copyElements(v8::Handle<v8::Object> destArray, v8::Handle<v8::Object> srcAr ray) 61 void copyElements(v8::Handle<v8::Object> destArray, v8::Handle<v8::Object> srcAr ray, uint32_t offset)
62 { 62 {
63 v8::Handle<v8::String> key = v8::String::New("set"); 63 v8::Handle<v8::String> key = v8::String::New("set");
64 v8::Handle<v8::Function> set = destArray->Get(key).As<v8::Function>(); 64 v8::Handle<v8::Function> set = destArray->Get(key).As<v8::Function>();
65 v8::Handle<v8::Value> argument = srcArray; 65 v8::Handle<v8::Value> arguments[2];
66 set->Call(destArray, 1, &argument); 66 int numberOfArguments = 1;
67 arguments[0] = srcArray;
68 if (offset) {
69 arguments[1] = v8::Uint32::New(offset);
70 numberOfArguments = 2;
71 }
72 set->Call(destArray, numberOfArguments, arguments);
67 } 73 }
68 74
69 } 75 }
OLDNEW
« no previous file with comments | « Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698